Why Test Driven Development

  • Guarantees high quality solutions by definition 
  • Leads to cleaner and simpler solutions which are much easier to maintain
  • Gives confidence to developers to make changes without the fear of breaking something
  • Eliminates "time bombs" - hidden defects uncovered after releasing to production

How It Works

  • Developers must master TDD properly, otherwise all benefits disappear fast
  • Unit and integration tests are written one step ahead of the code - developers start writing tests, switch to code, then back to test, then back to code and so on. The idea is that tests are always one step ahead with the main goal of tests driving the process of writing the code
  • When tests are run a green bar is displayed when all of them pass, otherwise a red bar is displayed indicating some tests failed
  • Test written before makes the code testable by definition. Writing tests after writing the code makes it impossible to test in many cases due to complexity 
>
Success message!
Warning message!
Error message!