Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Test-Driven Development

Test-Driven Development

Non-technical introduction to test-driven development in its broadest sense.

Topics included:
* Fractal concept: Lean/3 horizon/3X model, hypothesis-driven development
* "Developer TDD": Mockist vs. classicist
* Why do TDD?
* When to invest in TDD/test automation
* Case studies from AE customers

Jo Van Eyck

February 04, 2016
Tweet

More Decks by Jo Van Eyck

Other Decks in Programming

Transcript

  1. ae nv/sa Interleuvenlaan 27b, B3001 - Heverlee T +32 16

    39 30 60 F +32 16 39 30 70 www.ae.be TEST-DRIVEN DEVELOPMENT
  2. STYLES OF TDD • Detroit • Bottom-up • Limited use

    of mocks • “Easy” • Possible rework
  3. STYLES OF TDD http://codurance.com/2015/05/12/does-tdd-lead-to-good-design/ “Which TDD style should we use?

    Both. All. They are just tools and as such, they should be used according to your needs. Experienced TDD practitioners jump from one style to another without ever worrying which style they are using.”
  4. WHY NOT? http://research.microsoft.com/en-us/groups/ese/nagappan_tdd.pdf https://leanpub.com/leprechauns “The results of the case studies

    indicate that the pre-release defect density of the four products decreased between 40% and 90% relative to similar projects that did not use the TDD practice. Subjectively, the teams experienced a 15–35% increase in initial development time after adopting TDD.”
  5. WHY NOT? http://research.microsoft.com/en-us/groups/ese/nagappan_tdd.pdf https://leanpub.com/leprechauns “The results of the case studies

    indicate that the pre-release defect density of the four products decreased between 40% and 90% relative to similar projects that did not use the TDD practice. Subjectively, the teams experienced a 15–35% increase in initial development time after adopting TDD.” “a survey of all of the studies that have been done on TDD have shown that the better the study done, the weaker the signal as to its benefit”
  6. WHY NOT? http://codurance.com/2015/05/12/does-tdd-lead-to-good-design/ https://www.quora.com/Does-test-driven-development-TDD-really-improve-software-quality/answer/Robert-Martin-9?srid=zADr http://blog.ploeh.dk/2010/12/22/TheTDDApostate/ http://blog.jbrains.ca/permalink/tdd-is-not-magic “Any developer can make

    a mess regardless if they are writing tests or not. Developers can also test drive crap regardless of which TDD style they are using.” “Extremes are bad. We are going from BDUF (Big Design Up Front) to no design at all. Throwing away our design knowledge is a mistake.” “TDD does not drive us towards good design. It is not a design technique. I still write code test-first because I find it more productive, but I make design decisions out of band.” “TDD is not magic. The rules themselves do not guarantee success. You have to keep the brain switched on.”
  7. TRADEROUTER 32,93% 32,64% 41,76% 41,52% 33,63% 31,92% 27,95% 31,15% 35,22%

    36,08% 36,08% 35,79% 37,32% 35,24% 34,41% 35,55% 35,00% 33,18% 33,14% 22,00% 24% 24% 28% 25% 29% 0% 5% 10% 15% 20% 25% 30% 35% 40% 45% 50% 55% 60% 65% 70% 75% 80% 85% 90% 95% 100% 10/1… 31/1… 21/0… 11/0… 4/03… 25/0… 15/0… 6/05… 27/0… 17/0… 8/07… 29/0… 19/0… 9/09… 30/0… 21/1… 11/1… 2/12… 23/1… 13/0… 3/02… 24/0… 17/0… 7/04… 28/0… 19/0… 9/06… 30/0… 21/0… 11/0… 1/09… 22/0… 13/1… 3/11… 24/1… 15/1… 5/01… 26/0… 16/0… 9/03… 30/0… 20/0… 11/0… 1/06… 22/0… 13/0… 3/08… Code Coverage Date TRADZSTER: % covered Total
  8. REFERENCE DATA @ TEST-AANKOOP 84 unit 15 acceptance + 11

    data 4 E2E against public API 5s 2s 7s <1s
  9. DGZ • New greendfield project • 10 KLOC production code

    • 5+ KLOC test code • Lead by example • Consistent quality • Code review / pair programming • Guerilla implementation • 2 years @ DGZ • Prepare for tough questions • How much longer will features take? • QA out of a job? • Where do we start?
  10. QUALITY @ YOUR ACCOUNT • Can developers suggest/implement design improvements

    during development of a feature? • How many tasks come back after being rejected by seperate QA team? • How long does it take for a change on a single line of code • To be “done”? • To be pushed to production? • Can you trace lines of code back to features/business value? • How much time do devs spend • Writing tests? • Fixing tests?