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

后端 未结 12 832
轻奢々
轻奢々 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:04

    Unit testing "after the fact" is still valuable, and provides most of the same advantages of unit testing during development.

    That being said, I find it's more work to test after the fact (if you want to get the same level of testing). It's still valuable, and still worth while.

    Personally, when trying to tackle something with limited time, I try to focus my testing efforts as much as possible. Any time you fix a bug, add tests to help prevent it in the future. Any time you're going to refactor, try to put enough testing in place to feel confident you're not going to break something.

    The only con of adding unit testing is that it does take some development time. Personally, I find that the development time spent on testing is far outweighed by the time saved in maintenance, but this is something you need determine on your own.

提交回复
热议问题