”A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away” ~Antoine de Saint-Exupery

The side effect of Test-Driven Design

Posted: March 7th, 2009 | Author: maudrit | Filed under: Agile | Comments Off

Unit testing is an integral part of modern software development; it is difficult to imagine building reliable software in a cost effective way without the use of this valuable technique.

Most developers produce some kind of unit test script immediately after the creation of a component as a verification mechanism; approach that work pretty well most scenarios. But, working in this fashion don’t allow us to fully take advantage of all the benefits unit testing may bring, due to the fact that the test is only used as a verification and not as a tool to assist the developer in the understanding of the problem to be solved.

Test-driven design (TDD) calls for the creation of tests prior the implementation of the components. TDD considers testing an integral part of the detail technical design. Developing tests first (before producing any significant production code) helps in the understanding of the responsibilities and scenarios related to a component, inevitably improving the overall quality of the design.

“If it’s worth building, it’s worth testing. If it’s not worth testing, why are you wasting your time working on it?” - Scott W. Ambler

A test has multiple purposes, it provides a verification mechanism, it helps to identify refactories opportunities and also serves as an important part of the documentation of the component by illustrating the different conditions and scenarios handle by it.

Automation is a key part of good testing. Performing manual testing is not only unreliable but expensive and time consuming. Adopt tools that allow the automation of unit testing, integration testing and regression testing. Measure progress by introducing test converge tools to the build cycle to ensure the effectiveness of the test effort, but more important learn and understand what the metrics mean and take appropriate actions to achieve expected results.

All tests produced by a development organization should be considered an asset. Automated tests act as a safety net, providing a reliable way to introduce new features and changes to any code base in a cost effective way.

Thoughts?


Scrum with Ken Schwaber

Posted: February 27th, 2009 | Author: maudrit | Filed under: Agile | No Comments »

Copyright: All rights reserved by creator.