Top Banner
The Science Of Debugging Susanth Kurunthil
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The science of debugging

The Science Of DebuggingSusanth Kurunthil

Page 2: The science of debugging

SDLC

Analysis

Specifications

Design

Coding

Testing

Installation

Support

Debugging

Page 3: The science of debugging

Science of Debugging

Debugging is an art, not a science yet No prescribed process Intuitive Skills enhanced by experience Can’t estimate for sure!

This is an attempt to bring debugging closer to a science

Page 4: The science of debugging

Bugs

What is a bug? A defect that causes the system not

to behave in the expected way Why is a bug called a bug? Debugging

The process of making the system to behave in the expected way

The debugging process: Where to start?

Page 5: The science of debugging

Debugging Example

Microsoft SQL Server Query

select count(*) as EmpCount, Designation

from employee where department = ’15’

and status = 'Active' group by Designation order by designation asc

Page 6: The science of debugging

Debugging Example Microsoft SQL Server Query

/* this SQL statement prints the active employee count by designation for the department ‘i5’ */

select count(*) as EmpCount, Designation

from employee where department = ’15’

and status = 'Active' group by Designation order by designation asc

Page 7: The science of debugging

The Debugging Process

Understanding

Isolation

Analysis

Solution

Testing

Page 8: The science of debugging

Understanding Bugs

Understand Expected behavior Current behavior Bug attributes

Bug Attributes Behavior Severity Priority

Page 9: The science of debugging

Understanding Bugs

Bug Behavior Often referred to as ‘Type’ Examples

Crash Data loss Denial of service Functionality mismatch Cosmetic (Spell errors, alignment etc.)

Absolute attribute

Page 10: The science of debugging

Understanding Bugs

Severity Perceived end-user effect Relative attribute

Applies to the module only There could be a direct correlation

between Behavior and Severity Correlates to Priority as well

Page 11: The science of debugging

Understanding Bugs

Priority Project management attribute Relative attribute

Applies to the module only Applies to the current timeline

(milestone) There will be a direct correlation

between Severity and Priority Same bug could assume a different

priority at a different project stage

Page 12: The science of debugging

Understanding Bugs

Additional Attributes Reproducibility

Impacts Debugging and QA Solvability

Impacts Debugging

Page 13: The science of debugging

Isolation

Page 14: The science of debugging

Isolation Process of narrowing the Bug Scope Bug Scope: Bug’s occurrence space Affirmative Reference Point (ARP)

A reference point you are sure of! It worked fine till yesterday evening! It doesn’t crash if I input a value < 1000

Assumptions can be built on it Bug is isolated based on one or more

ARPs Redefine Bug Scope iteratively

Page 15: The science of debugging

Isolation

Who should do it? QA Developer/Debugger

QA responsibility Clear bug description One or more ARPs The narrower the Bug Scope, the

better! Developer responsibility

Sufficiently narrow the Bug Scope

Page 16: The science of debugging

Analysis

Look for Syntactical errors Semantic errors

Check FEB list Beware

Only symptoms could be here, problem might be somewhere else

Don’t jump to conclusions too early

Page 17: The science of debugging

Solution

Solve current problem Scan the code for same or similar

problems elsewhere and fix them also

Check for other problems in the bug scope

Update FEB (Frequently Encountered Bugs) list

Page 18: The science of debugging

Testing Test the fix Test the features and

functionalities you MIGHT have broken with this fix

Test the features and functionalities you MIGHT NOT have broken with this fix

Ensure this issue won’t come back to you again

QA: Test for all possible occurrences of this bug

Page 19: The science of debugging

Sub-Optimal Processes

Shooting from the hip

Understanding

Isolation

Solution

Testing

Page 20: The science of debugging

Sub-Optimal Processes

Shooting in the dark

Understanding

Solution

Testing

Page 21: The science of debugging

Prevention

Prevention is better than cure Applying debugging processes to

development Narrow Feature Scope Use ARP’s while developing features Check feature against the FEB list Test the new features, features

around it before declaring it to be complete

You save more time and energy!

Page 22: The science of debugging

Thank You