Short introduction to Test Driven Development.
Help at Softwerkskammer Berlin on 26th of January 2015 by Holger Schmeisky.
http://www.meetup.com/Software-Craftsmanship-Berlin/events/210424552/
3. Definition
● Kent Beck popularized the term
as „Test-first development“ in 2000
● "Write a failing automated test before
changing any code."
● (Not more, because "Incremental Design" is a separate
XP practice)
● [Extreme Programming 2, Chap.7]:
4. Definition
● Martin Fowler
● „Write a test for the next bit
of functionality you want to add.
● Write the functional code until the
test passes.
● Refactor both new and old code to make it well
structured.“
http://martinfowler.com/bliki/TestDrivenDevelopment.html
5. Definition
● Uncle Bob
● "You may not write production code
until you have written a failing unit test.
● You may not write more of a unit test than is sufficient to
fail, and not compiling is failing.
● You may not write more production code than is sufficient to
pass the currently failing test.
● These three laws lock you into a cycle that
is perhaps thirty seconds long."
[Clean Code, Chapter 9]
7. Advanced Topics (not covered)
● How many unit tests to keep?
● How to maintain suites of unit tests?
● What is the best choice of „unit“? (In more complex
problems)
● When can mocking be helpful, when harmful?
● How much should you design for testability?