Software code is split into two parts— application code implements the actual software features and test code includes the tests that test the behavior of the application code. There are two ways to approach writing test code. One involves writing test code after application code, known as the test after development approach. This approach is the most natural and the one which all newcomers to testing will tend to perform at first.

Another testing approach entails writing tests before writing the application code. This is known as the test-driven development approach.

Test-driven development

Test-driven development (TDD) entails writing test code before the application code, as shown in the figure below:

Get hands-on with 1200+ tech skills courses.