Test Driven Development
“Test-driven development” refers to a style of programming in which three activities are tightly interwoven: coding, testing (in the form of writing unit tests) and design (in the form of refactoring).
It can be succinctly described by the following set of rules:
-
write a “single” unit test describing an aspect of the program
-
run the test, which should fail because the program lacks that feature
-
write “just enough” code, the simplest possible, to make the test pass
-
“refactor” the code until it conforms to the simplicity criteria
-
repeat, “accumulating” unit tests over time
Books
-
Test Driven Development: By Example by Kent Beck
-
Growing Object-Oriented Software Guided by Tests by Nat Pryce and Steve Freeman
-
Professional Test Driven Development with C# by James Bender
-
The Art of Unit Testing: with examples in C# by Roy Osherove
Articles
-
Step by Step Walkthrough of iOS Test Driven Development in Swift
-
Unit Tests Are FIRST expansion on Agile in a Flash: FIRST properties of unit tests