logoalt Hacker News

suddenlybananas • today at 6:58 PM • 2 replies • view on HN

Couldn't a faulty test be very risky by baking in incorrect behaviour?


Replies

bob1029 • today at 8:13 PM

I look at each unit test as a sample. Some of these might be bad. In aggregate, I think they provide stronger assurances. A sample (or the sampler itself) being bad doesn't necessarily affect the thing that is being measured.

The incorrect behavior would have to be baked into the actual application at some level. I review this code much more thoroughly than the test code.

singpolyma3 • today at 8:50 PM

Only if the behaviour is wrong. If the test was written against a working system then it either does nothing or is no worse than a snapshot test