© 2000 Morgan Kaufman Overheads for Computers as Components Program design and analysis zProgram validation and testing.

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

Chapter 14 Testing Tactics
Analysis of programs with pointers. Simple example What are the dependences in this program? Problem: just looking at variable names will not give you.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
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.
Software Testing Techniques. December Introduction Many aspects to achieving software quality –Formal reviews (of both the software process and.
1 “White box” or “glass box” tests “White Box” (or “Glass Box”) Tests.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Testing an individual module
Chapter 18 Testing Conventional Applications
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Software Engineering Lecture 12 Software Testing Techniques 1.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
Fundamentals of Python: From First Programs Through Data Structures
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Systems Verification and Validation Laboratory Assignment 3
System/Software Testing
Software Testing (Part 2)
CMSC 345 Fall 2000 Unit Testing. The testing process.
Testing phases. Test data Inputs which have been devised to test the system Test cases Inputs to test the system and the predicted outputs from these.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Agenda Introduction Overview of White-box testing Basis path testing
Lecture 11 Test and Fault Tolerance Ingo Sander
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 14a: Software Testing Techniques Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Software Testing and Reliability Southern Methodist University CSE 7314.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
Software Construction Lecture 19 Software Testing-2.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Dynamic Testing.
White Box Testing by : Andika Bayu H.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
White-Box Testing Techniques I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 7.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
White-Box Testing Statement coverage Branch coverage Path coverage
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
Defect testing Testing programs to establish the presence of system defects.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Software Testing.
Software Engineering (CSI 321)
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Chapter 14 Software Testing Techniques
“White box” or “glass box” tests
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
White-Box Testing Techniques I
Whitebox Testing.
Whitebox Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Unit III – Chapter 3 Path Testing.
Presentation transcript:

© 2000 Morgan Kaufman Overheads for Computers as Components Program design and analysis zProgram validation and testing.

© 2000 Morgan Kaufman Overheads for Computers as Components Goals zMake sure software works as intended. yWe will concentrate on functional testing--- performance testing is harder. zWhat tests are required to adequately test the program? yWhat is “adequate”?

© 2000 Morgan Kaufman Overheads for Computers as Components Basic testing procedure zProvide the program with inputs. zExecute the program. zCompare the outputs to expected results.

© 2000 Morgan Kaufman Overheads for Computers as Components Types of software testing zBlack-box: tests are generated without knowledge of program internals. zClear-box (white-box): tests are generated from the program structure.

© 2000 Morgan Kaufman Overheads for Computers as Components Clear-box testing zGenerate tests based on the structure of the program. yIs a given block of code executed when we think it should be executed? yDoes a variable receive the value we think it should get?

© 2000 Morgan Kaufman Overheads for Computers as Components Controllability and observability zControllability: must be able to cause a particular internal condition to occur. zObservability: must be able to see the effects of a state from the outside.

© 2000 Morgan Kaufman Overheads for Computers as Components Example: FIR filter zCode: for (firout = 0.0, j =0; j < N; j++) firout += buff[j] * c[j]; if (firout > 100.0) firout = 100.0; if (firout < ) firout = ; zControllability: to test range checks for firout, must first load circular buffer. zObservability: how do we observe values of buff, firout?

© 2000 Morgan Kaufman Overheads for Computers as Components Path-based testing zClear-box testing generally tests selected program paths: ycontrol program to exercise a path; yobserve program to determine if path was properly executed. zMay look at whether location on path was reached (control), whether variable on path was set (data).

© 2000 Morgan Kaufman Overheads for Computers as Components Points of view zSeveral ways to look at control coverage: ystatement coverage; ybasis sets; ycyclomatic complexity; ybranch testing; ydomain testing.

© 2000 Morgan Kaufman Overheads for Computers as Components Example: choosing paths zTwo possible criteria for selecting a set of paths: yExecute every statement at least once. yExecute every direction of a branch at least once.  Equivalent for structured programs, but not for programs with goto s.

© 2000 Morgan Kaufman Overheads for Computers as Components Path example Covers all statements +/+ Covers all branches

© 2000 Morgan Kaufman Overheads for Computers as Components Basis paths zHow many distinct paths are in a program? zAn undirected graph has a basis set of edges: ya linear combination of basis edges (xor together sets of edges) gives any possible subset of edges in the graph. zCDFG is directed, but basis set is an approximation.

© 2000 Morgan Kaufman Overheads for Computers as Components Basis set example ab c ed a b c d e a b c d e incidence matrix a b c d e basis set

© 2000 Morgan Kaufman Overheads for Computers as Components Cyclomatic complexity zProvides an upper bound on the control complexity of a program: ye = # edges in control graph; yn = # nodes in control graph; yp = # graph components. zCyclomatic complexity: yM = e - n + 2p. yStructured program: # binary decisions + 1.

© 2000 Morgan Kaufman Overheads for Computers as Components Branch testing strategy zExercise the elements of a conditional, not just one true and one false case. zDevise a test for every simple condition in a Boolean expression.

© 2000 Morgan Kaufman Overheads for Computers as Components Example: branch testing zMeant to write: if (a || (b >= c)) { printf(“OK\n”); } zActually wrote: if (a && (b >= c)) { printf(“OK\n”); } zBranch testing strategy: yOne test is a=F, (b >= c) = T: a=0, b=3, c=2. yProduces different answers.

© 2000 Morgan Kaufman Overheads for Computers as Components Another branch testing example zMeant to write: if ((x == good_pointer) && (x->field1 == 3))... zActually wrote: if ((x = good_pointer) && (x->field1 == 3))... zBranch testing strategy: yIf we use only field1 value to exercise branch, we may miss pointer problem.

© 2000 Morgan Kaufman Overheads for Computers as Components Domain testing zConcentrates on linear inequalities. zExample: j <= i + 1. zTest two cases on boundary, one outside boundary. correct incorrect

© 2000 Morgan Kaufman Overheads for Computers as Components Data flow testing zDef-use analysis: match variable definitions (assignments) and uses. zExample: x = 5; … if (x > 0)... zDoes assignment get to the use? def p-use

© 2000 Morgan Kaufman Overheads for Computers as Components Loop testing zCommon, specialized structure--- specialized tests can help. zUseful test cases: yskip loop entirely; yone iteration; ytwo iterations; ymid-range of iterations; yn-1, n, n+1 iterations.

© 2000 Morgan Kaufman Overheads for Computers as Components Black-box testing zBlack-box tests are made from the specifications, not the code. zBlack-box testing complements clear-box. yMay test unusual cases better.

© 2000 Morgan Kaufman Overheads for Computers as Components Types of black-box tests zSpecified inputs/outputs: yselect inputs from spec, determine requried outputs. zRandom: ygenerate random tests, determine appropriate output. zRegression: ytests used in previous versions of system.

© 2000 Morgan Kaufman Overheads for Computers as Components Evaluating tests zHow good are your tests? yKeep track of bugs found, compare to historical trends. zError injection: add bugs to copy of code, run tests on modified code.