11
Mar

Introduction to Test Driven Development (TDD)

Modern projects, are attached new methodologies, on my current project we are implementing TDD, Test Driven Development, we expect to achieve a 70% time win on project, and a bug fix time reduction of 50%.

What is Test Driven Development ?

“Test-Driven Development (TDD) is a software development technique consisting of short iterations where new test cases covering the desired improvement or new functionality are written first, then the production code necessary to pass the tests is implemented, and finally the software is refactored to accommodate changes. The availability of tests before actual development ensures rapid feedback after any change. Practitioners emphasize that test-driven development is a method of designing software, not merely a method of testing.”

In http://en.wikipedia.org/wiki/Test-driven_development

Test Driven Development Workflow

1. Add a test
2. Run all tests and see the new one fail
3. Write some code
4. Run the automated tests and see them succeed
5. Refactor code

Three suggestions for a productive TDD Cycle

1. Write only code if one test fails
2. Write only tests enough to make the execution fail
3. Write only enough code to pass the test

Interesting links about TDD

Coming next: PHP And Test Driven Development

Related posts:

  1. PHPUnit – Generating Test Skeleton from a Class
  2. PHP Development best practices

enjoyed this post? share with others:

twitter stumble upon digg

This entry was posted on Tuesday, March 11th, 2008 at 11:20 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.

leave a comment