Test Driven Development is a different approach of developing software. It puts primary focus on passing test criteria over the creation of code. This takes time but ensures that the quality of the end output is extremely high.
In this article we discuss Test Driven Development in more detail.
What is Test Driven Development?
Test driven development (TDD) is the act of first deciding what you want your program to do (the specifications), formulating a test, then writing the code to make that test pass. It is most often associated with automated testing. Although you could apply the principals to manual testing as well.
The concept of TDD is to put primary focus on testing and embed it completely into the development process.
How does TDD differ from traditional testing?
It uses traditional testing methods both manual/user and automated testing techniques. The main change is the approach and the fact that tests are written before the code.
As with traditional testing, the greater the risk profile of the system the more thorough your tests need to be. With both traditional testing and TDD you aren’t striving for perfection, instead you are testing to the importance of the system.
Why it is used?
The key use case is quality. If you are developing a software solution that needs to be of a very high quality, TDD should be considered. TDD provides the best framework to ensure the highest standards of output and the most thorough approach to testing. Each test is run after every iteration, meaning you have 100% test coverage.
Another reason for its popularity is how well it aligns to agile methodology. TDD allows you to break down parts of the solution, create test, create code, pass the test and move on. All the while knowing that everything you have created so far is available and maintains its ability to pass the test.
Generally, TDD is more expensive and time consuming and means some organisations choose to only apply it to critical or high-risk components of solutions. This means the key part of the solution is guaranteed but for the rest of the solution a more cost-effective traditional approach can be applied.
How it works
TDD works in an iterative fashion, where the development of the solution or application is broken down into goals/requirements that are required to create and then once this goal is met, moving on to the next iteration and repeating until all of the goals are met and the application is ready.
- Agree requirement/goals
- Create automated testing to ensure goals are met
- Write code to deliver the required outcome
- Run the test
- Run all tests for previous stages to ensure each goal is still being met
- Move on to next stage
Test Driven Development has a couple of drawbacks. Firstly, it is a longer process, more testing within a software project will inevitably take more time and result in more cost to create the end product. The idea is that the quality of the end product is higher.
The second drawback is it is a very different approach and so many developers may not be used to it. It requires a more abstract approach to delivering a solution and will be a bit of a challenge to attempt for the first time.
Bridgeall has used TDD for a number of our key application development projects, for a full list please see our projects pages here. To discover more about our approach to software development visit our application development page or contact us.