What should a “unit” be when unit testing?

前端 未结 10 961
梦毁少年i
梦毁少年i 2020-12-28 15:16

On Proggit today I was reading the comment thread on a submission entitled, \"Why Unit Testing Is A Waste of Time\".

I\'m not really concerned with premise of the ar

10条回答
  •  生来不讨喜
    2020-12-28 15:58

    To me, a "unit" is any significant behavior of a class that, in 8-12 months down the road, I'm not going to remember.

    And with well-written unit tests (think BDD), I won't have to, because my test will describe to me and verify the code in plain English.

提交回复
热议问题