TDD & Refactoring, Gold Partners?

xiaoxiao2021-03-06  64

After a version of the project, I call the code to refactor. The comrades next to "No! There is no TDD test case, which can be reconstructed? Any change may have an unbearable bug, the tester is all re-test!" Listen to this, the test personnel Also come over to deny me.

In fact, my requirements are not high, and the variable or function name is changed, because the code written in the time is really bad. Is there any TDD really unable to recover? Or I should notify this word, let people feel like going to work?

The first two years of work is not with testers, and often doing a single horses, and the quality is completely guaranteed. Because there is no more people to cooperate, all aspects of the code are more clear, and the impact of a local change may result in roughly to judge (of course, there are many no longer thinking ...), so even if there is no TDD, do not change The adjustment of the function is also a normal thing.

I used to do a Mole project. At that time, I didn't have much concept on TDD, but I just saw the refactoring book, and the project time was relatively large, so I made a reactor manual. Many times, it is not completely reconstructed for the optimization of the structure, but the current implementation does not have a demand, it is necessary to do a large-scale adjustment, so it is necessary to change the structure of the code while improving the function while improving the function (to be said to be Reconstructing * _ *), because the fine-grained functional package is better, each adjustment does not produce too much difficult BUG, ​​and it feels quite good at the time.

Of course, the nature and environment of the project are different, and the words of colleagues may not reason. Just feel that TDD is more advantageous to use in complex domain models. This is the main in I seem to be demo, the code is mainly in the data storage layer and the interface layer, the concept and use of OO is also weak, how can I use TDD? Don't I use TDD in the beginning, then only let the system slowly rot?

Oh, I expect managers to review the "people's myth", how to deal with the first version of the project, suggesting that it is completely abandoned, perhaps the above contradictions will have the opportunity to solve.

转载请注明原文地址:https://www.9cbs.com/read-89296.html

New Post(0)