5 ms·
Someone who is genuinely good at writing code should be able to produce code that has no or very few bugs. Similarly, they should be pretty good at inferring w
by NumberSix 10y ago
Someone who is genuinely good at writing code should be able to produce code that has no or very few bugs. Similarly, they should be pretty good at inferring what is wrong in the rare case of bugs by simply running the program. Therefore, they would find writing unit tests and similar rituals unnecessary and time consuming.
They would most probably write specialized tests where appropriate to catch subtle bugs that elude even their superior skills. This would be a matter of personal judgment based on the problem at hand.
- draw_down 10y agoInteresting hypothesis!
- RandomOpinion 10y agoDonald Knuth did say once that he's not much of a fan of unit tests. See his answer to the second question of his interview at: http://www.informit.com/articles/article.aspx?p=1193856 http://www.informit.com/articles/article.aspx?p=1193856 Then again, there are probably less than a dozen people at his level of ability on the entire planet so unit tests will be part of our lives for the foreseeable future.
- kwhitefoot 10y agoSurely no one is a fan of unit tests. I'm not even though I am responsible for a few hundred in the program that I work on. They are valuable for several reasons, including: writing them often exposes an unconscionable degree of coupling between the various components of the code and they often trap incautious changes when someone fixes a supposedly unrelated bug. I would need fewer of them if I could use a functional language language with a good type system like F# instead of VB and C#.
- BurningFrog 10y agoThis works decently for code that is written once and never needs to change. It does not work for code that repeatedly gets changed by different people during a project. This is 99% of all meaningful code.
- eveningcoffee 10y agoTests also describe how a particular code is expected to behave.