Ch. 7: Debugging
Chapter Outlines
Ch. 11: Multimedia Encoding
Ch. 10: Algorithms
Diagnosis: Find the cause from the symptoms
Debugging: Diagnosis of a engineered system, usually a computer.
Use of “bug” for malfunction predates the computer.
Edison used it
, and has
earlier origins
.
Moth found in the Mark II.
Relevant properties of a computer.
Precision, e.g., letter O and digit 0.
Literal operation.
A computer cannot know what you meant.
No “common sense”.
Consistent: Do the same thing every time.
Usually. Exceptions mean the behavior depends one something you don't know about.
Looks like a random failure.
Sources of trouble.
Bad input data.
Bad instruction: An error in the program.
Debugging steps.
Reproduce the error: Try to be sure what causes the behavior.
Be precise about what is wrong.
Eliminate obvious errors: “Is is plugged in?”
Divide into parts, and test separately.
Predict the results of your tests, and see if actual behavior agrees.
If you reach a dead end, start over. Try more and better.
Testing a Program.
Test plan.
Consider each required behavior.
Plan actions to demonstrate that behavior under all relevant circumstances.
Note the expected correct response.
Black box testing: Choose tests based on specification.
White box testing: Choose tests based on program code.
Ch. 11: Multimedia Encoding
Ch. 10: Algorithms