Debug It!: Find, Repair, and Prevent Bugs in Your Code

Overview

Some developers thrash around aimlessly looking for a bug without concrete results. Others have the knack of unerringly zeroing in on the root cause of a bug. Are they geniuses? Just lucky? No, they've learned the secrets of professional debugging. This book will equip you with the tools, techniques and approaches-proven in the crucible of professional software development-to ensure that you can tackle any bug with confidence.

You'll learn how to handle every stage of the bug ...

See more details below
Other sellers (Paperback)
  • All (11) from $13.98   
  • New (7) from $21.31   
  • Used (4) from $13.98   
Sending request ...

Overview

Some developers thrash around aimlessly looking for a bug without concrete results. Others have the knack of unerringly zeroing in on the root cause of a bug. Are they geniuses? Just lucky? No, they've learned the secrets of professional debugging. This book will equip you with the tools, techniques and approaches-proven in the crucible of professional software development-to ensure that you can tackle any bug with confidence.

You'll learn how to handle every stage of the bug life-cycle, from constructing software that makes debugging easy, through detection, reproduction, diagnosis and rolling out your eventual fix.

If you develop software, sooner or later you're going to discover that it doesn't always behave as you intended. Working out why it's misbehaving can be hard. Sometimes very hard. Debug It! is here to help!

All bugs are different: there is no silver bullet. You've got to rely upon your intellect, intuition, detective skills and yes, even a little luck. But that doesn't mean that you're completely on your own-there is much you can learn from those who have gone before. This book distills decades of hard-won experience gained in the trenches of professional software development, giving you a head-start and arming you with the tools you need to get to the bottom of the problem, whatever you're faced with.

Whether you're writing Java or assembly language, targeting servers or embedded micro-controllers, using agile or traditional approaches, the same basic bug-fixing principles apply. From constructing software that is easy to debug (and incidentally less likely to contain bugs in the first place), through handling bug reports to rolling out your ultimate fix, we'll cover the entire life-cycle of a bug.

You'll learn about the empirical approach, which leverages your software's unique ability to show you what's really happening, the importance of finding a reliable and convenient means of reproducing a bug, and common pitfalls so you can avoid them. You'll see how to use commonly available tools to automatically detect problems before they're reported by customers and how to construct "transparent software" that provides access to critical information and internal state.

Read More Show Less

Product Details

  • ISBN-13: 9781934356289
  • Publisher: Pragmatic Programmers, LLC, The
  • Publication date: 11/28/2009
  • Edition number: 1
  • Pages: 232
  • Sales rank: 1,082,278
  • Product dimensions: 7.40 (w) x 8.90 (h) x 0.90 (d)

Meet the Author

Paul Butcher started out writing games for 8-bit home computers before he was a teenager, and since then has worked in diverse fields at all levels of abstraction, from microcode on bit-slice processors to high-level declarative programming and all points in between. He's been using agile approaches for the last several years, although had adopted many of the same techniques before the agile movement gave them a name. Paul's depth of experience derives from a history of working for startups in which he's had the privilege of working with several great teams on cutting edge technology.

In an attempt to demonstrate that he's at least as fast as Lewis Hamilton, Paul totaled his race-car last year. So no more playing with expensive toys for the time being-but he will be back on track soon!

Read More Show Less

Table of Contents

Preface xi

About This Book xi

Acknowledgments xii

I The Heart of the Problem 1

1 A Method in the Madness 3

1.1 Debugging Is More Than "Making the Bug Go Away" 3

1.2 The Empirical Approach 5

1.3 The Core Debugging Process 6

1.4 First Things First 7

1.5 Put it in Action 11

2 Reproduce 13

2.1 Reproduce First, Ask Questions Later 13

2.2 Controlling the Software 15

2.3 Controlling the Environment 16

2.4 Controlling Inputs 18

2.5 Refining Your Reproduction 26

2.6 What If You Really Can't Reproduce It? 35

2.7 Put It in Action 38

3 Diagnose 39

3.1 Stand Back-I'm Going to Try Science 39

3.2 Stratagems 46

3.3 Debuggers 52

3.4 Pitfalls 53

3.5 Mind Games 57

3.6 Validate Your Diagnosis 62

3.7 Put it in Action 63

4 Fix 65

4.1 Clearing the Decks 66

4.2 Testing 67

4.3 Fix the Cause, Not the Symptoms 69

4.4 Refactoring 71

4.5 Checking in 73

4.6 Get Your Code Reviewed 74

4.7 Put it in Action 75

5 Reflect 77

5.1 How Did it Ever Work? 77

5.2 What Went Wrong? 78

5.3 It'll Never Happen Again 81

5.4 Close the Loop 84

5.5 Put it in Action 85

II The Bigger Picture 87

6 Discovering That You Have a Problem 89

6.1 Tracking Bugs 89

6.2 Working with Users 94

6.3 Working with Support Staff 99

6.4 Put it in Action 101

7 Pragmatic Zero Tolerance 103

7.1 Bugs Take Priority 103

7.2 The Debugging Mind-Set 106

7.3 Digging Yourself Out of a Quality Hole 108

7.4 Put it in Action 113

III Debug-Fu 115

8 Special Cases 117

8.1 Patching Existing Releases 117

8.2 Backward Compatibility 118

8.3 Concurrency 123

8.4 Heisenbugs 125

8.5 Performance Bugs 127

8.6 Embedded Software 129

8.7 Bugs in Third-Party Software132

8.8 Put it in Action 137

9 The Ideal Debugging Environment 139

9.1 Automated Testing 139

9.2 Source Control 142

9.3 Automatic Builds 147

9.4 Put it in Action 155

10 Teach Your Software to Debug Itself 157

10.1 Assumptions and Assertions 157

10.2 Debugging Builds 167

10.3 Resource Leaks and Exception Handling 172

10.4 Put it in Action 179

11 Anti-patterns 181

11.1 Priority Inflation 181

11.2 Prima Donna 182

11.3 Maintenance Team 184

11.4 Firefighting 186

11.5 Rewrite 187

11.6 No Code Ownership 189

11.7 Black Magic 189

11.8 Put it in Action 190

A Resources 193

A.1 Source Control and Issue-Tracking Systems 193

A.2 Build and Continuous Integration Tools 196

A.3 Useful Libraries 198

A.4 Other Tools 200

B Bibliography 205

Index 207

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)