Udacity CS259 摘要分享
強調系統性的方式
強調自動化工具
How Debuggers work
Asserting Expectations
Simplifying Failures
Tracking Origins
Reproducing Failures
Learning from Mistakes
How Debuggers work
Asserting Expectations
Simplifying Failures(Delta Debugging)
Tracking Origins (PEX)
Reproducing Failures
Learning from Mistakes
Input Expected Output
--------------------------------------
"foo" "foo" "foo"
I've tried:
1. Set foo to "bar" (don't work)
2. ....
reliably repeatable under well defined conditions.
disappears or alters behaviour as you explore it.
Usually comes from debugging tools
appears chaotic or non-deterministic.
does not manifest until someone realises the program should never have worked in the first place.
Never been seen in practice!
Track problem (bug database)
Reproduce problem
Automate and simplify (test asserts, ddmin)
Find possible infection origins
Focus on most likely origin (stastical debugging)
Isolate infection chain - develop hypotheses
Correct defect, then verify fix.
Get initial requirements right.
Use automation to find bugs. Develop and automate testing.
Reduce program complexity.
Set up assertions.
Test early, test often.
Review your code
analyse problem history.