Debugging Debugging CISC 323 Winter 2006 Prof. Lamb Prof. Kelly - - PowerPoint PPT Presentation

debugging debugging
SMART_READER_LITE
LIVE PREVIEW

Debugging Debugging CISC 323 Winter 2006 Prof. Lamb Prof. Kelly - - PowerPoint PPT Presentation

Debugging Debugging CISC 323 Winter 2006 Prof. Lamb Prof. Kelly malamb@cs.queensu.ca kelly-d@rmc.ca Included in Courseware Required reading: My Hairiest Bug War Stories Marc Eisenstadt Communications of the ACM,


slide-1
SLIDE 1

Debugging Debugging

CISC 323

Winter 2006

  • Prof. Lamb
  • Prof. Kelly

malamb@cs.queensu.ca kelly-d@rmc.ca

slide-2
SLIDE 2

2

Included in Courseware

  • Required reading:

– “My Hairiest Bug War Stories”

  • Marc Eisenstadt
  • Communications of the ACM, April 1997
  • Discussion

– What is debugging? – What three categories are identified by Eisenstadt to better understand debugging? – What experience have you had in debugging?

  • Software? Hardware? Electronics? Mechanics? Anything else?
slide-3
SLIDE 3

3

What is Debugging?

  • Various explanations

– The activity that is a consequence of successful testing – The process that results in the removal of the error – The process that locates and corrects the defect

» you hope!

  • Wikipedia definition

– Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware thus making it behave as

  • expected. Debugging tends to be harder when various

subsystems are tightly coupled, as changes in one may cause bugs to emerge in another.

slide-4
SLIDE 4

4

Human Aspects

  • Quote on debugging by Schneiderman

– Debugging is one of the more frustrating parts of

  • programming. It has elements of problem solving
  • r brain teasers, coupled with the annoying

recognition that you have made a mistake. Heightened anxiety, and the unwillingness to accept the possibility of errors, increases the task

  • difficulty. Fortunately, there is a great sigh of relief

and a lessening of tension when the bug is ultimately … corrected.

slide-5
SLIDE 5

5

High Level Approach to Debugging

1. Generate a hypothesis about the observed behaviour

  • May involve doing some more testing

2. Test your hypothesis

– Obtain more data – Create new test cases – Trace code manually (inspect code) – Use interactive debugging tools

3. Hypothesis fails – go to 1. 4. Hypothesis passes

  • Make changes to code
  • Rerun tests
  • that originally uncovered the bug
  • that are affected by the code changes
  • If any tests fail – go to 1
slide-6
SLIDE 6

6

Inspection vs. testing

  • Considering debugging, what is the

advantage of code inspection over testing?

slide-7
SLIDE 7

7

Eisenstadt’s Categories

(fill in the details)

  • Why bugs were difficult to track down
  • Techniques used to track down the bugs
  • Underlying causes of the reported bugs
slide-8
SLIDE 8

8

What experiences have you had debugging?

  • Note: rerunning the compiler to get rid of

syntax errors is not debugging!

  • Claim:

– Two of the biggest time wasters for non-software people trying to write and run software

  • Not knowing how to test and debug
  • Not knowing how to do version control