How many unit tests should I write per function/method?

后端 未结 12 2100
忘了有多久
忘了有多久 2020-12-05 18:36

Do you write one test per function/method, with multiple checks in the test, or a test for each check?

12条回答
  •  执念已碎
    2020-12-05 19:02

    I would suggest a test case for every check. The more you keep atomic, the better your results are!

    Keeping multiple checks in a single tests will help you generate report for how much functionality needs to be corrected.

    Keeping atomic test case will show you the overall quality !

提交回复
热议问题