Test-Driven development (TDD) is a process of repetition of a short development cycles. The developer writes automated test cases with the minimum amount of code to pass testing. Little by little, with testing along the way, in other words.

Cycle:

  1. Write test
    • The benefit of TDD over Unit testing: the developer focuses on the requirements before writing the code.
  2. Run All Tests, see if new ones fail
    • Test the Test
  3. Coding
    • Write code that is designed to pass the test.
  4. Run Tests
    • Code must pass test requirements & not break or degrade existing features.
  5. Refactor Code
    • Growing code must be cleaned.
    • Remove duplication
    • Object, Class, modules, variables, and method naming must be Clear
      • Improve Readability, Maintainability

Summary:

1. Setup 2. Execute 3. Validate 4. Cleanup

Advertisements