- do not make mistakes in the first place
- the only way to achieve the above, is making your code so simple that it is very unlikely to contain a mistake
- check every intermediate result to make sure it does not have a mistake
Answer
Relevant part of lecture