Monday, January 30, 2012

Test Driven Development - TDD

Typically, software gets written and then QC tries to figure out how to test it.

Better way is to write the tests first and the software afterwards.

To do this, it is necessary to first fully define all the interfaces of the software.
QC then writes all the tests against the interface. By all, we mean ALL! The tests should be comprehensive.

Once the tests are all ready, the software is written. Needless to say, all the tests fail initially - because the interface has not been implemented yet.

As more and more of the software gets written, more and more tests start to pass.

When all the tests pass, it means the software is ready-ready.

Furthermore, if any code needs to be refactored in the future, the unit tests will automatically ensure the code integrity.

No comments: