Unit Testing - What not to test

后端 未结 9 1153
悲哀的现实
悲哀的现实 2020-12-14 07:34

I have gone through a number posts on stackoverflow and numerous articles about Unit Tests. I am just trying to figure out that what I have understood is right.

9条回答
  •  我在风中等你
    2020-12-14 07:41

    If you have stuff that already works, it may not be worth the time to write a bunch of tests around it. The caveat here is that if you need to make changes to it, or code that uses it, then those tests are invaluable.

    As for not needing to test the DAL's handling of invalid input... you need to figure out what your service boundary is. This really depends. If you cannot control the client, then you need to test that your server's expectations are being met (at some layer).

提交回复
热议问题