Test Driven Development

If you look as a purist at the TDD principles, you'd say that TDD is a technique for developing software based on a set of small development cycles, where each cycle consists of a test case that defines the code requirements and the code that will satisfy these requirements. TDD is also known as red-green-refactor because the lifecycle of a test includes three simple steps:

  • Write the test and the assertions and fail them (red).
  • Implement the code to pass the assertions (green).
  • Refactor the code and test it again.

This type of approach may look strange to you at the beginning, but you will realize that if you write the code that identifies an application requirement before the requirement has been written in code, the ...

Get Applied WPF 4 in Context now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.