TDD testing turns everything upside down. Usually, you write code and then test. In our case, you write the test first, and only then the code. You write and edit the code until the test lights up green. This process is repeated over and over. With its help, you define all the facets of the code's functionality and control its creation. Then you continue writing and editing the code until the test is successfully completed.
After a positive result, the code is refactored - cleaned of unnecessary data. The process is similar to proofreading a text, when you check it and remove all unnecessary elements for a more convenient and compact appearance.
Let's describe the whole process step by step so as not to get confused:
You create code and simultaneously run it through TDD.
You run the code several times until all of its iran email list functions pass the tests completely.
You refactor the code.
Visually, everything looks like this:
Test-Driven Programming
Pros:
Refactoring code step by step. In the classic version, the programmer is often carried away by the development of individual modules and misses important details.
Development is done based on the analysis of possible errors. The programmer begins to understand where the bugs come from and expands the functionality of the program.
The developer sees various implementation options. By increasing the complexity of the code based on the test results, the programmer considers the solution options and selects the most efficient ones.
The Purpose of TDD
Test-Driven Programming
Create a test for the required code
-
- Posts: 894
- Joined: Mon Dec 23, 2024 3:18 am