Developer Testing and Debugging. Resources Code Complete by Steve McConnell Code Complete by Steve McConnell Safari Books Online Safari Books Online Google.

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Testing Workflow Purpose
Test Yaodong Bi.
Lecture 8: Testing, Verification and Validation
Verification and Validation
Testing and Quality Assurance
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Practical Testing Techniques. Verification and Validation Validation –does the software do what was wanted? “Are we building the right system?” –This.
Software Testing By Marcin Starzomski :P. What is Testing ? Testing is a process used to help identify the correctness, completeness and quality of developed.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
Informatics 43 – April 30, What is a test case? An input to a system, and the correct output. An “input” may be complex. Example: – What is an input.
Testing CPSC 315 – Programming Studio Fall Testing Testing helps find that errors exist Debugging finds and fixes them Systematic attempt to break.
Software Testing. Overview Definition of Software Testing Problems with Testing Benefits of Testing Effective Methods for Testing.
Software Testing and Quality Assurance
Debugging CPSC 315 – Programming Studio Fall 2008.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Testing - an Overview September 10, What is it, Why do it? Testing is a set of activities aimed at validating that an attribute or capability.
Test Design Techniques
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
TESTING.
Test plans CSCI102 - Systems ITCS905 - Systems MCS Systems.
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
CPIS 357 Software Quality & Testing
CMSC 345 Fall 2000 Unit Testing. The testing process.
Chapter 8 – Software Testing Lecture 1 1Chapter 8 Software testing The bearing of a child takes nine months, no matter how many women are assigned. Many.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
Testing, Bug Fixing and Debugging the Code Yordan Dimitrov Telerik Corporation
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
1 Chapter 22 Developer Testing. 2 introduction Testing is the most popular quality-improvement activity Testing is the most popular quality-improvement.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Testing, Bug Fixing and Debugging the Code Yordan Dimitrov Telerik Corporation
Chapter 22 Developer testing Peter J. Lane. Testing can be difficult for developers to follow  Testing’s goal runs counter to the goals of the other.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Week 9 Data structures / collections. Vladimir Misic Week 9 Monday, 4:20:52 PM2 Data structures (informally:) By size: –Static (e.g. arrays)
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Chapter 1: Fundamental of Testing Systems Testing & Evaluation (MNN1063)
Software Quality Assurance and Testing Fazal Rehman Shamil.
Dynamic Testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
CX Introduction to Web Programming Testing.
Chapter 22 Developer Testing
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
Testing Tutorial 7.
Testing and Debugging PPT By :Dr. R. Mall.
Chapter 18 Software Testing Strategies
CSCE 315 – Programming Studio, Fall 2017 Tanzir Ahmed
Testing and Test-Driven Development CSC 4700 Software Engineering
Software testing.
CS240: Advanced Programming Concepts
Informatics 43 – April 28, 2016.
Chapter 10 – Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CPSC 315 – Programming Studio
Java & Testing.
Chapter 7 Software Testing.
Testing, Inspection, Walkthrough
Software Testing.
Presentation transcript:

Developer Testing and Debugging

Resources Code Complete by Steve McConnell Code Complete by Steve McConnell Safari Books Online Safari Books Online Google Image search Google Image search

Testing/Debugging Debugging - identifying the root cause of an error and correcting it Debugging - identifying the root cause of an error and correcting it Testing – detecting errors Testing – detecting errors

Role of Developer Testing in Software Quality Testing is an important part of software quality, but also is difficult. Why? Characteristics of testing: Counter-intuitive Counter-intuitive Goal - > finding errors By itself, does not improve quality By itself, does not improve quality Example: X-Ray – Does not improve your health Can’t prove absence of errors Can’t prove absence of errors

Definitions Some Types of Testing Unit Unit Component Component Integration Integration Regression Regression System System Black box Black box White box White box

Types of Testing Unit/Component Testing Unit/Component The execution of a class, package, small program, or other program element which is tested in isolation from the more complete system.

Types of Testing Integration Testing Unit/Component Combined execution of two or more classes, packages, components, or subsystems that have been created by multiple programmers or programming teams.

Types of Testing Regression Testing Unit/Component Running previously executed test cases for the purpose of finding defects in software that previously passed the same set of tests.

Types of Testing System Testing Unit/Component The execution of the software in its final configuration.

Types of Testing Black Box Testing Tester cannot see inner workings of item being tested. Tester cannot see inner workings of item being tested. ?

Types of Testing White (or Glass) Box Testing Tester is aware of the inner workings of item being tested. Tester is aware of the inner workings of item being tested.

Types of Testing Unit/Component Integration Regression System White Box Black Box Developers Special Test Personnel Other Testing: Beta Customer acceptance Performance …

Limitations of Developer Testing Tests tend to be “clean tests” Tests tend to be “clean tests” Tests tend to have an optimistic view of coverage Tests tend to have an optimistic view of coverage Tests tend to skip sophisticated test coverage Tests tend to skip sophisticated test coverage

Test First or Test Last? Benefits of writing test cases first: Benefits of writing test cases first: Doesn’t take any more time – resequences Doesn’t take any more time – resequences Forces you to think about the requirement Forces you to think about the requirement Exposed requirement problems sooner Exposed requirement problems sooner

Recommended Approach to Developer Testing Test for each relevant requirement Test for each relevant requirement Test for each relevant design concern Test for each relevant design concern Keep track of kinds of errors made Keep track of kinds of errors made Design test cases along with product Design test cases along with product

Recommended Approach to Developer Testing (cont.) Incomplete Testing – “most likely” Incomplete Testing – “most likely” Structured Basis Testing – “at least once” Structured Basis Testing – “at least once” Data Flow Testing – “follow that data” Data Flow Testing – “follow that data” Equivalence Partitioning – “streamlining” Equivalence Partitioning – “streamlining” Error Guessing – “sixth sense” Error Guessing – “sixth sense” Boundary Analysis – “to the limit” Boundary Analysis – “to the limit”

Typical Errors Summary of Boris Beizer’s study on errors: Summary of Boris Beizer’s study on errors: 25.18%Structural 25.18%Structural 22.44%Data 22.44%Data 16.19%Functionality as implemented 16.19%Functionality as implemented 9.88%Construction 9.88%Construction 8.98%Integration 8.98%Integration 8.12%Functional requirements 8.12%Functional requirements 2.76%Test definition or execution 2.76%Test definition or execution 1.74%System, software architecture 1.74%System, software architecture 4.71%Unspecified 4.71%Unspecified

Test-Support Tools Scaffolding Scaffolding Diff tools Diff tools Test data gatherers Test data gatherers Coverage monitors Coverage monitors Data recorder/logger Data recorder/logger Symbolic debuggers Symbolic debuggers System perturbers System perturbers Error databases Error databases

Improving Your Testing Repeatable Tests Repeatable Tests Automate Tests Automate Tests

Keeping Test Records Errors tend to cluster in a few error-prone classes and routines. Errors tend to cluster in a few error-prone classes and routines.

Testing Summary Testing by the developer is a key part of a full testing strategy. Testing by the developer is a key part of a full testing strategy. Writing test cases before the code takes the same amount of time and effort. Writing test cases before the code takes the same amount of time and effort. Testing is only one part of a good software-quality program. Testing is only one part of a good software-quality program. Many test cases can be generated deterministically by using basis testing, dataflow analysis, boundary analysis, classes of bad data, and classes of good data. Many test cases can be generated deterministically by using basis testing, dataflow analysis, boundary analysis, classes of bad data, and classes of good data. Errors tend to cluster in a few error-prone classes and routines. Errors tend to cluster in a few error-prone classes and routines. Automated testing is useful, essential for regression testing. Automated testing is useful, essential for regression testing. Make it regular, measure it, and use what you learn to improve it. Make it regular, measure it, and use what you learn to improve it.

Debugging Finding and Getting Rid of Bugs Finding and Getting Rid of Bugs

Debugging Overview The process of identifying the root cause of an error and correcting it. The process of identifying the root cause of an error and correcting it. Not a way to improve the quality of your software per se; it's a way to diagnose defects. Not a way to improve the quality of your software per se; it's a way to diagnose defects.

Debugging - Perspective Defects as Opportunities – You can learn: Defects as Opportunities – You can learn: About the program you’re working on About the program you’re working on About the kinds of mistakes you make About the kinds of mistakes you make About the quality of your code About the quality of your code About how you solve problems About how you solve problems About how you fix defects About how you fix defects

Finding a Defect Stabilize the error. Stabilize the error. Locate the source of the error (the "fault"). Locate the source of the error (the "fault"). Fix the defect. Fix the defect. Test the fix. Test the fix. Look for similar errors. Look for similar errors.

Fixing a Defect Understand the problem before you fix it Understand the problem before you fix it Understand the program, not just the problem Understand the program, not just the problem Confirm the defect diagnosis Confirm the defect diagnosis Relax Relax Save the original source code Save the original source code Fix the problem, not the symptom Fix the problem, not the symptom Change the code only for good reason Change the code only for good reason Make one change at a time Make one change at a time Check your fix Check your fix Add a unit test that exposes the defect Add a unit test that exposes the defect Look for similar defects Look for similar defects

Psychological Considerations in Debugging Psychological Set contributes to debugging blindness. Psychological Set contributes to debugging blindness.

Psychological Considerations in Debugging (Examples) Psychological Distance Can Help Psychological Distance Can Help First Variable Second Variable Psychological Distance stopptstcppt Almost invisible shiftrnshiftrm Almost none dcountBcountSmall claims1claims2Small productsumLarge

Debugging Tools Source-Code Comparators Source-Code Comparators Compiler Warning Messages Compiler Warning Messages Execution Profilers Execution Profilers Test Frameworks/Scaffolding Test Frameworks/Scaffolding Commercial Debuggers Commercial Debuggers

Summary Debugging is a make-or-break aspect of software development. Debugging is a make-or-break aspect of software development. A systematic approach to finding and fixing errors is critical to success. A systematic approach to finding and fixing errors is critical to success. Understand the root problem before you fix the program. Understand the root problem before you fix the program. Set your compiler warning to the pickiest level possible. Set your compiler warning to the pickiest level possible. Debugging tools are powerful aids to software development. Debugging tools are powerful aids to software development.