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

后端 未结 12 1020
轻奢々
轻奢々 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条回答
  •  没有蜡笔的小新
    2021-02-03 19:00

    I think one of the biggest con of testing "after the fact" is that you will probably have a harder time testing. If you write code without tests, you usually don't have testability in mind and end up writing code that is hard to test.

    But, after you spent this extra time writing tests and changing your code for better testability, you'll be much more confident about making changes, once you won't need a lot of time to debug and check if everything is ok.

    Finally, you might find new bugs which weren't caught before, and spend some time fixing it. But hey, that's what tests are for =)

提交回复
热议问题