Once testing has discovered problems, the next step is to fix them. Many newbies do this by making more or less random changes to their code until it seems to produce the right answer, but this is very inefficient (and the result is usually correct just for the case they are testing).The more experienced a programmer, the more systematically he debugs and most follow some variations on the rules explained below.
Objectives
- Debug code that systematically contains an error.
- Identify ways to make code less error-prone and more easily tested.
Table of Contents:
- Know What You're Supposed to Do
- Make Everything Fail and Make It Fail Fast
- Change one thing at a time, for a reason
- Keep track of what you've done
- Be humble
Post a Comment
0Comments