How do you tell that your unit tests are correct?

后端 未结 16 1295
广开言路
广开言路 2020-12-28 16:23

I\'ve only done minor unit testing at various points in my career. Whenever I start diving into it again, it always troubles me how to prove that my tests are correct. How

16条回答
  •  执念已碎
    2020-12-28 16:54

    Well, Dijkstra famously said:

    "Testing shows the presence, not the absence of bugs"

    IOW, how would you write a unit test for the function add(int, int)?

    IOW, it's a tough one.

提交回复
热议问题