Return to Video

Optional Improvements - Software Debugging

  • 0:00 - 0:04
    For your homework, I want these ranges of variables, as seen.
  • 0:04 - 0:07
    But if you want true challenges, here are some more.
  • 0:07 - 0:10
    For instance, you can go and also record the types of variables,
  • 0:10 - 0:14
    say, the type of x is the same as the type of 2.
  • 0:14 - 0:17
    Or you could go and check for set patterns.
  • 0:17 - 0:19
    For instance, you could report that the variable x
  • 0:19 - 0:23
    is in the list of values 2, 4, and 16.
  • 0:23 - 0:25
    The relationships between variables--
  • 0:25 - 0:31
    In the square root function, the y variable always has the same value as the return value.
  • 0:31 - 0:36
    That's not very surprising, because we actually return y, but that's an interesting property.
  • 0:36 - 0:39
    Likewise, the return value of a square root function
  • 0:39 - 0:44
    is always less or equal to the value that we want to compute the square root for.
  • 0:44 - 0:48
    You can obtain such relationships between variables
  • 0:48 - 0:51
    by coming up with a pattern, say like equal or less than,
  • 0:51 - 0:56
    and instantiating that pattern with all variables,
  • 0:56 - 1:02
    and then seeing which patterns actually hold over multiple runs.
  • 1:02 - 1:07
    With that, enjoy building your own dynamic invariant checker,
  • 1:07 - 1:09
    and make it easier for future generations to write assertions. Thank you.
Title:
Optional Improvements - Software Debugging
Video Language:
English
Team:
Udacity
Project:
CS259 - Software Debugging
Duration:
01:13
Udacity Robot edited English subtitles for Optional Improvements - Software Debugging
Fran Ontanaya edited English subtitles for Optional Improvements - Software Debugging
Amara Bot added a translation

English subtitles

Revisions Compare revisions