Software archaeology for beginners: code, community and culture

Post on 08-Sep-2014

3,873 views 0 download

Tags:

description

Most open source projects are rightly proud of their communities, long histories (both measured in time and version control), passionate debates and occasional trolling. Newcomers to these communities often face an uphill battle, though. Not just in understanding decision making processes and community standards, but in coming to terms with often complex, contradictory, and poorly documented code bases. This talk will introduce you to the concepts and tools you need to be an expert code, culture, and community archaeologist and quickly become productive and knowledgeable in an unknown or legacy code base.

transcript

Software Archaeology For Beginners

Code, Community and Culture

who

engineer and operations chapopen source chapfunny accent

(photo by Jennie Rainsford)

other mattersauthor

http://www.jamesturnbull.nethack-n-slash developer

https://github.com/jamtur01pontification

http://www.kartar.net

The LogStash Book

www.logstashbook.com

The Docker Book

www.dockerbook.com

Who are you?

Why?

Three themesA bit of culture

Some things about communityQuite a lot about code,documentation and tests

But I thought thistalk was justtechnical?

Or ... Why do I give a crap aboutculture and community?

Culture

What's culture?Why is culture important?

Read & ListenPatience is a virtue

Community

CommunicationUse the mechanisms the project use

Ask questionsOver-share

Be polite, be upbeat

CollaborationEarn trust through little steps

But it's broken!

You catch moreflies with honey

Code,Documentation

and Tests

What is SoftwareArchaeology?The fine art of software

dumpster diving

DocumentationVisualization

Testing & TruthDesign & StylePerformance

Read all thedocumentation

Run all thedocumentation

(Re-)Writedocumentation

Is there a design?

Draw picturesand write down

the story

Build adevelopmentenvironment

And yes document it.

Run the tests

Fix the brokentests

You fixed thetests?

What do the testscover?

# go test -coverPASScoverage: 9.7% of statementsok github.com/dotcloud/docker 0.444s

Wow do we suck

Write new tests

Tests asdocumentation

Run Metrics

Metrics revealCode smells

Troubled subsystems

All good places to start coding

Style & Linting

# go tool vet .commands.go:567: arg s for printf verb %d of wrong typeengine/streams_test.go:168: arg expectedOutput for printf verb %d engine/streams_test.go:228: possible formatting directive graphdriver/aufs/aufs_test.go:389: arg change.Kind forgraphdriver/aufs/aufs_test.go:429: arg change.Kind forgraphdriver/devmapper/deviceset.go:35: struct field tag ̀json:devices̀ not compatible

Profiling

# go tool pprof api api.profWelcome to pprof! For help, type 'help'.(pprof) top10Total: 2525 samples298 11.8% 11.8% 345 13.7% runtime.mapaccess1_fast64268 10.6% 22.4% 2124 84.1% main.FindLoops251 9.9% 32.4% 451 17.9% scanblock178 7.0% 39.4% 351 13.9% hash_insert. . .

Performanceproblems areoften tied tocode smells

So what have welearnt?

Understand all ofculture,

community andcode

Little things canhave big impacts

Leave thingsbetter than youfound them.

Questions?

referencesDig - Copyright University of California Santa Cruz 2009Culture - Copyright Charles EbereonwuCommunity - Copyright Storm CryptFlies and Honey - Copyright Kent WangHappy Kids - Copyright LighttruthA Picture is worth a thousand words - Copyright Jessica Hemrick