English subtitles

← Optional Improvements - Software Debugging

Get Embed Code
4 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. For your homework, I want these ranges of variables, as seen.
  2. But if you want true challenges, here are some more.
  3. For instance, you can go and also record the types of variables,
  4. say, the type of x is the same as the type of 2.
  5. Or you could go and check for set patterns.
  6. For instance, you could report that the variable x
  7. is in the list of values 2, 4, and 16.
  8. The relationships between variables--
  9. In the square root function, the y variable always has the same value as the return value.
  10. That's not very surprising, because we actually return y, but that's an interesting property.
  11. Likewise, the return value of a square root function
  12. is always less or equal to the value that we want to compute the square root for.
  13. You can obtain such relationships between variables
  14. by coming up with a pattern, say like equal or less than,
  15. and instantiating that pattern with all variables,
  16. and then seeing which patterns actually hold over multiple runs.
  17. With that, enjoy building your own dynamic invariant checker,
  18. and make it easier for future generations to write assertions. Thank you.