Your SlideShare is downloading. ×
0
Quality Up Front
How to spend less time debugging
Lars Jarnbo Pedersen
Co-founder Switch-Gears ApS
About me
Partner at Switch-Gears ApS
● Transitioning companies from old
development tools to modern Open Source
ones
Been ...
Pain in SW Development

50%

COST OF BUGS

of developer time is spent
finding and fixing bugs*

*http://www.businessweekly...
Why?
Programming is hard…
● you have to map the problem domain to
the programming language in use
● its usually a collabor...
Luckily

90%

COST OF BUGS

of the bugs can be
caught during
development*

*http://www.codinghorror.com/blog/2006/01/code-...
Because
Average defect detection rate is 25 percent for
unit testing, 35 percent for function testing, and
45 percent for ...
How?
Peer Code Review
● Beneficial for “quality of review” if the author
pre-reviews and leaves comments for
subsequent reviewe...
Peer Code Review
● Long methods and loops are very time
consuming to understand [Uwano2006]
● Review 100 to 300 LOC at a t...
Mental Model

Platform Knowledge
+
Development Process
=
Platform Quality
Increase Platform Knowledge
Write Readable Code!!!
● You spend much more time reading code than
writing it - so make it ni...
Optimize Development Process
Make it simple on the developers,
● allow multiple workflows at the developers
desk
● don’t l...
This is NOT rocket science!
So why don’t we do it already?
● Waterfall development
● Code Reviews are perceived expensive
...
Git / Gerrit / Jenkins
Git (DVCS) changes everything!
Git is NOT subversion++
● all operations except for push/pull are
local => well suited for ...
Gerrit
A developer codes - and asks for feedback
Peer Code Review
Another developer reviews and comments
Continuous Integration
Actually you saw it in action already!
Good tools help you without getting in the way
Our experiences - Low Gain Example

[Anonymized and obscured]
Our experiences - High Gain Example

[Anonymized and obscured]
References
Books
●
●

Code Complete: A Practical Handbook of Software Construction, Second
Edition by Steve McConnell (Jun...
Upcoming SlideShare
Loading in...5
×

Debugging 2013- Lars pedersen

114

Published on

Debugging- for rigtige programmører

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
114
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Debugging 2013- Lars pedersen"

  1. 1. Quality Up Front How to spend less time debugging Lars Jarnbo Pedersen Co-founder Switch-Gears ApS
  2. 2. About me Partner at Switch-Gears ApS ● Transitioning companies from old development tools to modern Open Source ones Been working for Nokia 2001-2012 ● Release manager for S40 software for many years ● Part of a small team that introduced Git, Gerrit and Jenkins to S40 development resulting in BIG productivity gains
  3. 3. Pain in SW Development 50% COST OF BUGS of developer time is spent finding and fixing bugs* *http://www.businessweekly.co.uk/hi-tech/14898-software-bugs-cost-more-than-double-eurozone-bailout
  4. 4. Why? Programming is hard… ● you have to map the problem domain to the programming language in use ● its usually a collaborative effort ● time pressure ● best practises are not shared Bugs are discovered late… ● context is lost ● often it is not the programmer who introduced the bug, who is fixing it
  5. 5. Luckily 90% COST OF BUGS of the bugs can be caught during development* *http://www.codinghorror.com/blog/2006/01/code-reviews-just-do-it.html
  6. 6. Because Average defect detection rate is 25 percent for unit testing, 35 percent for function testing, and 45 percent for integration testing. [McConnell93] Furthermore, the average effectiveness of design and code inspections are 55 and 60 percent. [McConnell93]
  7. 7. How?
  8. 8. Peer Code Review ● Beneficial for “quality of review” if the author pre-reviews and leaves comments for subsequent reviewers [Cohen2006] ● The longer a reviewer spends on the initial read-through, the more defects will ultimately be found [Uwano2006] ● Defect detection drops dramatically after ~60 minutes, to zero after ~90 minutes [Dunsmore2000]
  9. 9. Peer Code Review ● Long methods and loops are very time consuming to understand [Uwano2006] ● Review 100 to 300 LOC at a time, in 30-60 minutes chunks, with a break between each sitting [Cohen2006] ● Spend at least 5 minutes reviewing a single line of code [Cohen2006] ● Limit reviewing to 1 hour per day [Ganssle2009]
  10. 10. Mental Model Platform Knowledge + Development Process = Platform Quality
  11. 11. Increase Platform Knowledge Write Readable Code!!! ● You spend much more time reading code than writing it - so make it nice to read! ● Refactor if necessary ● Include test-code Commit changes in logical units ● Always commit working code ● Never mix error-fixes and feature implementations Write descriptive commit messages ● Make sure the reason for the change is clearly explained
  12. 12. Optimize Development Process Make it simple on the developers, ● allow multiple workflows at the developers desk ● don’t let the release/integration process stop the development flow ● minimize manual process steps while keeping a strict process ● automatically build and test all commits ● require code-review of all commits
  13. 13. This is NOT rocket science! So why don’t we do it already? ● Waterfall development ● Code Reviews are perceived expensive ● Last generation of tools do not support this easily What is enabling it now? ● Agile development ● New breed of Open Source tools
  14. 14. Git / Gerrit / Jenkins
  15. 15. Git (DVCS) changes everything! Git is NOT subversion++ ● all operations except for push/pull are local => well suited for continuous integration ● allows for multiple workflows ○ development ○ integration / releasing ● is a first class citizen during development AND debugging! ○ gitk for code analysis ○ git bisect for debugging
  16. 16. Gerrit A developer codes - and asks for feedback
  17. 17. Peer Code Review Another developer reviews and comments
  18. 18. Continuous Integration Actually you saw it in action already! Good tools help you without getting in the way
  19. 19. Our experiences - Low Gain Example [Anonymized and obscured]
  20. 20. Our experiences - High Gain Example [Anonymized and obscured]
  21. 21. References Books ● ● Code Complete: A Practical Handbook of Software Construction, Second Edition by Steve McConnell (Jun 16, 2004) Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin (Aug 11, 2008) Articles ● ● ● ● ● SCM Ranking (Switch-Gears) CI Ranking (Switch-Gears) Best Kept Secrets of Peer Code Review (Smartbear) The Cost of Software Bugs (Business Weekly) Code Review - Just Do It (Coding Horror) Videos ● ● Linus Torvalds on Git (Google TechTalk) Development at the Speed and Scale of Google (InfoQ)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×