Who really does test-driven development

Test-driven development - more than just quality assurance

Testing is part of (agile) software development - no question about it: the project has been completed and the result is being tested. However, this classic test procedure often harbors dangers.

Tests are carried out, but usually too late, too seldom and accordingly too time-consuming and costly - or completely haphazard. The method of Test D.riven D.evelopment (TDD for short) or test-driven development aims to counter these classic problems.

DILBERT © (2011) Scott Adams. Used By permission of UNIVERSAL UCLICK. All rights reserved.

Test-driven development as a process model

TDD is a procedural model for programming. Similar to how an athlete becomes aware of his or her movement sequence in order to achieve better and better results, in test-driven development an explicit sequence helps us to continuously optimize our development work. Always achieving the best possible result is not left to chance, but is the consequence of a methodology.

Keyword: Test First!

The issue of avoiding errors is an essential strength in test-driven development. With the Test First approach, classic testing is reversed: The finished implementation is not tested at the end of the project - on the contrary, test-driven development is part of the project from the start.

This not only ensures that a system can be tested right from the start, but also achieves a complete and automated check of all components. Regression errors can thus be recognized at an early stage and eliminated with comparatively little effort.

Multitasking as a challenge

In addition to this obvious advantage, there is another, essential aspect of test-driven development, which we will illustrate using an example that has nothing to do with software development:

When we cook for friends, it is always a great challenge to get everything ready at the same time: All dishes have to be cooked and warm - but hopefully not burnt. We should also take into account any special requests from our guests and ensure that the glasses do not remain empty for too long while eating. All of this requires multitasking and the utmost attention - and unfortunately it occasionally goes wrong.

In software development, too, we have to keep an eye on various aspects at the same time:

The specification

At the beginning of our software development project, we must be able to name and define the initial problem precisely: What requirements do we want and must meet with our implementation? The question implies that we have to think about boundary, pre- and post-conditions as well as borderline cases.

The implementation

The problem is defined, now we have to find the right solution. It must be ensured that the previous tests continue to run without errors.

The optimization

The code, i.e. the result of our project, should not only solve a one-off problem - it should be optimized for permanent use. It should follow the appropriate development standards and be maintainable. Other developers who have to rely on it later should understand how my code works and, if necessary, be able to easily extend it or link it to it.

Multitasking through methodology

It is difficult to do several things at the same time in an optimal way, even in programming. In the test-driven development, the TDD cycle helps us to approach the above-mentioned aspects in separate phases and to be able to devote our attention to exactly one task - and to achieve a well-rounded result at the end of our project.

We see that quality assurance is an important point when using TDD: Continuous testing right from the start creates a constant workflow through which we regularly have an executable version of our software - and know exactly where we are in development, which milestones still need to be overcome and which problems still need to be solved

Quality assurance does not take place half-heartedly at the end of development, but is ensured in the ongoing process.

But TDD offers even more: The system, which can be tested from the start, and the possibility of detecting and correcting errors at an early stage, ensure sustainability and cost efficiency in product development.

As developers, we can also always focus on current topics without having to keep an eye on all the sidelights. The test-driven development not only optimizes the result, but also our own development work.

Do you want to learn more about agile topics?