Write it up
Read · 1 of 2
A good bug report
Finding a bug is half the job; describing it well is the other half. A good report has the input that fails, the expected output, what it actually printed, and, if you know it, why.
"It doesn't work" makes the next person (or AI) start from zero. "For )(, it crashes at stack.pop() because the stack is empty" gets fixed in a minute.
Read this lesson as text
A bug report anyone (or any AI) can act on.
A good bug report
Finding a bug is half the job; describing it well is the other half. A good report has the input that fails, the expected output, what it actually printed, and, if you know it, why.
"It doesn't work" makes the next person (or AI) start from zero. "For )(, it crashes at stack.pop() because the stack is empty" gets fixed in a minute.
Pick the best report
# The Two Sum answer from earlier
Which report would get the Two Sum bug fixed fastest?
- It's wrong sometimes, please fix.
- Input
2 10/5 1should print NO but prints YES: the set already holds the current number, so 5 pairs with itself. Only look at numbers seen before. - Use a better algorithm, this one has bugs with edge cases.
Show the answer
Input 2 10 / 5 1 should print NO but prints YES: the set already holds the current number, so 5 pairs with itself. Only look at numbers seen before.. It gives the exact input, expected and actual output, the cause, and a direction for the fix. The others make someone rediscover all of that.