Why Programs Fail : A Guide to Systematic Debugging

Andreas Zeller

  • 出版商: Morgan Kaufmann
  • 出版日期: 2005-10-25
  • 售價: $2,780
  • 貴賓價: 9.5$2,641
  • 語言: 英文
  • 頁數: 480
  • 裝訂: Paperback
  • ISBN: 1558608664
  • ISBN-13: 9781558608665
  • 已過版

買這商品的人也買了...

相關主題

商品描述

Description:

Why Programs Fail is about bugs in computer programs, how to find them, how to reproduce them, and how to fix them in such a way that they do not occur anymore. This is the first comprehensive book on systematic debugging and covers a wide range of tools and techniques ranging from hands-on observation to fully automated diagnoses, and includes instructions for building automated debuggers. This discussion is built upon a solid theory of how failures occur, rather than relying on seat-of-the-pants techniques, which are of little help with large software systems or to those learning to program. The author, Andreas Zeller, is well known in the programming community for creating the GNU Data Display Debugger (DDD), a tool that visualizes the data structures of a program while it is running.

 

 

Table of Contents:

About the Author
Preface

1 How Failures Come to Be
1.1 My Program Does Not Work!
1.2 From Defects to Failures
1.3 Lost in Time and Space
1.4 From Failures to Fixes
1.5 Automated Debugging Techniques
1.6 Bugs, Faults, or Defects?
1.7 Concepts
1.8 Tools
1.9 Further Reading
1.10 Exercises

2 Tracking Problems
2.1 Oh! All These Problems
2.2 Reporting Problems
2.3 Managing Problems
2.4 Classifying Problems
2.4.1 Severity
2.4.2 Priority
2.4.3 Identifier
2.4.4 Comments
2.4.5 Notification
2.5 Processing Problems
2.6 Managing Problem Tracking
2.7 Requirements as Problems
2.8 Managing Duplicates
2.9 Relating Problems and Fixes
2.10 Relating Problems and Tests
2.11 Concepts
2.12 Tools
BUGZILLA
PHPBUGTRACKER
ISSUETRACKER
TRAC
SOURCEFORGE
GFORGE
2.13 Further Reading
2.14 Exercises

3 Making Programs Fail
3.1 Testing for Debugging
3.2 Controlling the Program
3.3 Testing at the Presentation Layer
3.3.1 Low-level Interaction
3.3.2 System-level Interaction
3.3.3 Higher-level Interaction
3.3.4 Assessing Test Results
3.4 Testing at the Functionality Layer
3.5 Testing at the Unit Layer
3.6 Isolating Units
3.7 Designing for Debugging
3.8 Preventing Unknown Problems
3.9 Concepts
3.10 Tools
JUNIT
ANDROID
APPLESCRIPT
VBSCRIPT
Other scripting languages
FAU
VMWare
Virtual PC
3.11 Further Reading
3.12 Exercises

4 Reproducing Problems
4.1 The First Task in Debugging
4.2 Reproducing the Problem Environment
4.3 Reproducing Program Execution
4.3.1 Reproducing Data
4.3.2 Reproducing User Interaction
4.3.3 Reproducing Communications
4.3.4 Reproducing Time
4.3.5 Reproducing Randomness
4.3.6 Reproducing Operating Environments
4.3.7 Reproducing Schedules
4.3.8 Physical Influences
4.3.9 Effects of Debugging Tools
4.4 Reproducing System Interaction
4.5 Focusing on Units
4.5.1 Setting Up a Control Layer
4.5.2 A Control Example
4.5.3 Mock Objects
4.5.4 Controlling More Interaction
4.6 Concepts
4.7 Tools
Winrunner
Android
Revirt
Checkpointing Tools
4.8 Further Reading
4.9 Exercises

5 Simplifying Problems
5.1 Simplifying the Problem
5.2 The Gecko BugAThon
5.3 Manual Simplification
5.4 Automatic Simplification
5.5 A Simplification Algorithm
5.6 Simplifying User Interaction
5.7 Random Input Simplified
5.8 Simplifying Faster
5.8.1 Caching
5.8.2 Stop Early
5.8.3 Syntactic Simplification
5.8.4 Isolate Differences, Not Circumstances
5.9 Concepts
5.10 Tools
Delta Debugging
Simplification Library
5.11 Further Reading
5.12 Exercises

