Test-Driven Development (TDD) consists of short development iterations where the test case(s) covering a new functionality are written first. The emphasis is on developing and implementing unit test cases before developing the code The code and components are refactored until the test passes, thus ensuring that no code is developed if it is not required. Test Driven Development can be implemented at various levels including the basic cycle of component level development and the entire development process that encompasses functional and non-functional testing. The most experienced software development firms are embracing TDD.
There are several principles of this development methodology that align closely with the Agile/Scrum method of software development. TDD integrates with the Agile process in the following manner:
- Fits In With Agile. TDD fits the overall principles of Agile methodology. Each sprint in the Agile development methodology would come to an end with the successful delivery of functionality. The delivery is deemed to be successful once the pre-determined test cases are successfully executed as advocated by TDD.
- Immediate Feedback. In TDD, the development team gets immediate feedback on the components they develop due to the immediate execution of the test cases. This leads to fixing of defects and delivery of working code. The focus of Agile development is on delivering functionality early in the development cycle, as opposed to waiting for a formal sign off on the requirements. Hence there is a clear synergy between TDD and Agile methodology.
- Eliminates Waste. There is no development of unnecessary code as the entire software application testing is geared towards ensuring the successful execution of the test cases. This results in eliminating wasted effort in design and development, a direct application of Lean concepts, that are closely aligned to Agile way of software development.
- Refactoring Is Key. Within the Agile process and TDD methodology refactoring is a key element. A trend analysis of how the design and implementation evolves provides an indication of the likelihood of reaching a stable architecture and design.
- Validation Framework. TDD provides a framework to automatically validate incremental code against pre-defined test cases and adds critical quality metrics (code coverage and passed tests). The test results provide a basis for client and partner management to take corrective action as required.
- Supports Evolving Requirements. TDD allows changing requirements as there is no insistence on having a signed off requirements package before commencement of design and development. This ensures that the functionality delivered is more likely to meet the business requirements.
In summary, TDD with its strong emphasis on testing, advocates that tests should span the entire breadth of codebase and all tests should pass for the software to be deemed ready for delivery, your software development company will keep you aprised with delivery timetable. This promotes the development of high quality working code, reducing the time taken for delivering functionality to clients, supports iterative development and shortens the programming feedback. The focus is not on freezing the entire requirements, but on incremental development and delivery that is more likely to meet the expectations of stakeholders than the conventional way of software development.