Technique of test-driven development

Test-driven development begins by writing a test that fails; then you move on to creating the production code, seeing the test pass, and continuing on to either refactor your code or to create another failing test.

Steps:

  • Write a failing test to prove code or functionality is missing from the end product.
  • Make the test pass by writing production code that has the logic that fulfills the test.
  • Refactor your code by removing code duplicates, making it modular.
  • Run the test to confirm it works.
Share Article/Example:
  • Facebook
  • Twitter
  • del.icio.us
  • Digg
  • DotNetKicks
  • DZone