FIT2024 Lecture Notes - Lecture 10: Backtracking, Software Quality Management, Regression Testing
![](https://new-preview-html.oneclass.com/rKZ3w4gpqWELjZVEX5bkj8nX2G5YyBMv/bg1.png)
Week 10 - Debugging
● Important aspect of software quality management
● Poor program design can require changes to be made to many modules when a bug is
found
● Requires experience to hypothesize error location from failed test results
● Programmers should
○ Inspect Code
○ Use an interactive debugging tool to trace execution
● Tips
○ Think about and mentally analyze the problem
○ Describe the problem to a colleague
○ Take a walk or sleep on the problem
○ Use the computer as a last resort
Debugging Process Stages
● Locate error/defect
● Design error repair
● Repair error
● Re-test program
● Reflect on the causes of the bug
Symptoms
Causes
● May disappear when another problem
is fixed
● May be intermittent
● May be due to a combination of
non-errors
● May be due to a system or compiler
error
● May be due to assumptions that
everyone believes
Techniques
● Brute force/ testing
● Backtracking
● Induction
● Deduction
Problem Solving
● Cause elimination
Document Summary
Poor program design can require changes to be made to many modules when a bug is found. Requires experience to hypothesize error location from failed test results. Use an interactive debugging tool to trace execution. Think about and mentally analyze the problem. Take a walk or sleep on the problem. Use the computer as a last resort. Reflect on the causes of the bug. May be due to a combination of. May be due to a system or compiler non-errors error. May be due to assumptions that everyone believes. May disappear when another problem is fixed. Defects/bugs/errors are found and resolved by the following step-by-step problem solving approach: problem definition. Define the problems & build a problem definition matrix. What it is and what it is not. What is the scope of the problem: hypothesis development. Start with the debugging problem and the problem definition matrix. Variables written twice with no intervening assignments.