Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Information School of the University of Washington Oct 9fit100-06-debug1 Debugging and Troubleshooting INFO/CSE 100, Fall 2006 Fluency in Information.

Similar presentations


Presentation on theme: "The Information School of the University of Washington Oct 9fit100-06-debug1 Debugging and Troubleshooting INFO/CSE 100, Fall 2006 Fluency in Information."— Presentation transcript:

1 The Information School of the University of Washington Oct 9fit100-06-debug1 Debugging and Troubleshooting INFO/CSE 100, Fall 2006 Fluency in Information Technology http://courses.washington.edu/info100/

2 The Information School of the University of Washington Oct 9fit100-06-debug2 Readings and References Reading »Fluency with Information Technology Chapter 7, To Err is Human “To err is human, but it takes a computer to really foul things up” References »World Wide Web Consortium http://www.w3schools.com/html/html_reference.asp http://validator.w3.org »Jedit (java-based editor) http://www.jedit.org

3 The Information School of the University of Washington Oct 9fit100-06-debug3 Anchors The link starts with an a tag… The value of the href attribute is a URL. The link encloses some text, and ends with… CSE home page

4 The Information School of the University of Washington Oct 9fit100-06-debug4 Types of URLS http://www.site.com/dir/file.html http://www.site.com/dir/ ftp://ftp.site.come/pub/ news:soc.culture.religion mailto:samspade@u.washington.edu file:///hardisk/path/file.html

5 The Information School of the University of Washington Oct 9fit100-06-debug5 HTML Tables Animal Fav food monkeys bananas AnimalFav food monkeysbananas ___________________

6 The Information School of the University of Washington Oct 9fit100-06-debug6 Simple HTML What we’ve seen here is very simple HTML HTML is changing »Each document should start with a “ DOCTYPE ” comment telling which version of HTML it follows http://www.w3.org/QA/2002/04/valid-dtd-list.html We used HTML 4.01 Transitional »There is a validator service that will check your page http://validator.w3.org/ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

7 The Information School of the University of Washington Oct 9fit100-06-debug7 Editing by Hand vs. a Tool WYSIWYG type tools (what you see is what you get) »Microsoft FrontPage - $$$ »Macromedia DreamWeaver - $$$ »Amaya - Free http://www.w3.org/Amaya/ »And MANY MANY others! Text Editors »Jedit - Free http://www.jedit.org/ Pick the right tool for you!

8 The Information School of the University of Washington Oct 9fit100-06-debug8 Character Entities Some characters are special in HTML », &, ", ' They are interpreted by the web browser To get them to display properly we have to encode them specially »< = < »> = > »& = & »" = " »&apos; = ' » = non-breaking space

9 The Information School of the University of Washington Oct 9fit100-06-debug9 Using Computers... In IT, stuff goes wrong … debugging is the process of finding the error »Term coined by Grace Murray Hopper Best solution … make no mistakes! »Be accurate … get it right the 1 st time »Follow a process that makes it easier to get it right »Computers can’t make "common sense" decisions about what we really meant. They do what we say, not what we mean.

10 The Information School of the University of Washington Oct 9fit100-06-debug10 Cost of Debugging Debugging may consume 60-70% of your development time 80% of overruns may be due to debugging »Keep this in mind when you are budgeting time for your projects!

11 The Information School of the University of Washington Oct 9fit100-06-debug11 Common Bug Types Compilation/Syntax errors »Program won’t run due to problems with what you typed in HTML tags must be entered precisely Required attributes must be present Logic errors »Program runs, but output/behavior is wrong

12 The Information School of the University of Washington Oct 9fit100-06-debug12 When You Debug... There are guidelines for debugging… Rather than trying things aimlessly and becoming frustrated, think of yourself as solving a mystery Be objective: What are my clues? What is my hypothesis? Do I need more data? Consciously ‘watch’ yourself debug -- its an out-of-body experience When stumped, don’t become frustrated, but ask, “What am I misunderstanding?” Become Sherlock Holmes Debugging is not algorithmic: no guaranteed process

