Syntax And Semantics, Debugging Flashcards
Syntax error
When you write statement that is not valid according to the grammar of the c++ language(semicolon, undeclared variables)
Semantic error
Statement is syntactically valid, but doesn’t do what the programmer intended to
Debugging steps
- find the root cause of the problem
- ensure you understand why the issue is occurring
- determine how you’ll fix the issue
- repair the issue causing the problem
- retest to ensure the problem has been fixed
Finding issues by code inspection
Only on simple programs, if you know the specific function where to look
Finding issues by running the program
Figuring out how to reproduce the problem
Reproducing the problem
A list of clear and precise steps that can be followed to cause an issue to reoccur with a high level of predictability
Honing on issue
Making educated guesses on the basis of noticing where in the program the issue initialy appeared
Static analysis tools
Tools that analizethe code and look for semantic issues that may indicate problems with the code