Return to Video

06-27 Fault Localization Solution

  • 0:00 - 0:04
    Starting from the bottom, if I remove the last line,
  • 0:04 - 0:07
    we never actually call mistletoe, so our program just declares a variable,
  • 0:07 - 0:10
    declares a function, and then exits,
  • 0:10 - 0:12
    so we don't see the exception.
  • 0:12 - 0:14
    So we can't remove this line.
  • 0:14 - 0:16
    Let's take a look up here.
  • 0:16 - 0:19
    What if I comment out baldr is baldr + 1?
  • 0:19 - 0:23
    Well, with our bug in environment lookup, this line a gets a + 2
  • 0:23 - 0:26
    will still cause us to die.
  • 0:26 - 0:29
    So we can remove baldr is baldr + 1 and still see the exception.
  • 0:29 - 0:31
    How about this one?
  • 0:31 - 0:34
    If I remove a is a + 2, we'll still see the exception down here
  • 0:34 - 0:36
    in baldr is baldr + a.
  • 0:36 - 0:40
    We'll look up the value of a and not find it. So I can remove that line.
  • 0:40 - 0:45
    Similarly, if I remove this third line, we can still die on line 2.
  • 0:45 - 0:48
    So now, potentially, we have a lot of information available to us.
  • 0:48 - 0:50
    We know that we need to make this call,
  • 0:50 - 0:53
    we know that these 3 lines are important,
  • 0:53 - 0:57
    and in a more fully formed integrated development environment
  • 0:57 - 1:01
    or interpreter like the Python interpreter, we'd get an exception backtrace
  • 1:01 - 1:04
    that would point us to this line
  • 1:04 - 1:08
    or, if we've commented out that line, point us to the next one.
  • 1:08 -
    So with all of this information, we get a better feel for what's actually required.
Title:
06-27 Fault Localization Solution
Description:

Other units in this course below:
Unit 1:http://www.youtube.com/playlist?list=PL3FEF9299137945CC
Unit 2:http://www.youtube.com/playlist?list=PLBF6FC32358457242
Unit 3:http://www.youtube.com/playlist?list=PL30EF9EB86B4D2E54
Unit 4:http://www.youtube.com/playlist?list=PL6881C8D2E9D63242
Unit 5:http://www.youtube.com/playlist?list=PL62AF1F6D3B654E14
Unit 6:http://www.youtube.com/playlist?list=PL8FCC9D9C45A6640E
Unit 7:http://www.youtube.com/playlist?list=PL9533BCB71FD88E38

Q&A: http://www.youtube.com/playlist?list=PLE0EB375FA373A866

To gain access to interactive quizzes, homework, programming assignments and a helpful community, join the class at http://www.udacity.com

more » « less
Video Language:
English
Team:
Udacity
Project:
CS262 - Programming Languages
Duration:
01:14
Amara Bot added a translation

English subtitles

Revisions