Debugging Flashcards
describe the difference between run and debug configurations
a run configuration will ignore any breakpoints etc.
debug will stop and open a debugging window
what is debugging
the process of finding and fixing errors
describe the steps of debugging
start with a problem, run the code, get to understand the expected behaviour
stabilise the problem
isolate the source
fix
test
look for similar errors
describe how we would stabilise a problem
narrow it down to a precise statement
what types of errors are there
compile time
run time
semantic
describe the scientific method of debugging
develop general theories
make observations
think of interesting questions
create a hypothesis
develop testable prediction
get data
refine
give some strategies to isolate the source of a problem (5)
brute force- walk through code
back track- start at problem and go backwards
architectural- suss out the location of the error
binary search- find the middle of the execution and work out if it was before or after that point
cause elimination- identify possibilities and rule out
give some tactics for isolating the source of a problem (8)
print statements
rubber ducking
minimise execution path
common problem knowledge
online debugger
test cases
look at commits
profiling (memory management in c)