software testing 5-debuging - · pdf filedebugging is the activity of locating and correcting...

8
Debugging Debugging

Upload: lamlien

Post on 06-Mar-2018

220 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

DebuggingDebugging

Page 2: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging is the activity of locating and correcting errors.

It can start once a failure has been detected

Techniques used for debugging: Brute Force Debugging by Induction Debugging by Deduction Debugging by Backtracking Debugging by Testing

Page 3: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging By Brute ForceDebugging By Brute Force Requires little thought Inefficient and generally unsuccessful. Can be partitioned into three categories:

Debugging with a storage dump

Debugging according to the common suggestion to “scatter

print statements throughout the program”

Debugging with automated debugging tools

Page 4: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging by Induction (qui nap)Debugging by Induction (qui nap)

Thought Process Start with the clues and look for the relationships among

the clues

Hypothesis: giả thuyết

Pertinent: thích hợp

Locate pertinent

data

Organize Thedata

Study theirrelationship

Devise a Hypothesis

Prove theHypothesis

Fix the error

can

can cannot

cannot

Page 5: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging by InductionDebugging by Induction Locate the pertinent data: take account of all available data or

symptom about the problem Enumerate all you know about the program Organize the data: induction implies processing from the

particulars to generals Structure the pertinent data and search for the contradiction Devise a Hypothesis: Study clues and devise one or ore

hypothesis. If multiple theories are possible then select the most probable

one first. Prove the hypothesis: Prove the reasonableness of the

hypothesis. Hypothesis should completely explain the existence of clues.

Page 6: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging By DeductionDebugging By Deduction Start with set of suspects and use process of elimination

and refinement.

Steps:

Enumerate the possible causes or hypothesis

Use data to eliminate possible causes

Refine the remaining Hypothesis

Prove the remaining Hypothesis

Page 7: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging By BacktrackingDebugging By Backtracking

Effective method for locating errors in small programs.

Backtrack the incorrect result through the logic of the

program until you find the point where the logic went

astray.

Page 8: Software Testing 5-Debuging - · PDF fileDebugging is the activity of locating and correcting errors. It can start once a failure has been detected Techniques used for debugging: Brute

Debugging By TestingDebugging By Testing Test cases for debugging: purpose is to provide

information useful in locating a suspected error.

This method is used in conjunction with the induction

method