Agile Test Driven Development
TDD is a
technique in which you write the tests before you write the code you
want to test
This seems
backward, but it really does work better:
ü
When tests are written first, you have a clearer
idea what to do when you write the methods
ü
Because the tests are written first, the code is
necessarily written to be testable
ü
Writing tests first encourages you to write
simpler, single-purpose methods
ü
Because the methods will be called from more
than one environment (the “real” one, plus your test class), they tend to be
more independent of the environment