The Value of Unit Testing

前端 未结 12 1866
猫巷女王i
猫巷女王i 2021-01-11 16:48

Here are some typical answers(ranked in ascending order of corniness) I get from managers/bosses whenever I bring up the importance of having unit tests and code coverage as

12条回答
  •  北恋
    北恋 (楼主)
    2021-01-11 17:17

    Introducing unit tests into development process is like investment: you have to put some money up front to get profit later. Management should be more attentive to this analogy if you follow through with it: describe what investments are required and then lay down plan for profits.

    For example: Investments:

    • time spend to implement test infrastructure (no serious product unit tests can be possible without test-specific infrastructure code that streamlines product specific test patterns, test data creation/removal, etc.);
    • time spend on writing actual tests;
    • time spend on reviewing and supporting tests;
    • etc.

    Profits:

    • no bug ever re-appears without a sign;
    • no major features are released without unit tests passing;
    • cycle development-qa-fix bugs is cut in half for majority of bugs: development-unit test-fix bugs;
    • etc.

提交回复
热议问题