Test-driven development (TDD) refers to developing test cases before writing the actual code. This technique proves very efficient and is a precursor to the agile development. It focuses heavily on efficient coordination between developers and testers.
TDD is the backbone of the clean architecture, a coding convention that makes industrial quality code.
There are three major steps for TDD, and they are as follows:
There are two levels of TDD:
Acceptance test-driven development(ATDD) comprises only one acceptance test. This test is responsible for justifying the behavior of TDD.
Developer test-driven development(DTDD) is primarily composed of only one developer test. This singular test is responsible for providing details about the TDD.
Some of the reasons why TDD is regarded highly is because of the following:
Some of the frameworks of TDD are as follows:
Note: TDD follows the layered architecture and is used in clean architecture.
The following is how the project structure looks under TDD and clean architecture.
|____Educative_calculator
| |____ __init__.py
| |____ addition.py
| |____ multiplication.py
|____tests
|____ __init__.py
|____ pytest.py
|____ test_addition
| |____ __init__.py
| |____ new_add.py
|____ test.multiplication
|____ __init__.py
|____ new_mul.py
Free Resources