Interview Questions

Trace Every Line of Code When Written

Why are there Bugs in Software?


(Continued from previous question...)

Trace Every Line of Code When Written

As each line of code is about to be executed, you should try to predict what the effect will be -- what data will be changed, which path a conditional will follow, etc. If you can't predict what the effect will be, then you don't understand the program you are working on -- a very dangerous situation. If you don't predict correctly, you have probably discovered a problem that should be addressed.

Tracing all new code shows: Code that hasn't been tested. By stepping through each line of code, you ensure that the new code is fully tested.

(Continued on next question...)

Other Interview Questions