Test Driven Development (TDD)

Test-driven development requires that an automated unit test, defining requirements of the code, is written before each aspect of the code itself. These tests contain assertions that are either true or false. Running the tests gives rapid confirmation of correct behaviour as the code evolves and is refactored. Testing frameworks based on the xUnit concept (see the list of unit testing frameworks for an exhaustive list) provide a mechanism for creating and running sets of automated test cases.

TDD:

  1. 1.Add a test
  2. 2.Run all tests and see the new one fail
  3. 3.Write some code
  4. 4.Run the automated tests and see them succeed
  5. 5.Refactor code


Back to Development Methodologies