Pro's and Con's of unit testing after the fact

后端 未结 12 810
轻奢々
轻奢々 2021-02-03 18:43

I have a largish complex app around 27k lines. Its essentially a rule drive multithreaded processing engine, without giving too much away Its been partially tested as it\'s been

12条回答
  •  梦毁少年i
    2021-02-03 19:02

    I think there are several advantages to unit testing existing code

    • Regression management
    • Better understanding of the code. Testing it will reveal cases you did not anticipate and will help define the behavior of the code
    • It will point out design deficiencies in the code as you stuggle to test poorly defined methods.

    But I think it's more interesting to consider the cons of unit testing code. AFAIK, there are no cons. All of the time spent adding tests will pay for themselves even in everything but the shortest of time cycles.

提交回复
热议问题