Hacker News new | past | comments | ask | show | jobs | submit login

Question I like to ask my colleagues. Suppose you have a program that passes all the tests. Suppose also that in that program there is a piece of code performs an operation incorrectly. The result of that operation is used in another part of the code that also performs an operation incorrectly, but in such a way that the tested outcome is correct.

Does the code have 0 defects, 1 defect, or 2 defects?






I can understand 0 and 2, but what's 1? The "I don't know how to count" answer?

The second part could instead be more like "detects an edge case and handles it, accidentally working around the first defect".

It could be counted as a single defect because both pieces of code must be corrected to keep the test happy.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: