The Science Of Debugging Susanth Kurunthil
SDLC Analysis Specifications Design Coding Testing Installation Support Debugging
Science of Debugging <ul><li>Debugging is an art, not a science yet </li></ul><ul><ul><li>No prescribed process </li></ul>...
Bugs <ul><li>What is a bug? </li></ul><ul><ul><li>A defect that causes the system not to behave in the expected way </li><...
Debugging Example <ul><li>Microsoft SQL Server Query </li></ul><ul><li>select  count(*) as EmpCount, Designation   </li></...
Debugging Example <ul><li>Microsoft SQL Server Query </li></ul><ul><li>/* this SQL statement prints the active employee co...
The Debugging Process Understanding Isolation Analysis Solution Testing
Understanding Bugs <ul><li>Understand  </li></ul><ul><ul><li>Expected behavior </li></ul></ul><ul><ul><li>Current behavior...
Understanding Bugs <ul><li>Bug Behavior  </li></ul><ul><ul><li>Often referred to as ‘Type’ </li></ul></ul><ul><ul><li>Exam...
Understanding Bugs <ul><li>Severity  </li></ul><ul><ul><li>Perceived end-user effect </li></ul></ul><ul><ul><li>Relative a...
Understanding Bugs <ul><li>Priority  </li></ul><ul><ul><li>Project management attribute </li></ul></ul><ul><ul><li>Relativ...
Understanding Bugs <ul><li>Additional Attributes  </li></ul><ul><ul><li>Reproducibility </li></ul></ul><ul><ul><ul><li>Imp...
Isolation
Isolation <ul><li>Process of narrowing the Bug Scope </li></ul><ul><li>Bug Scope: Bug’s occurrence space </li></ul><ul><li...
Isolation <ul><li>Who should do it?  </li></ul><ul><ul><li>QA </li></ul></ul><ul><ul><li>Developer/Debugger </li></ul></ul...
Analysis <ul><li>Look for </li></ul><ul><ul><li>Syntactical errors </li></ul></ul><ul><ul><li>Semantic errors </li></ul></...
Solution <ul><li>Solve current problem  </li></ul><ul><li>Scan the code for same or similar problems elsewhere and fix the...
Testing <ul><li>Test the fix  </li></ul><ul><li>Test the features and functionalities you MIGHT have broken with this fix ...
Sub-Optimal Processes <ul><li>Shooting from the hip </li></ul>Understanding Isolation Solution Testing
Sub-Optimal Processes <ul><li>Shooting in the dark </li></ul>Understanding Solution Testing
Prevention <ul><li>Prevention is better than cure </li></ul><ul><li>Applying debugging processes to development  </li></ul...
Thank You
Upcoming SlideShare
Loading in …5
×

The science of debugging

885 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
885
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • US Navy Admiral Grace Murray Hopper’s finding on a Harvard Mark II in 1945 Thomas Alva Edison referenced a problem as bug in 1889
  • The science of debugging

    1. 1. The Science Of Debugging Susanth Kurunthil
    2. 2. SDLC Analysis Specifications Design Coding Testing Installation Support Debugging
    3. 3. Science of Debugging <ul><li>Debugging is an art, not a science yet </li></ul><ul><ul><li>No prescribed process </li></ul></ul><ul><ul><li>Intuitive </li></ul></ul><ul><ul><li>Skills enhanced by experience </li></ul></ul><ul><ul><li>Can’t estimate for sure! </li></ul></ul><ul><li>This is an attempt to bring debugging closer to a science </li></ul>
    4. 4. Bugs <ul><li>What is a bug? </li></ul><ul><ul><li>A defect that causes the system not to behave in the expected way </li></ul></ul><ul><li>Why is a bug called a bug? </li></ul><ul><li>Debugging </li></ul><ul><ul><li>The process of making the system to behave in the expected way </li></ul></ul><ul><li>The debugging process: </li></ul><ul><ul><li>Where to start? </li></ul></ul>
    5. 5. Debugging Example <ul><li>Microsoft SQL Server Query </li></ul><ul><li>select count(*) as EmpCount, Designation </li></ul><ul><li>from employee </li></ul><ul><li>where department = ’15’ </li></ul><ul><li>and status = 'Active' </li></ul><ul><li>group by Designation </li></ul><ul><li>order by designation asc </li></ul>
    6. 6. Debugging Example <ul><li>Microsoft SQL Server Query </li></ul><ul><li>/* this SQL statement prints the active employee count by designation for the department ‘i5’ */ </li></ul><ul><li>select count(*) as EmpCount, Designation </li></ul><ul><li>from employee </li></ul><ul><li>where department = ’15’ </li></ul><ul><li>and status = 'Active' </li></ul><ul><li>group by Designation </li></ul><ul><li>order by designation asc </li></ul>
    7. 7. The Debugging Process Understanding Isolation Analysis Solution Testing
    8. 8. Understanding Bugs <ul><li>Understand </li></ul><ul><ul><li>Expected behavior </li></ul></ul><ul><ul><li>Current behavior </li></ul></ul><ul><ul><li>Bug attributes </li></ul></ul><ul><li>Bug Attributes </li></ul><ul><ul><li>Behavior </li></ul></ul><ul><ul><li>Severity </li></ul></ul><ul><ul><li>Priority </li></ul></ul>
    9. 9. Understanding Bugs <ul><li>Bug Behavior </li></ul><ul><ul><li>Often referred to as ‘Type’ </li></ul></ul><ul><ul><li>Examples </li></ul></ul><ul><ul><ul><li>Crash </li></ul></ul></ul><ul><ul><ul><li>Data loss </li></ul></ul></ul><ul><ul><ul><li>Denial of service </li></ul></ul></ul><ul><ul><ul><li>Functionality mismatch </li></ul></ul></ul><ul><ul><ul><li>Cosmetic (Spell errors, alignment etc.) </li></ul></ul></ul><ul><ul><li>Absolute attribute </li></ul></ul>
    10. 10. Understanding Bugs <ul><li>Severity </li></ul><ul><ul><li>Perceived end-user effect </li></ul></ul><ul><ul><li>Relative attribute </li></ul></ul><ul><ul><ul><li>Applies to the module only </li></ul></ul></ul><ul><ul><li>There could be a direct correlation between Behavior and Severity </li></ul></ul><ul><ul><li>Correlates to Priority as well </li></ul></ul>
    11. 11. Understanding Bugs <ul><li>Priority </li></ul><ul><ul><li>Project management attribute </li></ul></ul><ul><ul><li>Relative attribute </li></ul></ul><ul><ul><ul><li>Applies to the module only </li></ul></ul></ul><ul><ul><ul><li>Applies to the current timeline (milestone) </li></ul></ul></ul><ul><ul><li>There will be a direct correlation between Severity and Priority </li></ul></ul><ul><ul><li>Same bug could assume a different priority at a different project stage </li></ul></ul>
    12. 12. Understanding Bugs <ul><li>Additional Attributes </li></ul><ul><ul><li>Reproducibility </li></ul></ul><ul><ul><ul><li>Impacts Debugging and QA </li></ul></ul></ul><ul><ul><li>Solvability </li></ul></ul><ul><ul><ul><li>Impacts Debugging </li></ul></ul></ul>
    13. 13. Isolation
    14. 14. Isolation <ul><li>Process of narrowing the Bug Scope </li></ul><ul><li>Bug Scope: Bug’s occurrence space </li></ul><ul><li>Affirmative Reference Point (ARP) </li></ul><ul><ul><li>A reference point you are sure of! </li></ul></ul><ul><ul><ul><li>It worked fine till yesterday evening! </li></ul></ul></ul><ul><ul><ul><li>It doesn’t crash if I input a value < 1000 </li></ul></ul></ul><ul><ul><li>Assumptions can be built on it </li></ul></ul><ul><ul><li>Bug is isolated based on one or more ARPs </li></ul></ul><ul><li>Redefine Bug Scope iteratively </li></ul>
    15. 15. Isolation <ul><li>Who should do it? </li></ul><ul><ul><li>QA </li></ul></ul><ul><ul><li>Developer/Debugger </li></ul></ul><ul><li>QA responsibility </li></ul><ul><ul><li>Clear bug description </li></ul></ul><ul><ul><li>One or more ARPs </li></ul></ul><ul><ul><li>The narrower the Bug Scope, the better! </li></ul></ul><ul><li>Developer responsibility </li></ul><ul><ul><li>Sufficiently narrow the Bug Scope </li></ul></ul>
    16. 16. Analysis <ul><li>Look for </li></ul><ul><ul><li>Syntactical errors </li></ul></ul><ul><ul><li>Semantic errors </li></ul></ul><ul><li>Check FEB list </li></ul><ul><li>Beware </li></ul><ul><ul><li>Only symptoms could be here, problem might be somewhere else </li></ul></ul><ul><ul><li>Don’t jump to conclusions too early </li></ul></ul>
    17. 17. Solution <ul><li>Solve current problem </li></ul><ul><li>Scan the code for same or similar problems elsewhere and fix them also </li></ul><ul><li>Check for other problems in the bug scope </li></ul><ul><li>Update FEB (Frequently Encountered Bugs) list </li></ul>
    18. 18. Testing <ul><li>Test the fix </li></ul><ul><li>Test the features and functionalities you MIGHT have broken with this fix </li></ul><ul><li>Test the features and functionalities you MIGHT NOT have broken with this fix </li></ul><ul><li>Ensure this issue won’t come back to you again </li></ul><ul><li>QA: Test for all possible occurrences of this bug </li></ul>
    19. 19. Sub-Optimal Processes <ul><li>Shooting from the hip </li></ul>Understanding Isolation Solution Testing
    20. 20. Sub-Optimal Processes <ul><li>Shooting in the dark </li></ul>Understanding Solution Testing
    21. 21. Prevention <ul><li>Prevention is better than cure </li></ul><ul><li>Applying debugging processes to development </li></ul><ul><ul><li>Narrow Feature Scope </li></ul></ul><ul><ul><li>Use ARP’s while developing features </li></ul></ul><ul><ul><li>Check feature against the FEB list </li></ul></ul><ul><ul><li>Test the new features, features around it before declaring it to be complete </li></ul></ul><ul><li>You save more time and energy! </li></ul>
    22. 22. Thank You

    ×