Introduction to Test-Driven Development Holger Schmeisky
Aug 07, 2015
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]:
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
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]