6 Scientific Debugging
6.1 How to Become a Debugging Guru
6.2 The Scientific Method
6.3 Applying the Scientific Method
6.3.1 Debugging sample—Preparation
6.3.2 Debugging sample—Hypothesis
6.3.3 Debugging sample—Hypothesis
6.3.4 Debugging sample—Hypothesis
6.3.5 Debugging sample—Hypothesis
6.4 Explicit Debugging
6.5 Keeping a Logbook
6.6 Debugging Quick-and-Dirty
6.7 Algorithmic Debugging
6.8 Deriving a Hypothesis
6.9 Reasoning About Programs
6.10 Concepts
6.11 Further Reading
6.12 Exercises

7 Deducing Errors
7.1 Isolating Value Origins
7.2 Understanding Control Flow
7.3 Tracking Dependences
7.3.1 Effects of Statements
7.3.2 Affected Statements
7.3.3 Statement Dependences
7.3.4 Following Dependences
7.3.5 Leveraging Dependences
7.4 Slicing Programs
7.4.1 Forward Slices
7.4.2 Backward Slices
7.4.3 Slice Operations
7.4.4 Leveraging Slices
7.4.5 Executable Slices
7.5 Deducing Code Smells
7.6 Limits of Static Analysis
7.7 Concepts
7.8 Tools
CODESURFER
FINDBUGS
7.9 Further Reading
7.10 Exercises

8 Observing Facts
8.1 Observing State
8.2 Logging Execution
8.2.1 Logging Functions
8.2.2 Logging Frameworks
8.2.3 Logging with Aspects
8.2.4 Logging at the Binary Level
8.3 Using Debuggers
8.3.1 A Debugging Session
8.3.2 Controlling Execution
8.3.3 Postmortem Debugging
8.3.4 Logging Data
8.3.5 Invoking Functions
8.3.6 Fix and Continue
8.3.7 Embedded Debuggers
8.3.8 Debugger Caveats
8.4 Querying Events
8.4.1 Watchpoints
8.4.2 Uniform Event Queries
8.5 Visualizing State
8.6 Concepts
8.7 Tools
LOG4J
ASPECTJ
PIN
BCEL
GDB
DDD
JAVA SPIDER
eDOBS
8.8 Further Reading
8.9 Exercises

9 Tracking Origins
9.1 Reasoning Backwards
9.2 Exploring Execution History
9.3 Dynamic Slicing
9.4 Leveraging Origins
9.5 Tracking Down Infections
9.6 Concepts
9.7 Tools
ODB
9.8 Further Reading
9.9 Exercises

10 Asserting Expectations
10.1 Automating Observation
10.2 Basic Assertions
10.3 Asserting Invariants
10.4 Asserting Correctness
10.5 Assertions as Specifications
10.6 From Assertions to Verification
10.7 Reference Runs
10.8 System Assertions
10.8.1 Validating the Heap with MALLOC_CHECK
10.8.2 Avoiding Buffer Overflows with ELECTRICFENCE
10.8.3 Detecting Memory Errors with VALGRIND
10.8.4 Language Extensions
10.9 Checking Production Code
10.10 Concepts
10.11 Tools
JML
ESC
GUARD
VALGRIND
PURIFY
INSURE++=INSURE++
CYCLONE
CCURED
10.12 Further Reading
10.13 Exercises

11 Detecting Anomalies
11.1 Capturing Normal Behavior
11.2 Comparing Coverage
11.3 Statistical Debugging
11.4 Collecting Data in the Field
11.5 Dynamic Invariants
11.6 Invariants on the Fly
11.7 From Anomalies to Defects
11.8 Concepts
11.9 Tools
DAIKON
DIDUCE
11.10 Further Reading
11.11 Exercises

12 Causes and Effects
12.1 Causes and Alternate Worlds
12.2 Verifying Causes
12.3 Causality in Practice
12.4 Finding Actual Causes
12.5 Narrowing Down Causes
12.6 A Narrowing Example
12.7 The Common Context
12.8 Causes in Debugging
12.9 Concepts
12.10 Further Reading
12.11 Exercises

13 Isolating Failure Causes
13.1 Isolating Causes Automatically
13.2 Isolating versus Simplifying
13.3 An Isolation Algorithm
13.4 Implementing Isolation
13.5 Isolating Failure-inducing Input
13.6 Isolating Failure-inducing Schedules
13.7 Isolating Failure-inducing Changes
13.8 Problems and Limitations
13.9 Concepts
13.10 Tools
Delta Debugging Plug-ins for ECLIPSE
CCACHE
13.11 Further Reading
13.12 Exercises

14 Isolating Cause-Effect Chains
14.1 Useless Causes
14.2 Capturing Program States
14.3 Comparing Program States
14.4 Isolating Relevant Program States
14.5 Isolating Cause-Effect Chains
14.6 Isolating Failure-inducing Code
14.7 Issues and Risks
14.8 Concepts
14.9 Tools
ASKIGOR
IGOR
14.10 Further Reading
14.11 Exercises

