Chapter 7: Introduction to Debugging TECH1010-02 Prof. Jeff Cheng.

Slides:



Advertisements
Similar presentations
3.02D HTML Overview 3.02 Develop webpages.
Advertisements

Unit 3 Day 4 FOCS – Web Design. No Journal Entry.
WeB application development
Website Design.
How Tags are used to form your Web Page
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley An Introduction to Debugging To Err is Human lawrence snyder c h a p t e.
Announcements Wednesday's test will be postponed until Thursday – July 7 th, See me if this won’t work for you. Project 1 will be due Monday – July.
Chapter 4 Marking Up With Html: A Hypertext Markup Language Primer.
The Information School of the University of Washington Oct 9fit debug1 Debugging and Troubleshooting INFO/CSE 100, Fall 2006 Fluency in Information.
JavaScript 101 Lesson 01: Writing Your First JavaScript.
SUNY Morrisville-Norwich Campus- Week 7 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
Chapter 7 To Err Is Human: An Introduction to Debugging.
Marking Up With Html: A Hypertext Markup Language Primer
Basic HTML The Magic Of Web Pages. Create an HTML folder  Make a folder in your H drive and name it “HTML”. We will save EVERYTHING for this unit here.
Chapter 7 To Err Is Human: An Introduction to Debugging.
Chapter 4 Fluency with Information Technology L. Snyder Marking Up With HTML: A Hypertext Markup Language Primer.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
DAT602 Database Application Development Lecture 14 HTML.
Learning Objectives Explain how ordinary precision differs from computing precision Describe the six-step strategy for debugging Explain the purpose of.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Introduction to Computers CS Dr. Zhizhang Shen Chapter 7: What Went.
ICAPRG301A Week 4Buggy Programming ICAPRG301A Apply introductory programming techniques Program Bugs US Navy Admiral Grace Hopper is often credited with.
Chapter 4: Hypertext Markup Language Primer TECH Prof. Jeff Cheng.
HTML INTRODUCTION, EDITORS, BASIC, ELEMENTS, ATTRIBUTES.
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Debugging & Troubleshooting “To err is human, but it takes a computer to really foul things up” © 2004 Lawrence Snyder.
Web Programming Basics of HTML. HTML stands for Hyper Text Mark-up Language A mark-up language is different than those that you have learned before in.
15.1 Fundamentals of HTML.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
Enhancing Your Web Site—Adding Links Web Page **YOU MUST HAVE COMPLETED THE 1ST 3 WEB PAGES BEFORE YOU CAN DO THIS ONE. **YOU SHOULD HAVE COMPLETED THE.
Unit 3 Day 6 FOCS – Web Design. Journal Unit #3 Entry #4 Write the source code that would make the following display on a rendered page: Shopping List.
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
HTML: Hyptertext Markup Language Doman’s Sections.
HTML Table and PHP Array
HTML Concepts and Techniques Fifth Edition Chapter 6 Using Frames in a Web Site.
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
Chapter 6 An Introduction to Debugging. Learning Objectives Explain how ordinary precision differs from computing precision Describe the six-step strategy.
15.1 Fundamentals of HTML DeKalb County School System.
Created by, Tom Rebold, MPC FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
BMTRY 789 Lecture 11: Debugging Readings – Chapter 10 (3 rd Ed) from “The Little SAS Book” Lab Problems – None Homework Due – None Final Project Presentations.
The Information School of the University of Washington 13-Oct-2004cse debug1 Debugging and Troubleshooting INFO/CSE 100, Spring 2005 Fluency in Information.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
15.1 Fundamentals of HTML 2 assignments: 1st—complete the worksheet. 2nd—create your first HTML web page following the directions in this PowerPoint where.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
HTML. HTML: What is it? – HTML stands for Hyper Text Markup Language – An HTML file is a text file containing small markup tags – The markup tags tell.
HTML Overview.  Students will learn: How HTML tagging works How browsers display tagged documents How an HTML document is structured.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
PHP Array and HTML Table IST 210 Organization of Data IST2101.
1 PROJECT 3 WEB/HTML PROJECT USING NOTEPAD Management Information Systems, 9 th edition, By Raymond McLeod, Jr. and George P. Schell © 2004, Prentice Hall,
Introduction to HTML Dave Edsall IAGenWeb County Coordinator’s Conference June 30, 2007.
Revised June 2008 Online PD Basic HTML1 Let’s Try It!  Open Notepad oStart > All Programs > Accessories > Notepad oDon’t get WordPad by mistake – won’t.
Online PD Basic HTML The Magic Of Web Pages
CSC 110 – Fluency in Information Technology Chapter 7: An Introduction to Debugging Dr. Curry Guinn.
Fluency with Information Technology
Intro to PHP & Variables
3.02D HTML Overview 3.02 Develop webpages.
To Err Is Human: An Introduction to Debugging
Debugging and Troubleshooting
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
The Troubleshooting theory
3.02D HTML Overview 3.02 Develop webpages.
4.02A HTML Overview 4.02 Develop web pages using various layouts and technologies. (Note to instructor: HTML tags are in red only to differentiate from.
Presentation transcript:

Chapter 7: Introduction to Debugging TECH Prof. Jeff Cheng

Need for Precise Communication in IT Computer-based information system only does what’s been told, no more, no less When communicating with a computer, data and commands need to be communicated very precisely, since not all variation of representing a command or data are being programmed into a computer Imprecision in communication is a potential source for error in an IT system

Imprecision in Communicating Information Different ways of representing a phone number: (973) or evne: (

7-4 Lexical Structures Field Inputs: Information entered into boxes/forms on screen – Governed by lexical structures (rules about the legal form for input fields) May limit symbols that can appear in specific positions, length of entry, etc. May also be loose, allowing any sequence of symbols of any length

7-5 Debugging: What's the Problem? A “Bug”: Anything that would cause a system to malfunction Debugging: The method of figuring out why a process or system doesn't work properly – Usually learned from experience Debugging in Everyday Life: People troubleshoot problems such as why their cars don't start – Usually involve working system with broken or worn-out part Debugging in Information Technology: – Working system might have wrong data or wrong configuration information or – There might be a logical design error – We will always begin by assuming a correct, working system

7-6 Whose Problem Is It? When we debug an information system, we are always part of the problem – We give the commands and the input Operator or pilot error – Only other possible cause is broken system People don't knowingly make errors – We may think we did everything right because we misunderstand the system

7-7 Using the Computer to Debug A computer can't debug itself We can't debug it directly, either Error is internal to the computer – To get information about the error, we have to ask the computer what data it stored, what command it had executed etc. With faulty software we cannot fix, try to bypass error with alternative approach (workaround)

7-8 A Dialog About Debugging Debugging is solving a mystery – Whatdunit vs. whodunit Ask purposeful questions like: – Do I need more clues? – Are my clues reliable? – What is a theory to explain the problem? Better than aimlessly "trying stuff"

Debugging Case Study: Printing Address Label Using a word processor to open an address label file to print label. The paper came out of the printer with no label printed. What’s wrong?

7-10 Debugging (cont'd) Steps to follow: 1.Check that the error is reproducible 2.Make sure you know what the problem is If no mailing labels come out of printer, problem may be with printer or with program sending labels to printer or file containing addresses 3.Check all the "obvious" sources of error first 4.Isolate the problem Divide operation into those parts that are working and those that are not working Think objectively—ask yourself if you've made a wrong assumption, etc.

7-11

7-12 Butterflies And Bugs: A Case Study Imagine we've developed a simple HTML page Following is our goal page:

7-13 Our Goal Page:

7-14

7-15 The Actual Display in IE:

7-16

7-17 Debugging Recap Make sure you can reproduce the error Determine exactly what the problem is Eliminate "obvious" causes Divide the process, separating out the parts that work from the part that doesn't (isolate the problem) When you reach a dead end, reassess your information; then step through the process again As you work through, make predictions about what should happen and verify that they are fulfilled

7-18 Butterflies and Bugs (cont'd) We can study the HTML very closely and figure out where the error is We will use the debugging strategy

7-19 Butterflies and Bugs (cont'd) First, be sure we can re-create the error – Reload the page – In this case, the results are the same Displaying the page in Safari and Mozilla also produces errors Next, determine the problem exactly – Look at the displayed page and determine where the errors occur – Since there are multiple errors on different parts of the page, assume they are caused by different mistakes in the HTML Try to fix first/top error on page first; save and refresh browser

7-20 The HTML for Our Page

7-21 Butterflies and Bugs (cont'd) Next, eliminate the obvious – In HTML, most common error is forgetting to close a tag For example: with no closing tage – Make sure all quotes match (open and close) In this case, the word Blues appears in red on the page. Why? Blues Missing opening quotation mark around the attribute value "blue" – Why is the "More here" link not highlighted? Space missing between <a and href

7-22

7-23 Butterflies and Bugs (cont'd) Divide up the process – Separate the parts of the system that work from the parts that do not First row of the table Browsers and debugging systems for HTML can give us a color- coded version of the HTML, showing how it's being interpreted (for example, Notepad++) – View (page) source We see the entire heading line is colored blue as if it's an attribute The problem turns out to be a fancy quote that the browser cannot interpret

7-24

7-25 Butterflies and Bugs (cont'd) Reassess – The pictures are still not displaying – We find that the image tags are well structured and the browser is interpreting them correctly – What is the problem? To check that the images are ok, display in another document To check that the JPEG specification is ok, put another image file in the document Check the exact file name for the image, including capitalization – In this case, we find the filename extension is.jpeg, not.jpg as we have been using

7-26 Butterflies and Bugs (cont'd) Unnecessary changes: – During the debugging process, we made some unnecessary changes due to wrong conjectures about the error – Making unnecessary changes is typical in debugging Sometimes we even make the situation worse by introducing new errors

7-27 Butterflies and Bugs (cont'd) Hiding other errors: – At first we thought we had three errors—bad caption, missing link, busted table – Because there were two things wrong with the table (messed up heading line and wrong file names specified) there were actually four errors – Because it is common for one error to hide another, always suspect there is more than one error

7-28 Butterflies and Bugs (cont'd) Viewing the source: – Most effective technique in our debugging was the View Source feature – In general, one of the most powerful debugging techniques is to find ways for the computer to tell us the meaning of the information it stores or the commands it executes Little errors, big problems: – The errors in the HTML code were tiny, but they had serious effects – We must be extremely precise