Why should I bother with unit testing if I can just use integration tests?

前端 未结 12 1394
别那么骄傲
别那么骄傲 2021-02-03 21:53

Ok, I know I am going out on a limb making a statement like that, so my question is for everyone to convince me I am wrong. Take this scenario:

I have method A, which ca

12条回答
  •  广开言路
    2021-02-03 22:24

    I think the major reasons are:

    1: unit-level tests give you more information about what's failing.

    2: you can't run integration tests until your components are integrated. The sooner you find a bug, the easier/cheaper it is to fix.

提交回复
热议问题