TDD. When you can move on?

后端 未结 13 1922
南旧
南旧 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:23

    Just try to come up with every way within reason that you could cause something to fail. Null values, values out of range, etc. Once you can't easily come up with anything, just continue on to something else.

    If down the road you ever find a new bug or come up with a way, add the test.

    It is not about code coverage. That is a dangerous metric, because code is "covered" long before it is "tested well".

提交回复
热议问题