15 Fixing the Defect
15.1 Locating the Defect
15.2 Focusing on the Most Likely Errors
15.3 Validating the Defect
15.3.1 Does the Error Cause the Failure?
15.3.2 Is the Cause Really an Error?
15.3.3 Think Before You Code
The Devil’s Guide to Debugging
15.4 Correcting the Defect
15.4.1 Does the Failure No Longer Occur?
15.4.2 Did the Correction Introduce New Problems?
15.4.3 Was the Same Mistake Made Elsewhere?
15.4.4 Did I Do My Homework?
15.5 Workarounds
15.6 Learning from Mistakes
15.7 Concepts
15.8 Further Reading
15.9 Exercises

Appendix: Formal Definitions
A.1 Delta Debugging
A.1.1 Configurations
A.2 Passing and Failing Run
A.3 Tests
A.4 Minimality
A.5 Simplifying
A.6 Differences
A.7 Isolating
A.2 Memory Graphs
A.2.1 Formal Structure
A.2.2 Unfolding Data Structures
A.2.3 Matching Vertices and Edges
A.2.4 Computing the Common Subgraph
A.2.5 Computing Graph Differences
A.2.6 Applying Partial State Changes
A.2.7 Capturing C State
A.3 Cause-Effect Chains

Glossary
Bibliography
Index

商品描述(中文翻譯)

《為何程式會失敗》是一本關於電腦程式中錯誤的書籍,介紹如何找到錯誤、如何重現錯誤以及如何修復錯誤,以使其不再發生。這是第一本全面介紹系統性調試的書籍,涵蓋了從實地觀察到完全自動診斷的各種工具和技術,並提供了構建自動調試器的指導。本書的討論建立在對錯誤發生原理的堅實理論基礎上,而不是依賴於靠感覺解決問題的技巧,這對於大型軟體系統或初學者學習程式設計的人來說幫助不大。作者Andreas Zeller在程式設計社群中以創建GNU Data Display Debugger (DDD)工具而聞名,該工具可以在程式運行時可視化程式的資料結構。

目錄:
關於作者
前言
1. 錯誤是如何產生的
1.1 我的程式無法運行!
1.2 從缺陷到錯誤
1.3 迷失在時間和空間中
1.4 從錯誤到修復
1.5 自動調試技術
1.6 Bug、故障還是缺陷?
1.7 概念
1.8 工具
1.9 進一步閱讀
1.10 練習

2. 追蹤問題
2.1 哦!這麼多問題
2.2 報告問題
2.3 管理問題
2.4 分類問題
2.4.1 嚴重程度
2.4.2 優先級
2.4.3 識別符
2.4.4 評論
2.4.5 通知
2.5 處理問題
2.6 管理問題追蹤
2.7 把需求當作問題
2.8 管理重複問題
2.9 關聯問題和修復
2.10 關聯問題和測試
2.11 概念
2.12 工具
BUGZILLA
PHPBUGTRACKER
ISSUETRACKER
TRAC
SOURCEFORGE
GFORGE
2.13 進一步閱讀
2.14 練習

3. 讓程式失敗
3.1 測試調試
3.2 控制程式
3.3 在呈現層進行測試
3.3.1 低層次互動
3.3.2 系統層次互動
3.3.3 更高層次互動
3.3.4 評估測試結果
3.4 在功能層進行測試
3.5 在單元層進行測試
3.6 隔離單元
3.7 為調試設計
3.8 預防未知問題
3.9 概念
3.10 工具
JUNIT
ANDROID
APPLESCRIPT
VBSCRIPT
其他腳本語言
FAU
VMWare
Virtual PC
3.11 進一步閱讀
3.12 練習

4. 重現問題
4.1 調試的第一步
4.2 重現問題環境
4.3 重現程式執行
4.3.1 重現資料
4.3.2 重現使用者互動
4.3.3 重現通訊
4.3.4 重現時間
4.3.5 重現隨機性
4.3.6 重現作業環境
4.3.7 重現排程
4.3.8 物理影響
4.3.9 調試工具的影響
4.4 重現系統互動
4.5 專注於單元
4.5.1 設置控制層
4.5.2 控制層範例
4.5.3 模擬物件
4.5.4 控制更多互動
4.6 概念
4.7 工具
Winrunner
Android
Revirt
Checkpointing Tools
4.8 進一步閱讀
4.9 練習

5. 簡化問題
5.1 簡化問題
5.2 Gecko BugAThon
5.3 手動簡化
5.4 自動簡化