The following sequence of steps is generally followed:
Add a test
Run all tests and see if the new one fails
Write some code
Run tests
Refactor code
Repeat
Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards.
C++GPL-3.0