The Future of Software Development - Devin AI Innovative Approach.pdf
Measuring
1. Measuring & Analyzing
Things That Matter
When You Have Too
Many Things To Keep
Track Of* (chocolate salmon)
by @chadfowler
* this title easily understood by 13-15 year old students
Thursday, February 23, 12
4. How do we fix it?
• code reviews are hard
• code reviews are time consuming
• there are too many commits to review
• bulleted lists are awesome
Thursday, February 23, 12
5. information radiator
“Coined around 2000 while standing in a Thoughtworks
office looking at all the paper on the walls around me,
“information radiator” refers to a publicly posted display
that shows people walking by what is going on.
Information radiators are best when they are big, very
easy to see (e.g. not online, generally), and change often
enough to be worth revisiting.”
http://alistair.cockburn.us/Information+radiator
Thursday, February 23, 12
6. “Chart what you care about, what you worry about,
what you want other people to know.”
http://xprogramming.com/articles/bigvisiblecharts/
Thursday, February 23, 12
9. What Should We
Measure?
• Project progress
• Code complexity
• Developer “productivity”
• Business “key performance indicators”
• Bug/error rates
• Everything important
Thursday, February 23, 12
12. Flesch-Kincaid Reading Ease
Score Notes
90-100 easily understood by an average 11-year-old student
60-70 easily understood by 13- to 15-year-old students
0-30 best understood by university graduates
Thursday, February 23, 12
14. Maurice Halstead
“Software Science”
http://en.wikipedia.org/wiki/Halstead_complexity_measures
Thursday, February 23, 12
15. Measure units of human
thought used!!!
“Stroud’s (1955, 1967) original proposal, which is
usually called a discrete-moment model, claims that
all incoming information is processed in
nonoverlapping (i.e., temporarily discrete) samples
or scans and that the temporal order of stimuli
within a scan is not preserved.”
T ' = ( n1N2( n1log2n1 +
n2log2n2) log2n) / 2n2S
http://yunus.hacettepe.edu.tr/~sencer/complexity.html
Thursday, February 23, 12
16. abc
Assignment – an explicit transfer of data into a variable
Branch – an explicit forward program branch out of scope
Condition – a logical/Boolean test
|ABC| = sqrt((A*A)+(B*B)+(C*C))
http://www.softwarerenovation.com/ABCMetric.pdf
Thursday, February 23, 12
17. Cyclomatic Complexity
M = E − N + 2P
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components
Thursday, February 23, 12
18. Basis Path Testing
http://users.csc.calpoly.edu/~jdalbey/206/Lectures/BasisPathTutorial/index.html
Thursday, February 23, 12
19. Complexity
Conservation
“One of McCabe's original applications was to limit the complexity of
routines during program development; he recommended that
programmers should count the complexity of the modules they are
developing, and split them into smaller modules whenever the
cyclomatic complexity of the module exceeded 10.”
NO MORE THAN TEN GALLONS OF CYCLOMATIC
COMPLEXITY PER MODULE!!!!!
http://en.wikipedia.org/wiki/Cyclomatic_complexity#cite_note-mccabe76-2
Thursday, February 23, 12
20. Complexity &
Cohesion
“Our results support the idea that there is a relationship
between complexity and cohesion, basically that a lack of
cohesion is associated with high complexity”
Exploring the Relationship between Cohesion and Complexity - Stein, Cox, Etzkorn
- 2005
Thursday, February 23, 12
21. saikuro
http://saikuro.rubyforge.org/
Thursday, February 23, 12
26. Flog Method Reading Ease *
Score Notes
1-2 easily understood by an average Visual Basic developer
3-10 easily understood by PHP developers
10-20 best understood by Perl, Smalltalk, or Lisp developers
20+ rich hickey
* all totally contrived
Thursday, February 23, 12
27. flogtime
Not quite done, but a
fun quick hack
https://github.com/chad/flogtime
Thursday, February 23, 12
28. code coverage
https://github.com/colszowka/simplecov
Thursday, February 23, 12
29. code coverage
• C0 - every line executed
• C1 - every branch executed
• C2 - every code path across lines executed
It doesn’t matter which one. Only direction matters.
Thursday, February 23, 12
34. Bug Prediction at
Google
“Here at Google, we have thousands of
engineers working on our code base every
day. In fact, as previously noted, 50% of the
Google code base changes every month.”
http://google-engtools.blogspot.com/2011/12/bug-prediction-at-google.html
Thursday, February 23, 12
35. Bug Prediction at Google
https://github.com/igrigorik/bugspots
Thursday, February 23, 12
36. $> cd /your/git/repo
$> git bugspots -d 500
.. example output ..
Scanning /git/eventmachine repo
Found 31 bugfix commits, with 23 hotspots:
Fixes:
- Revert "Write maximum of 16KB of data to an SSL connection per tick (fixes #233)" for #273
- Do not close attached sockets (fixes #200)
- Write maximum of 16KB of data to an SSL connection per tick (fixes #233)
- Merge branch 'master' into close_schedule_fix
- Remove dependency on readbytes.rb for ruby 1.9 (fixes #167, #234)
- Fix compilation on MSVC2008 (fixes #253)
- EM::Deferrable#(callback|errback|timeout) now return self so you can chain them (closes #177)
- Make EventMachine::Connection#get_peername and #get_sockname valid for IPv6 (closes #132)
- reconnect DNS socket if closed
- Use String#bytesize in EM::Connection#send_datagram for 1.9 (closes #153)
Thursday, February 23, 12
43. graphite
Highly scalable open source real time
graphing engine.
http://graphite.wikidot.com/
Thursday, February 23, 12
44. statsd
Open source node-based daemon for
stats aggregation. UDP front-end for fault-
tolerance*.
Pushes aggregated stats into graphite.
https://github.com/etsy/statsd
Thursday, February 23, 12