13 The Information School of the University of Washington Oct 9fit100-06-debug13 Debugging Guidelines Overview »Verify that the error is reproducible »Determine exactly what the actual failure is »Eliminate the “obvious” causes by checking »Divide process into working/faulty parts »On reaching a dead end, reassess the information you have, trying to identify the mistake you are making »Work through process making predictions and checking they’re fulfilled

14 The Information School of the University of Washington Oct 9fit100-06-debug14 First step: verify the error is reproducible »You can't find something that you can't reproduce »Get out and get back in. Does it still happen? Restart the application. Try a different application Reboot the operating system. Sometimes this is appropriate, especially for errors involving peripheral devices (printers, modems) Getting Out and Getting Back In Reproducibility

15 The Information School of the University of Washington Oct 9fit100-06-debug15 Determine the Problem Second step: figure out what’s wrong »Often there is a sequence of steps following an error and propagating it … work backwards looking to see where the error first occurred Empty Database Mailing Label Pgm Mailing Label File No Labels Printing This is not a printer problem!

16 The Information School of the University of Washington Oct 9fit100-06-debug16 Eliminate the Obvious Third step: eliminate obvious causes “If the cause were obvious, the problem would have been fixed!” - Yeah, right. »There are standard things to check: Inputs Connections “Permissions” Physical connectivity Requirements My fan is broken, it won't turn on!

17 The Information School of the University of Washington Oct 9fit100-06-debug17 Isolate the Problem Try to “partition” the situation into working and non-working parts Form a hypothesis of what’s wrong Make as few assumptions as possible Take nothing for granted The goal is to eliminate as many things from consideration as possible

18 The Information School of the University of Washington Oct 9fit100-06-debug18 At a Dead End, Reassess When everything seems to check out, don’t get frustrated Instead, ask yourself “What am I overlooking or misunderstanding?” »Your goal is to see the situation as it is, not as you think it should be Am I assuming too much? Am I misreading the clues? What can I eliminate or simplify? Explain the situation to a friend

19 The Information School of the University of Washington Oct 9fit100-06-debug19 Make Predication/Check Beginning with the isolated part, step through the process, predicting the outcome and verifying it »A prediction that is not fulfilled shows… A possible bug A possible misunderstanding A chance to narrow the search ‘Sleeping on it’ often helps!

20 The Information School of the University of Washington Oct 9fit100-06-debug20 Questions Why learn HTML at all if authoring tools will do the work for you? Give other examples of where you are expected to learn something when there are tools available that will do the work.

21 The Information School of the University of Washington Oct 9fit100-06-debug21 Questions Why do we need to end a tag? Why were the characters chosen to denote tags?

22 The Information School of the University of Washington Oct 9fit100-06-debug22 Questions How does a web browser know where to get an image from to display on a web page?

23 The Information School of the University of Washington Oct 9fit100-06-debug23 Questions You walk into a room and flip the light switch. Nothing happens. Describe the debugging process you use to solve the problem.

24 The Information School of the University of Washington Oct 9fit100-06-debug24 Questions What advantages does an organized debugging approach have over a trial and error approach?

25 The Information School of the University of Washington Oct 9fit100-06-debug25 Project 1 Make a website of “misinformation” »Project 1a Planning, image collection, basic web site creation »Project 1b Website design, image manipulation Project 1a due Friday, October 13, before 10:00 pm. »Use online turn in page to submit your files »We will not accept late projects - turn in what you have even if you are not done (some points are better than no points) http://courses.washington.edu/info100/classwork/a ssignments/files/project1.htmlhttp://courses.washington.edu/info100/classwork/a ssignments/files/project1.html

26 The Information School of the University of Washington Oct 9fit100-06-debug26 Summary Debugging is not algorithmic, but there are guidelines to follow »Stay calm - high blood pressure clouds your brain »Be organized as you investigate and fix things »Recognize that you may feel a little embarrassed when you finally figure out the problem. If we were perfect, we would never make mistakes... A little humility is a good thing for all of us »Watch yourself debug -- assess how you are doing, what you need to know »Only try to fix one bug at a time!


Download ppt "The Information School of the University of Washington Oct 9fit100-06-debug1 Debugging and Troubleshooting INFO/CSE 100, Fall 2006 Fluency in Information."

Similar presentations


Ads by Google