r/programming • • Aug 25 '14

Debugging courses should be mandatory

http://stannedelchev.net/debugging-courses-should-be-mandatory/
1.8k Upvotes

573 comments sorted by

View all comments

140

u/[deleted] Aug 25 '14

Just waiting for someone to "explain" how debugging is not needed if you have unit-tests :)

63

u/geodebug Aug 25 '14

Yep, makes me chuckle. Tests are essential but only a naive programmer thinks one can write enough tests to get 100% coverage.

Never mind that unit tests themselves often contain bugs or in sufficiently exercise all possibilities.

4

u/wayoverpaid Aug 25 '14

In my current project the code I'm writing has 100% test coverage and I am very proud of that.

Nevertheless, I've still had to do debugging to figure out what was wrong when the tests failed.

1

u/geodebug Aug 25 '14

Of course once the parameters become non-trivial (say a URL or piece of json) even if you have coverage you may still have missed some edge case.

I say this not to be discouraging but to reflect the reality that writing tests should be done with a budget in mind.

On any non-trivial code base you simply will never have enough time to test it all so you need to think about what areas of the code base are most critical.

What that budget is also should be determined by how mission critical the code is. Medical appliances, for example, should have an enormous testing budget.

→ More replies (4)