code for udacity course CS259 Software Debugging
- The solution provide by the udacity course, hmm, tricky.
- Assert(quote in ["'",'"',False]).
'and"implicitly means true, thus the quote('or") sign can be stored in varablequote.
Stop and save the current state (frame.f_locals) to a global var('the_state') if some condition is satistied.
Stop and change the current state (frame.f_locals) according to a global var('the_diff') if some condition is satistied.
Changing frame.f_locals is some kind of tricky, use update.
- Need a pass case and a fail case.
- Use
get_stateto get their state in given line/iteration. Compute thediff::[(varName,fail_val)]. The cause of failure must be a subset ofdiff. - Use
ddmin(delta debug minimize) to find the minimum set of vars,vals pair make the test fail, for each given line/iteration. - Print the
var,fail_valpairs in order of line/iteration. That is the cause chain.
Calculates phi coefficients for each code line. Then display the result as a table.
Calculates phi coefficients for each function and return vaule category. Then display the result as a table.
Add delete command to my_spyder.py, can delete breakpoints and watchpoints now.
Revise watchpoint feature of my_spyder
- A fully automated program that can display the cause-effect chain automatically.
- Enhenced version of
4_make_it_work.py4_make_it_work.pyneed provided line/iterations, which makes it not very useful; This program record covered line in order of their execution, and use them as line/iterations. (Saidly, strange error occurs after submition, though give the right result ... ; The grader of a debugger has a bug ?)