October 2013
Intermediate to advanced
368 pages
9h 20m
English
TDD results in unit tests . A unit test verifies the behavior of a code unit, where a unit is the smallest testable piece of an application. You typically write a unit test in the programming language of the unit.
A single unit test consists of a descriptive name and a series of code statements, conceptually divided into four (ordered) parts.
(Optional) statements that set up a context for execution
One or more statements to invoke the behavior you want to verify
One or more statements to verify the expected outcome
(Optional) cleanup statements (for example, to release allocated memory)
Some folks refer to the first three parts as Given-When-Then . In other words, ...