Software Testing and Quality Assurance

Slides:



Advertisements
Similar presentations
Lecture 2: testing Book: Chapter 9 What is testing? Testing is not showing that there are no errors in the program. Testing cannot show that the program.
Advertisements

DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Data Flow Coverage. Reading assignment L. A. Clarke, A. Podgurski, D. J. Richardson and Steven J. Zeil, "A Formal Evaluation of Data Flow Path Selection.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 11 Instructor Paulo Alencar.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Systems V & V, Quality and Standards
The Application of Graph Criteria: Source Code  It is usually defined with the control flow graph (CFG)  Node coverage is used to execute every statement.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
1 Software Testing and Quality Assurance Lecture 9 - Software Testing Techniques.
White Box Testing Techniques Dynamic Testing. White box testing(1) Source code is known and used for test design While executing the test cases, the internal.
Software Testing and Quality Assurance
1 Software Testing and Quality Assurance Lecture 6 - Software Testing Techniques.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Topics in Software Dynamic White-box Testing: Data-flow Testing
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Systems Verification and Validation Laboratory Assignment 3
Topics in Software Dynamic White-box Testing Part 2: Data-flow Testing
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Software testing techniques Testing criteria based on data flow
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
Software Testing (Part 2)
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
White-Box Testing Techniques II Originals prepared by Stephen M. Thebaut, Ph.D. University of Florida Dataflow Testing.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
An Undergraduate Course on Software Bug Detection Tools and Techniques Eric Larson Seattle University March 3, 2006.
1 Graph Coverage (3). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section 2.2 ◦ Section
1 Software Testing & Quality Assurance Lecture 13 Created by: Paulo Alencar Modified by: Frank Xu.
Control Flow Graphs : The if Statement 1 if (x < y) { y = 0; x = x + 1; } else { x = y; } x >= yx < y x = y y = 0 x = x + 1 if (x < y) { y = 0;
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Software Testing and Maintenance Lecture 3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt Instructor: Hossein Momeni Mazandaran.
Structural Coverage. Measurement of structural coverage of code is a means of assessing the thoroughness of testing. Such metrics do not constitute testing.
Software Dynamic White-box Testing Part 2: Data-flow Testing Lecture 7 Prof. Mostafa Abdel Aziem Mostafa.
White-Box Testing Statement coverage Branch coverage Path coverage
CS223: Software Engineering Lecture 26: Software Testing.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
CS223: Software Engineering
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Paul Ammann & Jeff Offutt
Outline of the Chapter Basic Idea Outline of Control Flow Testing
When is testing sufficient?
CONTROL FLOW TESTING.
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
White-Box Testing Techniques II
CHAPTER 4 Test Design Techniques
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Testing, conclusion Based on material by Michael Ernst, University of Washington.
White-Box Testing Techniques II
Paul Ammann & Jeff Offutt
Structural Coverage.
Graph Coverage for Source Code
Control Structure Testing
Structural Coverage.
White-Box Testing Techniques II
Whitebox Testing.
Paul Ammann & Jeff Offutt
Whitebox Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Software Testing and Quality Assurance Lecture 8 - Software Testing Techniques

Lecture Outline Discuss testing techniques based on achieving coverage of the software. Control-flow testing Data-flow testing Static Data-flow testing

Coverage Based Testing To achieve some form of coverage of the program-under- test based on well-defined-criteria Rather than partitioning the input domain of the program.

Control-flow Testing Aims to understand the flow of control within a program. Select test inputs to exercise paths in the Control-Flow Graph (CFG). Paths are selected based on the control information in the graph. Examples of coverage criteria include: Path coverage Branch coverage condition coverage

Control-flow Graphs Control-flow is a graph G = (V,E) where; Vertex represents a program statement Edge represents the ability of a program to flow from its current statement to the next statement. If an edge is associated with a conditional statement, label the edge with the conditional value, either true or false.

Control-flow Graphs - Example Int power (int base, int n) { int power i; power = 1; for (i = 1; I ≤ n; i ++) { power = base * power; } Return power;

Control-flow Graphs - Example int base, int n int power, 1 Power = 1 i = 1 i = i + 1 I ≤ n Power = base * power return power

Control-flow Graphs - Example int base, int n Execution Path Condition int power, 1 Power = 1 i = 1 Branch or decision i = i + 1 I ≤ n Power = base * power return power

Coverage Based Criteria Statement - every statement of the program should be exercised at least once. Branch coverage - every possible alternative in a branch of the program should be tested at least once. Condition coverage - each condition in a branch is made to evaluate to true or false.

Coverage Based Criteria Multiple condition coverage All possible combinations of condition outcomes within each branch should be exercised at least once. For example, if (a&&b) --- evaluate all possible combinations. Path coverage Every execution path of the program should be exercised at least once.

For example, program with 5 input variables Data-Flow Testing Despite analysis of input and output domains used in Equivalence partitioning, boundary value analysis, and control flow Testing relies on personal experience to choose test cases. For example, program with 5 input variables 3125 possible EC

Complement coverage based testing. Data-Flow Testing Information about the creation and use of data definitions in a program. Detect many single programming or logical faults in the program; Provide testers with dependencies between the definitions and use of variables. Complement coverage based testing.

Static Data-Flow Testing Simplest form of data-flow analysis A programming language statement can act on a variable in 3 different ways. Define a variable Reference a variable Undefined a variable

Static Data-Flow Testing - Define (d) A statement defines a variable by assigning a value to a variable. For example, x = 5; Scan (x); x = 3 * y; Defined the variable x Only defined the variable x If y is declared and defined.

Static Data-Flow Testing - Reference (r) A statement makes a reference to a variable either as an: I-value - variable, array cell into which values can be stored. A variable that appears on the left hand side of an assignment statement. R -value - any variable that must be referenced to get its value. A variable that appears on the right hand side of an assignment statement.

Static Data-Flow Testing - Un-define (u) A statement un-defines a variable whenever the value of the variable becomes unknown. For example, The scope of a local variable ends.

Static Data-Flow Testing - Anomalies u-r anomaly Undefined variable is referenced. For example, un-initialized variable. d-u anomaly A defined variable has not been referenced before it becomes undefined. d-d anomaly Same variable is defined twice. Usually due to misspelling or because variables have been imported from another function.

Action on variable c No action A B Define C False reference D E Int i,j; int *c; B Define C = malloc(….) C Error (….) c = Null False reference D C [0] = 1; c[1] = 1; sum = 2; E No action i = 2 F H False G I ≤ n Return sum; True reference I C [i] = c[I-1] + c[I-2]; sum += c[I]; Un-define Fee (c) J No action I++ K u-r anomaly

Key points Control-Flow Testing aims to understand the flow of control within a program. Most common - Control-Flow Graph Data-Flow Testing Provides additional information to use for program analysis and testing. Static Data-Flow Analysis Typing errors Un-initialized variables, Misspelling of names etc.

Announcement Quiz 2 moved from Material Wednesday 29/10/2008 to Saturday 01/11/2008. Material Lec 6, Lec 7,Lec 8 & Lec 9