Debugging by Thinking
eBook - ePub

Debugging by Thinking

A Multidisciplinary Approach

  1. 600 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Debugging by Thinking

A Multidisciplinary Approach

About this book

Debugging by Thinking: A Multi-Disciplinary Approach is the first book to apply the wisdom of six disciplines—logic, mathematics, psychology, safety analysis, computer science, and engineering—to the problem of debugging. It uses the methods of literary detectives such as Sherlock Holmes, the techniques of mathematical problem solving, the results of research into the cognitive psychology of human error, the root cause analyses of safety experts, the compiler analyses of computer science, and the processes of modern engineering to define a systematic approach to identifying and correcting software errors.* Language Independent Methods: Examples are given in Java and C++* Complete source code shows actual bugs, rather than contrived examples* Examples are accessible with no more knowledge than a course in Data Structures and Algorithms requires * A "thought process diary" shows how the author actually resolved the problems as they occurred

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Debugging by Thinking by Robert Charles Metzger in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming. We have over one million books available in our catalogue for you to explore.

Information

1

Introduction

If builders built buildings the way programmers wrote programs, the first woodpecker that came along would destroy civilization.
Gerald Weinberg

1.1 The nature of the problem

I don’t believe that the story of a moth found in a relay of one of the first digital computers adequately explains why software defects are commonly referred to as bugs. Books on debugging often begin with a recitation of how Adm. Grace Hopper found a moth, which had shorted out an electronic relay, in the Mark II computer. While the story may be true and although there are many variations told, the aptness of the term goes far deeper than this incident.
The word “bug” is commonly used to refer both to insects and arachnids. In the natural world, bugs are often the chief competitors of humankind. Scientists speculate that if humans became extinct, bugs would become the dominant life form on the planet. According to the Bible, three of the ten plagues that God visited on Egypt, to free the Israelites from slavery, were visitations of bugs (gnats, flies, and locusts). Bugs bite us, sting us, destroy our houses, consume our food, and transmit to us many of the worst diseases that afflict humanity.
Software bugs afflict people in very similar ways. Like natural bugs, they’re everywhere. Almost all interesting software has bugs, and most interesting software has far too many bugs. Like natural bugs, they cause irritation and even pain when we encounter them. Now that computer chips are embedded in so many devices, software bugs can threaten human life and property. Calling software defects “bugs” resonates with us at a deep level.
This is because software defects are becoming as troublesome as insects and arachnids have been in the past.
There are many reasons why today’s software has so many defects. One reason is that many programmers aren’t very good at debugging. Some programmers look on the debugging phase of the software life cycle with the same enthusiasm they show for filling out their income tax forms.
The purpose of this book is to reduce the effort programmers expend to diagnose software bugs. If the time available to debug remains constant in a project, this efficiency improvement will reduce the total number of bugs in a software program. If the number of outstanding bugs remains constant in a project, this efficiency improvement will reduce the time it takes to deliver that software. Either way, the person who benefits is the ultimate user of the program.

1.1.1 Definitions

It’s important to use a consistent set of terms when studying a subject. We will use the term symptom to mean an observable difference between the actual behavior and the planned behavior of a software unit. The IEEE94 Software Engineering Standards [IEEE94] refer to this as a failure.
We will use the term defect to mean that aspect of the design or implementation that will result in a symptom. The IEEE94 Software Engineering Standards refer to this as a fault. We will use the term bug interchangeably with defect.

1.2 The six ways of thinking

This book explores methods for debugging, organized according to six intellectual disciplines:
1. The way of the detective
2. The way of the mathematician
3. The way of the safety expert
4. The way of the psychologist
5. The way of the computer scientist
6. The way of the engineer
Each way has an analogy, a set of assumptions that forms a worldview, and a set of techniques associated with it. We follow a multidisciplinary approach, in which we seek the best methods for solving intellectual problems.
When we follow the way of the detective, we use an analogy between the search for the culprit in a murder mystery and the search for a software defect in a program. The defect is treated as a crime, and the programmer is the detective. A detective who wants to solve a crime must determine the answers to several important questions:
image
Who did it?
image
How did the culprit do it?
image
When did the culprit do it?
image
Why did the culprit do it?
We seek similar answers for software defects.
When we follow the way of the mathematician, we use an analogy between developing a proof of a mathematical proposition and developing a diagnosis of a software defect in a program. In the past several centuries, mathematicians...

Table of contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Dedication
  6. Preface
  7. Chapter 1: Introduction
  8. Chapter 2: Sherlock Holmes
  9. Chapter 3: Lord Peter Wimsey
  10. Chapter 4: Professor Solomon
  11. Chapter 5: Case Studies I
  12. Chapter 6: Mathematical Problem Solving
  13. Chapter 7: Debugging Strategies
  14. Chapter 8: Debugging Heuristics
  15. Chapter 9: Debugging Tactics
  16. Chapter 10: Case Studies II
  17. Chapter 11: The Way of the Safety Expert
  18. Chapter 12: The Way of the Psychologist
  19. Chapter 13: The Way of the Engineer
  20. Chapter 14: The Way of the Computer Scientist
  21. Chapter 15: Get Back to Work
  22. Glossary
  23. Root-Cause Checklist
  24. Books about Debugging
  25. Software Recommendations
  26. References
  27. INDEX