Download presentation
Presentation is loading. Please wait.
Published byWinfred Lawson Modified over 6 years ago
1
CSC 110 – Fluency in Information Technology Chapter 7: An Introduction to Debugging
Dr. Curry Guinn
2
Today’s Class Debugging Laboratory Activities
Warning: Some material in this lecture is not in the book! Laboratory Activities
3
Debugging Debugging == troubleshooting
What kinds of errors do we humans make when working with computers? Syntax errors We violate lexical structure Case sensitivity is a common gotcha Wrong data Wrong command
4
Harvard Mark II
5
Errors that aren’t the user’s fault
Hardware errors (The First Bug) Burnt chips Software errors Careless programming Logical design errors
6
How Systems Ought To Be Developed
Software life-cycle Over 50 years of creating software has taught us a few things Can apply to any project, manufacturing, creation of a product or service
7
The Software Life-Cycle
Lessons learned over the past 5 decades of programming Software engineering is the application of a systematic and disciplined approach to the development, testing, and maintenance of a program. 5 stages: Analysis Design Coding Testing Operation
8
1. Analysis What do the clients want?
What will the users of the product experience? Feasibility study Is it possible given Time Money Knowledge Requirements specification Specific breakdown of features
9
2. Design Take requirements specification and turn it into a program/product design What materials do you need? What processes will be necessary to produce the product? Design the system abstractly Architecture: Blueprints Car design: Computer-aided design drawings
10
3. Coding/Creating/Constructing
Implementation Writing the code or Erecting the building If the design is good, this is really easy.
11
4. Testing Verifying the code meets the specs Unit testing
Does the product satisfy the requirements document? Unit testing Test components of product individually Integration testing Combine working components and make sure they function together Case in point: Mars orbiter
12
5. Operation (Maintenance)
Software maintenance Shown to be The most time-consuming Expensive 70% of cost
13
The Major Steps during Debugging
Reproducing the error Must be able to determine the sequence of steps that lead to the error Determine exactly what the faulty behavior is Eliminate the “obvious” causes Divide the process to determine within which part the error is occurring When you reach a dead end, reassess the assumptions you made along the way As you work, make predictions about what should happen and verify that your predictions are fulfilled
14
An Example The intended web page:
15
What does it look like now?
Butterflies Look at the source Butterfly.zip
16
Debugging Steps Reproduce the Error Reload the page… still there
If we had another browser (like Netscape or Mozilla) we might try that browser and see if it looks the same If it does, we know it’s something in the .htm code
17
What exactly is wrong At least 2 obvious problems Should be four rows
Where are the pictures?
18
Identifying Obvious Problems
Maybe a tag is misspelled Maybe a <tag> is missing its </tag> Maybe a tag is just missing For the images, Check relative link structure
19
Divide and Conquer The problem must be in the <img> tag
Let’s open up something that color codes Getting the quotations right Correcting misspellings Table headings
20
… And now for the Lab Activity 1: Download and unzip the following webpage/image combo: Load the web page labexample1.htm in your browser. It should look like the next slide.
22
Activity 1: Debugging an HTML page
Try and track down the various problems in the html source
23
Activity 2: Testing that Behaviors Match Specifications
Download the following tic tac toe game: Also download the following .doc file
24
Activity 2 continued The specs.doc file list the behaviors expected by the tic tac toe program. Conduct tests to determine whether the program acts accordingly If so, mark that condition as Pass within specs.doc. If not, mark that condition as Fail, indicate how the behavior fails, and describe the sequence of steps needed to reproduce the behavior.
25
Wrap-up Homework Read Chapter 8 Ch 9 only homework due 09/18
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.