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

Introduzione al TDD @ Milano XPUG 21/9/2016

Introduzione al TDD @ Milano XPUG 21/9/2016

Le slide usate durante l'incontro

Andrea Francia

September 21, 2016
Tweet

More Decks by Andrea Francia

Other Decks in Technology

Transcript

  1. Royce, Winston (1970), "Managing the Development of Large Software Systems"

    (PDF), Proceedings of IEEE WESCON, 26 (August): 1–9
  2. Three Rules of TDD 1.You can’t write any production code

    unless is to make green a red test 2.You can’t add more code to a test than is sufficient to make it red 3.You can’t write more production code than is sufficient to make the test green http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
  3. Simple Design 1. Runs all the tests 2. It’s not

    redundant (no duplication) 3. Expresses every idea that we need to express 4. It’s small in this order http://c2.com/cgi/wiki?XpSimplicityRules
  4. The FizzBuzz Game 1, 2, Fizz!, 4, Buzz!, Fizz!, 7,

    8, Fizz!, Buzz!, 11, Fizz!, 13, 14, FizzBuzz!, 16, 17, Fizz!... If the number is a multiple of 3, say “Fizz” If it is a multiple of 5, say “Buzz” If it is a multiple of 3 and 5, say “FizzBuzz” Otherwise, just say the number. Matteo Vaccari Open/Closed Principle Dojo
 http://www.slideshare.net/xpmatteo/20101125-ocpxpday
  5. A good unit test… •should run fast •should help localize

    problems Working Effectively with Legacy Code - Michael Feathers
  6. What is not unit test? A test is not a

    unit test if: 1.It talks to a database. 2.It communicates across a network. 3.It touches the file system. 4.Requires some manual set-up Working Effectively with Legacy Code - Michael Feathers
  7. What is not unit test? A test is not a

    unit test if: 1.It talks to a database. 2.It communicates across a network. 3.It touches the file system. 4.Requires some manual set-up Working Effectively with Legacy Code - Michael Feathers