Skip to content

fuellee/udacity_debugging

Repository files navigation

Udacity CS259 Software Debugging

code for udacity course CS259 Software Debugging

Unit 4

4_remove_html_markup.py :Fixed the quote bug and handles single_quote and double_quote properly

4_remove_html_markup_tricky.py

  • 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 varable quote.

4_save_the_state.py

Stop and save the current state (frame.f_locals) to a global var('the_state') if some condition is satistied.

4_change_the_state.py

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.

4_make_it_work.py : find the cause chain automatically

  • Need a pass case and a fail case.
  • Use get_state to get their state in given line/iteration. Compute the diff::[(varName,fail_val)]. The cause of failure must be a subset of diff.
  • 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_val pairs in order of line/iteration. That is the cause chain.

Unit 5

5_solve_the_mystery_orgin.py

Calculates phi coefficients for each code line. Then display the result as a table.

5_solve_the_mystery.py

Calculates phi coefficients for each function and return vaule category. Then display the result as a table.

Final

Final_1_add_delete_command.py

Add delete command to my_spyder.py, can delete breakpoints and watchpoints now.

Final_2_trace_watchpoint.py

Revise watchpoint feature of my_spyder

Final_3_find_the_source.py :find the cause chain automatically

  • A fully automated program that can display the cause-effect chain automatically.
  • Enhenced version of 4_make_it_work.py 4_make_it_work.py need 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 ?)

Final_4_more_statistics.py

About

code for udacity course software debugging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages