TDD. When you can move on?

后端 未结 13 1899
南旧
南旧 2021-01-11 10:36

When doing TDD, how to tell \"that\'s enough tests for this class / feature\"?

I.e. when could you tell that you completed testing all edge cases?

13条回答
  •  情歌与酒
    2021-01-11 11:22

    Tests in TDD are about covering the specification, in fact they can be a substitute for a specification. In TDD, tests are not about covering the code. They ensure the code covers the specification, because the code will fail a test if it doesn't cover the specification. Any extra code you have doesn't matter.

    So you have enough tests when the tests look like they describe all the expectations that you or the stakeholders have.

提交回复
热议问题