Errors and Corrections Flashcards
What is debugging?
The process of spotting and correcting mistakes
What is a logic error?
When code doesn’t make sense (e.g. My pencil just rode a bike to London)
Why can logic errors only be spotted by the programmer?
The computer will just do exactly as it has been told
What is a syntax error caused by?
Caused by using incorrect grammar for that particular language
What are 7 common examples of syntax errors?
Missing end of line marker Missing bracket Missing end of string marker No return statement in a procedure Incompatible data type Using = when == should have been used Not closing WHILE and FOR loops properly
What are 5 debugging methods?
Comments Debugging outputs Break points Single-stepping Test code
What is a run time error?
Run time errors only show up as the program is actually running
What are 3 common examples of run time errors?
Overflow error
Stack Overflow error
Calling an absent library procedure
When is an overflow error caused?
When a value is too big to be stored in the memory the program has assigned to hold it
When is a stack overflow error caused?
If a program tries calling too many functions at once, the stack (a temporary store) will get too full and the program won’t know where to return to