Debugging - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Debugging

Description:

Examine the most recent change. Don't make the same mistake twice ... Make the bug reproducible. Divide and conquer. Study the pattern in failing examples ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 10
Provided by: Alli225
Category:
Tags: debugging | study | time

less

Transcript and Presenter's Notes

Title: Debugging


1
Debugging
  • Types of Errors
  • Debugging Strategies

2
Agenda
  • Administrivia
  • Course Information
  • Lab 1 Turnin Again
  • Homework 1
  • Lecture
  • Debugging

3
Definitions
  • Error
  • Physical mistake in the code
  • Fault
  • Manifestation of the error
  • Failure
  • Inability of the program to behave in the
    intended manner
  • Debugging
  • Finding and fixing error

4
Errors
  • Classification of Errors
  • Structural
  • Data
  • Functionality as implemented
  • Implementation
  • Integration
  • Functional requirements
  • Test definition or execution
  • System, software architecture
  • Other

5
Thoughts on Errors
80 of errors are found in 20 of a projects
routines Endres 1975, Gremillions 1984, Boehm
1987
  • Scope of most errors is fairly limited
  • Many errors are outside the domain of
    construction
  • Most implementation errors are the programmers
    fault
  • Clerical errors are common source of problems
  • Misunderstanding the design is a recurring theme
  • Most errors are easy to fix
  • Industry average 15 50 errors/1000 lines of
    code

6
Debugging
  • Process of identifying root cause of an error
    and correcting it
  • May occupy up to 50 of project time
  • Is not a quality improvement measure
  • Is a skill to be learned/practiced/improved

7
Debugging Techniques
  • Use a tool
  • gdb, visual debugger
  • Step through your program
  • Insert printfs
  • Use assertions to predict intended behavior
  • Look at specific paths of execution

8
Finding Easy Bugs (K P)
  • Look for familiar patterns
  • Examine the most recent change
  • Dont make the same mistake twice
  • Debug it now, not later
  • Get a stack trace
  • Read before typing
  • Explain your code to someone else

9
Tracking Down Hard Bugs (KP)
  • Make the bug reproducible
  • Divide and conquer
  • Study the pattern in failing examples
  • Display output to localize search
  • Write self-checking code
  • Write a log file
  • Draw a picture
  • Use tools
  • Keep records
Write a Comment
User Comments (0)
About PowerShow.com