Test Driven Development

The TDD Cycle

The TDD Cycle

This sounds a bit like science..

Models of TDD and the scientific method

Why TDD

TDD is not an excuse to not do design

Writing good tests

Writing good tests in TDD

  • Test a single concept
  • It should be automated and repeatable.
  • It should be easy to implement.
  • It should be relevant tomorrow.
  • Anyone should be able to run it at the push of a button.
  • It should run quickly.

More tips on writing good tests

  • It should be consistent in its results
  • It should have full control of the unit under test.
  • It should be fully isolated.
  • When it fails, it should be easy to detect what was expected and determine how to pinpoint the problem.

Naming tests

  • Should be clear its a test
  • Describe what it is testing
  • Include expected outcome

Loading...