• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Debug It Ques - Reproducing Bugs

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My biggest problem in debugging is often being able to reproduce whatever the problem is. If I can duplicate the problem, I'm usually halfway there.

Without giving too much away, how much of your book covers reproducing defects, and do you have any general tips on how to do that?

Thanks.
 
author
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nancy,

You're 100% correct - the core debugging process consists of four steps (Reproduce -> Diagnose -> Fix -> Reflect), and finding an effective reproduction is the key that unlocks the whole thing. You won't be surprised to hear that a great deal of the book concentrates on strategies for finding a reproduction :-)

It's interesting to consider why reproducing the problem is so important. Diagnosis is all about identifying the root cause of the bug - understanding is everything.

There are many different approaches you can adopt to gain the understanding you seek. And as long as the approach you choose gets you closer to your goal, it has served its purpose.

Having said that, it turns out that in most instances one particular approach, the empirical approach, tends to be by far the most productive.

Empiricism relies upon observation or experience, rather than theory or pure logic. In the context of debugging, this means directly observing the behavior of the software. Yes, you could read the entire source code and use pure reason to work out what’s going on (and on occasion you may have no other choice), but doing so is usually inefficient and dangerous. You can track the problem down much more effectively by carefully constructing experiments and observing how the software behaves. Not only is this faster, but these observations force you to reexamine flawed assumptions in your mental model about how the software behaves.

The empirical process relies upon our ability to watch the software executing in the presence of the bug. If we can’t get the software to misbehave in the first place, then this, the most powerful weapon in our armory, is lost.
 
Nancy O'Connell
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul,
Thanks very much for that response. I've often thought that maybe I just wasn't bright enough because I couldn't debug problems simply by looking at the source code. So I'm glad to read that the empirical approach is a better approach to debugging software problems!
I look forward to reading your book and I'm sure it's going to make my life at work much easier...

Thanks,
Nancy
 
This tiny ad is wafer thin:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic