MTAT : Software Testing

Size: px
Start display at page:

Download "MTAT : Software Testing"

Transcription

1 MTAT : Software Testing Lecture 03: White-Box Testing (Textbook Ch. 5) Spring 2013 Dietmar Pfahl

2 Lecture Chapter 5 White-box testing techniques (Lab 3)

3 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Data-Flow Testing Loop Testing Fault-Based Testing (Mutation Testing)

4 Testing Strategies requirements output input events Black Box Testing White Box Testing

5 Types of Testing system integration module unit Level of detail portability maintainability efficiency usability reliability functionality white box black box Accessibility Characteristics

6 White-Box Testing (Ch 5) Exhaustive Testing If-then-else There are many possible paths! 5 20 (~10 14 ) different paths loop < 20x Selective Testing

7 Selective Testing a selected path Selective: Control flow testing Data flow testing Loop testing Fault-based testing

8 Code Coverage (Test Coverage) Measures the extent to which certain code items related to a defined test adequacy criterion have been executed (covered) by running a set of test cases (= test suites) Goal: Define test suites such that they cover as many (disjoint) code items as possible

9 Code Coverage Measure Example Statement Coverage (CV s ) Portion of the statements tested by at least one test case. S CV t s 100% S p S : number of statements tested S t p : total number of statements

10 Code Coverage Analysis Code coverage analysis is the process of: Finding areas of a program not exercised by a set of test cases Creating additional test cases to increase coverage Determining a quantitative measure of code coverage, which is (believed to be) a predictor of code quality Code coverage analyzers automate this process Additional aspect of code coverage analysis: Identifying redundant test cases that do not increase coverage

11 Main Classes of Test Adequacy Criteria Control Flow Criteria: Statement, decision (branch), condition, and path coverage are examples of control flow criteria They rely solely on syntactic characteristics of the program (ignoring the semantics of the program computation) Data Flow Criteria: Require the execution of path segments that connect parts of the code that are intimately connected by the flow of data

12 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Data-Flow Testing Loop Testing Fault-Based Testing (Mutation Testing)

13 Overview of Control Flow Criteria s 1 c 2 d 3 d 1 d 2 d s 6 3 d c 7 d 5 c 14 3 d 8 d 9 c 1 d 10 c 4 d 4 s 4 d 5 d s 12 2 d 13 d 11 If c1 then if c2 then s1 s2 while c3 do s3 else if c4 then repeat s4 until c5 endif endif

14 Overview of Control Flow Criteria s 1 c 2 d 3 d 1 d 2 d s 6 3 d c 7 d 5 c 14 3 d 8 d 9 c 1 d 10 c 4 d 4 s 4 d 5 d s 12 2 d 13 d 11 Statement Coverage Decision (or Branch) Coverage Condition Coverage Condition/Decision Coverage Multiple Condition Coverage Modified Condition Decision Coverage (MC/DC) Simple Paths Linearly Independent Paths Linear Code Sequence and Jump (LCSAJ) Visit-Each Loop All Paths

15 Life Insurance Example bool AccClient(agetype age; gndrtype gender) bool accept if(gender=female) accept := age < 85; else accept := age < 80; return accept d2 d1 c2 d3 s1 d4 c1 d5 c3 d6 s2 d8 d7

16 Statement Coverage Execute each statement at least once Tools are used to monitor execution A possible concern may be: Dead code

17 Statement Coverage bool AccClient(agetype age; gndrtype gender) bool accept if(gender=female) accept := age < 85; else accept := age < 80; return accept AccClient(83, female)->accept AccClient(83, male) ->reject c1 d2 c2 s1 d1 d4 d3 d6 d5 c3 s2 d8 d7

18 Condition Coverage Test all possible conditions in a program A condition in a program may contain: Boolean operators and variables Relational operators Arithmetic expressions.

19 (Simple) Condition Coverage bool AccClient(agetype age; gndrtype gender) bool accept if(gender=female) accept := age < 85; else accept := age < 80; return accept AccClient(83, female)->accept AccClient(83, male) ->reject c1 d2 c2 s1 d1 d4 d3 d6 d5 c3 s2 d8 d7

20 Decision (Branch) Coverage /1 bool AccClient(agetype age; gndrtype gender) bool accept if(gender=female) accept := age < 85; true else accept := age < 80; return accept AccClient(83, female)->accept AccClient(83, male) ->reject c1 d2 c2 s1 d1 d4 d3 d6 d5 c3 s2 d8 d7

21 Decision (Branch) Coverage /2 bool AccClient(agetype age; gndrtype gender) bool accept if(gender=female) accept := age < 85; else accept := age < 80; false return accept AccClient(83, female)->accept AccClient(83, male) ->reject c1 d2 c2 s1 d1 d4 d3 d6 d5 c3 s2 d8 d7

22 Decision (Branch) Coverage /3 bool AccClient(agetype age; gndrtype gender) bool accept if(gender=female) accept := age < 85; true else accept := age < 80; false return accept AccClient(83, female)->accept AccClient(83, male) ->reject c1 d2 c2 s1 d1 d4 d3 d6 d5 c3 s2 d8 d7

23 Advanced Condition Coverage Condition/Decision Coverage (C/DC) as DC plus: every condition in each decision is tested in each possible outcome Modified Condition/Decision coverage (MC/DC) as above plus, every condition shown to independently affect a decision outcome (by varying that condition only) a condition independently affects a decision when, by flipping that condition and holding all the others fixed, the decision changes this criterion was created at Boeing and is required for aviation software according to RCTA/DO-178B Multiple-Condition Coverage (M-CC) all possible combinations of conditions within each decision taken

24 CC, DC, C/DC, M-CC, MC/DC Examples If (A<10 and B>250) then Condition: (TT) A = 2; B = 300 (True) Decision: (TT) A = 2; B = 300 (True) (FT) A = 12; B = 300 (False) Condition/Decision: (TT) A = 2; B = 300 (True) (FF) A = 12; B = 200 (False) Multiple Condition: (TT) A = 2; B = 300 (True) (FT) A = 12; B = 300 (False) (TF) A = 2; B = 200 (False) (FF) A = 12; B = 200 (False) Modified Condition/Decision: (TT) A = 2; B = 300 (True) (FT) A = 12; B = 300 (False) (TF) A = 2; B = 200 (False)

25 Independent Path Coverage McCabe cyclomatic complexity estimates number of test cases needed The number of independent paths needed to cover all paths at least once in a program Visualize by drawing a flow graph CC = #(edges) #(nodes) + 2 CC = #(decisions) + 1 while-loop if-then-else case-of

26 Independent Paths Coverage Example Independent Paths Coverage Requires that a minimum set of linearly independent paths through the control flow-graph be executed This test strategy is the rationale for McCabe s cyclomatic number (McCabe 1976) which is equal to the number of test cases required to satisfy the strategy. Cyclomatic Complexity = = 6

27 Independent Paths Coverage Example Edges: Path1: Path2: Path3: Path4: Path5: Path6:

28 Independent Paths Coverage Example Edges: Why no need to cover Path7??? Path7: Because it equals Path1+Path2-Path3!!! Path1: Path2: P1+P2: Path3: P3:

29 How to find Test Cases? Requirements yielding an outcome at each predicate node contained in a path Consider all requirements together Guess a value that will satisfy these requirements --- Can we improve on this?

30 Symbolic Execution How to find test inputs to exercise a path? Need to make a choice at each predicate node Give a symbolic value to each variable Walk the path collecting requirements on symbolic input Then have a set of (in)equalities to solve Example: Find test cases for each path by symbolic execution

31 Program CFG Program finds the smallest factor of a prime decomposition of a given number smallest(int p) (*p>2*) { int q = 2; while(p mod q > 0 AND q < sqrt p) do q := q+1 ; if (p mod q = 0) then print(q, is factor ) else print(p, is prime ) ; } p. Cyclomatic Complexity: v(g) = = = 3 Sets of linearly independent paths: Example Set 1: Example Set 2:

32 Symbolic Execution Tree Solve path conditions Test input! p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) p: x PC: x>2 p: x q: 2 PC: x> PC: path condition p: x q: 2 PC: x > 2 and 2 < sqrt(x) and x <> 2*n p: x is prime q: 2 q: 3 PC: x > 2 and (2 sqrt(x) and x = 2*n + 1) p: x q: 2 and factor 4 2*n + 1 PC: x > 2 and n = 1 x = 3 x = 2*n

33 Control-Flow Coverage Relationships Subsumption: a criterion C1 subsumes another criterion C2, if any test set {T} that satisfies C1 also satisfies C2 Multiple Condition MC/DC C/DC Condition Decision Complete Path Linearly Indep. Path Statement

34 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Data-Flow Testing Loop Testing Fault-Based Testing (Mutation Testing)

35 Data Flow Testing Identifies paths in the program that go from the assignment of a value to a variable to the use of such variable, to make sure that the variable is properly used. X:=14;.. Y:= X-3;

36 Data Flow Testing Definitions Def assigned or changed Uses utilized (not changed) C-use (Computation) e.g. right-hand side of an assignment, an index of an array, parameter of a function. P-use (Predicate) branching the execution flow, e.g. in an if statement, while statement, for statement. Example: All def-use paths (DU) requires that each DU chain is covered at least once

37 Data Flow Testing Example [1] bool AccClient(agetype age; gndrtype gender) [2] bool accept [3] if(gender=female) [4] accept := age < 85; [5] else [6] accept := age < 80; [7] return accept Considering age, there are two DU paths: (a)[1]-[4] (b)[1]-[6] Test case conditions: AccClient(*, female)-> * AccClient(*, male)-> *

38 Data Flow Testing Example [1] bool AccClient(agetype age; gndrtype gender) [2] bool accept [3] if(gender=female) [4] accept := age < 85; [5] else [6] accept := age < 80; [7] return accept Considering gender, there is one DU path: (a) [1]-[3] Test case conditions: AccClient(*, *)-> *

39 Data Flow Criteria All c-uses All defs All p-uses Weaker All c-uses, some p-uses All p-uses, some c-uses All uses All def-use paths Stronger # tests

40 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Data-Flow Testing Loop Testing Fault-Based Testing (Mutation Testing)

41 Loop Testing simple loop nested loops concatenated loops unstructured loops

42 Loop Testing: Simple Loops Minimum conditions - simple loops 1. skip the loop entirely 2. only one pass through the loop 3. two passes through the loop 4. m passes through the loop m < n 5. (n-1), n, and (n+1) passes through the loop where n is the maximum number of allowable passes

43 Nested Loops Extend simple loop testing Reduce the number of tests: start at the innermost loop; set all other loops to minimum values conduct simple loop test; add out of range or excluded values work outwards while keeping inner nested loops to typical values continue until all loops have been tested

44 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Data-Flow Testing Loop Testing Fault-Based Testing (Mutation Testing)

45 Let s count marbles... a lot of marbles Suppose we have a big bowl of marbles How can we estimate how many? I don t want to count every marble individually I have a bag of 100 other marbles of the same size, but a different color What if I mix them?

46 Estimating marbles... I mix 100 black marbles into the bowl Stir well... I draw out 100 marbles at random 20 of them are black How many marbles were in the bowl to begin with? 400

47 Estimating Test Suite Quality Now, instead of a bowl of marbles, I have a program with faults (bugs) I add 100 new faults Assume they are exactly like real faults in every way I make 100 copies of my program, each with one of my 100 new faults I run my test suite on the programs with seeded faults and the tests reveal 20 of the faults (the other 80 program copies do not fail) What can I infer about my test suite?

48 Basic Assumptions We d like to judge effectiveness of a test suite in finding real faults, by measuring how well it finds seeded fake faults. Valid to the extent that the seeded bugs are representative of real bugs Not necessarily identical (e.g., black marbles are not identical to clear marbles); but the differences should not affect the selection E.g., if I mix metal ball bearings into the marbles, and pull them out with a magnet, I don t learn anything about how many marbles were in the bowl

49 Mutation Testing Assumptions Competent programmer hypothesis: Programs are nearly correct Real faults are small variations from the correct program => Mutants are reasonable models of real faulty programs Coupling effect hypothesis: Tests that find simple faults also find more complex faults Even if mutants are not perfect representatives of real faults, a test suite that kills mutants is good at finding real faults too

50 Fault-Based Testing (Mutation Testing) Terminology Mutant new version of the program with a small deviation (=fault) from the original version Killed mutant new version detected by the test suite Live mutant new version not detected by the test suite

51 Mutation Testing A method for evaluation of test suite effectiveness not for designing test cases! 1. Take a program and test data generated for that program 2. Create a number of similar programs (mutants), each differing from the original in a small way 3. The original test data are then run through the mutants 4. If tests detect all changes in mutants, then the mutants are dead and the test suite adequate Otherwise: Create more test cases and iterate 2-4 until a sufficiently high number of mutants is killed

52 Example Mutation Operations Change relational operator (<,>, ) Change logical operator (II, &, ) Change arithmetic operator (*, +, -, ) Change constant name / value Change variable name / initialisation Change (or even delete) statement

53 Example Mutants if (a b) c = a + b; else c = 0; if (a b) c = a + b; else c = 0; if (a && b) c = a + b; else c = 0; if (a b) c = a * b; else c = 0;

54 Types of Mutants Stillborn mutants: Syntactically incorrect killed by compiler, e.g., x = a ++ b Trivial mutants: Killed by almost any test case Equivalent mutant: Always acts in the same behaviour as the original program, e.g., x = a + b and x = a (-b) None of the above are interesting from a mutation testing perspective Those mutants are interesting which behave differently than the original program, and we do not (yet) have test cases to identify them (i.e., to cover those specific changes)

55 Equivalent Mutants if (a == 2 && b == 2) c = a + b; else c = 0; int index=0; while (...) {...; index++; if (index==10) break; } if (a == 2 && b == 2) c = a * b; else c = 0; int index=0; while (...) {...; index++; if (index>=10) break; }

56 Program Example nbrs = new int[range] public int max(int[] a) { int imax := 0; for (int i = 1; i <= range; i++) if a[i] > a[imax] imax:= i; return imax; a[0] a[1] a[2] max TC TC TC }

57 Variable Name Mutant nbrs = new int[range] public int max(int[] a) { int imax := 0; for (int i = 1; i <= range; i++) if i > a[imax] imax:= i; return imax; a[0] a[1] a[2] max TC TC TC }

58 Relational Operator Mutant nbrs = new int[range] public int max(int[] a) { int imax := 0; for (int i = 1; i <= range; i++) if a[i] >= a[imax] imax:= i; return imax; a[0] a[1] a[2] max TC TC TC } Need a test case with two identical max entries in a[.], e.g., (1, 3, 3)

59 Variable Operator Mutant nbrs = new int[range] public int max(int[] a) { int imax := 0; for (int i = 0; i < range; i++) if a[i] > a[imax] imax:= i; return imax; a[0] a[1] a[2] max TC TC TC } Need a test case detecting wrong loop counting

60 In real life... Fault-based testing is a widely used in semiconductor manufacturing With good fault models of typical manufacturing faults, e.g., stuck-at-one for a transistor But fault-based testing for design errors is more challenging (as in software) Mutation testing is not widely used in software industry But plays a role in software testing research, to compare effectiveness of testing techniques Some use of fault models to design test cases is important and widely practiced

61 Why is white-box testing not enough? Missing features Missing code Different states of the software Infinite amount of different paths through the software Different paths can reveal different defects Variations of perspectives Control flow/data flow Input/Output behaviour Test data generation Quality attributes Performance Robustness Reliability Usability

62 Recommended Textbook Exercises Chapter 5 2, 5, 6, 9, 10, 11, 14

63 Next Week Lecture 4: Static Testing (Inspection) and Defect Estimation Lab 3: White-Box Testing In addition to do: Continue working on project Read textbook chapter 5 (available via OIS)

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 03: White-Box Testing (Textbook Ch. 5) Dietmar Pfahl Spring 2016 email: dietmar.pfahl@ut.ee Lecture Chapter 5 White-box testing techniques (Lab 3) Structure of Lecture

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 03: White-Box Testing (Textbook Ch. 5) Dietmar Pfahl Spring 2017 email: dietmar.pfahl@ut.ee Lecture Chapter 5 White-box testing techniques (Lab 3) Structure of Lecture

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 04: White-Box Testing (advanced) Part1 Dietmar Pfahl Spring 2018 email: dietmar.pfahl@ut.ee White-Box Testing Techniques Control-Flow Testing Data-Flow Testing Mutation

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Basic Black-Box and White-Box Testing Techniques (Textbook Ch. 4 & 5) Spring 2018 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 2 Black-Box vs.

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Basic Black-Box and White-Box Testing Techniques (Textbook Ch. 4 & 5) Spring 2018 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 2 Black-Box vs.

More information

MTAT Software Engineering

MTAT Software Engineering MTAT.03.094 Software Engineering Lecture 10: Verification and Validation Dietmar Pfahl Fall 2013 email: dietmar.pfahl@ut.ee Schedule of Lectures Week 01: Introduction to SE Week 02: Requirements Engineering

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 04: Static Analysis (Inspection) and Defect Estimation, Mutation Testing (Textbook Ch. 10 & 12) Spring 2015 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture

More information

MTAT Software Engineering

MTAT Software Engineering MTAT.03.094 Software Engineering Lecture 11: Verification and Validation (Part 2) Dietmar Pfahl Fall 2015 email: dietmar.pfahl@ut.ee Exam Registration Status as of Nov 19 Exam 1: Friday, 08-Jan-2015, 14:15-16:15,

More information

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives Software Testing Fundamentals Software Testing Techniques Peter Lo Software Testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding.

More information

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton Lecture 26: Testing Software Engineering ITCS 3155 Fall 2008 Dr. Jamie Payton Department of Computer Science University of North Carolina at Charlotte Dec. 9, 2008 Verification vs validation Verification:

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 Today CS 52 Theory and Practice of Software Engineering Fall 218 Software testing October 11, 218 Introduction to software testing Blackbox vs. whitebox testing Unit testing (vs. integration vs. system

More information

White-Box Testing Techniques

White-Box Testing Techniques T-76.5613 Software Testing and Quality Assurance Lecture 3, 18.9.2006 White-Box Testing Techniques SoberIT Content What are white-box testing techniques Control flow testing Statement coverage Branch coverage

More information

Introduction to Software Engineering

Introduction to Software Engineering Introduction to Software Engineering (CS350) Lecture 17 Jongmoon Baik Testing Conventional Applications 2 Testability Operability it operates cleanly Observability the results of each test case are readily

More information

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development Reveal faults Goals of testing Correctness Reliability Usability Robustness Performance Top-down/Bottom-up Bottom-up Lowest level modules tested first Don t depend on any other modules Driver Auxiliary

More information

Subject Software Testing Structural Testing

Subject Software Testing Structural Testing Subject Software Testing Structural Testing Objective: 1. Understand Concept of structural testing 2. How structural (code-based or glass-box) testing complements functional (black-box) testing 3. Recognize

More information

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Structural Testing (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Learning objectives Understand rationale for structural testing How structural (code-based or glass-box) testing complements functional

More information

Introduction to Software Testing Chapter 5.1 Syntax-based Testing

Introduction to Software Testing Chapter 5.1 Syntax-based Testing Introduction to Software Testing Chapter 5.1 Syntax-based Testing Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/ softwaretest/ Ch. 5 : Syntax Coverage Four Structures for Modeling Software Graphs

More information

Darshan Institute of Engineering & Technology for Diploma Studies

Darshan Institute of Engineering & Technology for Diploma Studies CODING Good software development organizations normally require their programmers to follow some welldefined and standard style of coding called coding standards. Most software development organizations

More information

Aerospace Software Engineering

Aerospace Software Engineering 16.35 Aerospace Software Engineering Verification & Validation Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT Would You...... trust a completely-automated nuclear power plant?... trust a completely-automated

More information

Part I: Preliminaries 24

Part I: Preliminaries 24 Contents Preface......................................... 15 Acknowledgements................................... 22 Part I: Preliminaries 24 1. Basics of Software Testing 25 1.1. Humans, errors, and testing.............................

More information

Test Case Specifications and Test adequacy. Research Methods - Barbara Russo SwSE - Software and Systems Engineering

Test Case Specifications and Test adequacy. Research Methods - Barbara Russo SwSE - Software and Systems Engineering Test Case Specifications and Test adequacy Research Methods - Barbara Russo SwSE - Software and Systems Engineering 1 Test Case Selection How do we create tests? Test are defined in terms of their adequacy

More information

6. Test-Adequacy. Assessment Using Control Flow and Data Flow. Andrea Polini

6. Test-Adequacy. Assessment Using Control Flow and Data Flow. Andrea Polini 6. Test-Adequacy Assessment Using Control Flow and Data Flow Andrea Polini Software Engineering II Software Testing MSc in Computer Science University of Camerino (Software Engineering II Software Testing)

More information

INTRODUCTION TO SOFTWARE ENGINEERING

INTRODUCTION TO SOFTWARE ENGINEERING INTRODUCTION TO SOFTWARE ENGINEERING Structural Testing d_sinnig@cs.concordia.ca Department for Computer Science and Software Engineering Introduction Testing is simple all a tester needs to do is find

More information

PESIT Bangalore South Campus SOLUTION

PESIT Bangalore South Campus SOLUTION USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Information Science & Engineering INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40

More information

Chapter 14 Testing Tactics

Chapter 14 Testing Tactics Chapter 14 Testing Tactics Moonzoo Kim CS Division of EECS Dept. KAIST moonzoo@cs.kaist.ac.kr http://pswlab.kaist.ac.kr/courses/cs550-07 Spring 2007 1 Overview of Ch14. Testing Tactics 14.1 Software Testing

More information

White Box Testing III

White Box Testing III White Box Testing III Outline Today we continue our look at white box testing methods, with mutation testing We will look at : definition and role of mutation testing what is a mutation? how is mutation

More information

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M. F. Tip and M. Weintraub STRUCTURAL TESTING AKA White Box Testing Thanks go to Andreas Zeller for allowing incorporation of his materials STRUCTURAL TESTING Testing based on the structure of the code Test

More information

Software Quality Assurance. David Janzen

Software Quality Assurance. David Janzen Software Quality Assurance David Janzen What is quality? Crosby: Conformance to requirements Issues: who establishes requirements? implicit requirements Juran: Fitness for intended use Issues: Who defines

More information

What is Mutation Testing? Mutation Testing. Test Case Adequacy. Mutation Testing. Mutant Programs. Example Mutation

What is Mutation Testing? Mutation Testing. Test Case Adequacy. Mutation Testing. Mutant Programs. Example Mutation What is Mutation Testing? Mutation Testing Breaking the application to test it n Mutation Testing is a testing technique that focuses on measuring the adequacy of test cases n Mutation Testing is NOT a

More information

Testing: Coverage and Structural Coverage

Testing: Coverage and Structural Coverage Testing: Coverage and Structural Coverage Testing, Quality Assurance, and Maintenance Winter 2017 Prof. Arie Gurfinkel based on slides by Prof. Marsha Chechik and Prof. Lin Tan How would you test this

More information

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015 Test Oracles and Mutation Testing CSCE 740 - Lecture 23-11/18/2015 Software Testing - Back to the Basics Tests are sequences of stimuli and observations. We care about input and output. (I 1 O 1 ) (I 2

More information

UNIT-4 Black Box & White Box Testing

UNIT-4 Black Box & White Box Testing Black Box & White Box Testing Black Box Testing (Functional testing) o Equivalence Partitioning o Boundary Value Analysis o Cause Effect Graphing White Box Testing (Structural testing) o Coverage Testing

More information

Using the code to measure test adequacy (and derive test cases) Structural Testing

Using the code to measure test adequacy (and derive test cases) Structural Testing Using the code to measure test adequacy (and derive test cases) Structural Testing Objectives To describe a second approach to testing which is geared to find program defects To explain the use of program

More information

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M. F. Tip and M. Weintraub STRUCTURAL TESTING AKA White Box Testing Thanks go to Andreas Zeller for allowing incorporation of his materials STRUCTURAL TESTING Testing based on the structure of the code Test

More information

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013! Testing Prof. Leon Osterweil CS 520/620 Spring 2013 Relations and Analysis A software product consists of A collection of (types of) artifacts Related to each other by myriad Relations The relations are

More information

CMPSCI 521/621 Homework 2 Solutions

CMPSCI 521/621 Homework 2 Solutions CMPSCI 521/621 Homework 2 Solutions Problem 1 Direct data dependencies: 3 is directly data dependent on 1 and 5 5 is directly data dependent on 1,3, and 5 7 is directly data dependent on 1,3, and 5 Note,

More information

UNIT-4 Black Box & White Box Testing

UNIT-4 Black Box & White Box Testing Black Box & White Box Testing Black Box Testing (Functional testing) o Equivalence Partitioning o Boundary Value Analysis o Cause Effect Graphing White Box Testing (Structural testing) o Coverage Testing

More information

Software Testing. 1. Testing is the process of demonstrating that errors are not present.

Software Testing. 1. Testing is the process of demonstrating that errors are not present. What is Testing? Software Testing Many people understand many definitions of testing :. Testing is the process of demonstrating that errors are not present.. The purpose of testing is to show that a program

More information

Lecture 18: Structure-based Testing

Lecture 18: Structure-based Testing Test Case First Strategy White box testing: Statement Coverage Branch Coverage Condition Coverage Data Path Coverage Lecture 18: Structure-based Testing Testing with good and bad data Testing Object Oriented

More information

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing. Overview CS 619 Introduction to OO Design and Development ing! Preliminaries! All sorts of test techniques! Comparison of test techniques! Software reliability Fall 2012! Main issues: There are a great

More information

Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt

Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt Partly based on slides from Peter Müller, ETH Zurich 1 Warm-up Quiz What does the following code print?

More information

Fault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13

Fault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13 Fault-based testing Automated testing and verification J.P. Galeotti - Alessandra Gorla slides by Gordon Fraser How good are my tests? How good are my tests? Path testing Boundary interior testing LCSAJ

More information

Second assignment came out Monday evening. Find defects in Hnefetafl rules written by your classmates. Topic: Code Inspection and Testing

Second assignment came out Monday evening. Find defects in Hnefetafl rules written by your classmates. Topic: Code Inspection and Testing Announcements Second assignment came out Monday evening Topic: Code Inspection and Testing Find defects in Hnefetafl rules written by your classmates Compare inspection, coverage testing, random testing,

More information

Försättsblad till skriftlig tentamen vid Linköpings Universitet

Försättsblad till skriftlig tentamen vid Linköpings Universitet Försättsblad till skriftlig tentamen vid Linköpings Universitet Datum för tentamen 2014-06-03 Sal??? Tid 14-18 Kurskod Provkod Kursnamn/benämning TDDD04 TEN1 Programvarutestning Institution IDA Antal uppgifter

More information

Introduction to Dynamic Analysis

Introduction to Dynamic Analysis Introduction to Dynamic Analysis Reading assignment Gary T. Leavens, Yoonsik Cheon, "Design by Contract with JML," draft paper, http://www.eecs.ucf.edu/~leavens/jml//jmldbc.pdf G. Kudrjavets, N. Nagappan,

More information

Introduction to Software Testing Chapter 3, Sec# 1 & 2 Logic Coverage

Introduction to Software Testing Chapter 3, Sec# 1 & 2 Logic Coverage Introduction to Software Testing Chapter 3, Sec# 1 & 2 Logic Coverage Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/soft waretest/ Ch. 3 : Logic Coverage Four Structures for Modeling Software

More information

Software Testing. Testing: Our Experiences

Software Testing. Testing: Our Experiences Software Testing Testing: Our Experiences Test Case Software to be tested Output 1 Test Case Generation When to Stop? Test Case Software to be tested Verification Output No Enough? Test Coverage Yes A

More information

MSc Software Testing MSc Prófun hugbúnaðar

MSc Software Testing MSc Prófun hugbúnaðar MSc Software Testing MSc Prófun hugbúnaðar Fyrirlestrar 7 & 8 Structural Testing White-box tests. 29/8/27 Dr Andy Brooks 1 Case Study Dæmisaga Reference Structural Testing of Programs, A Survey, A A Omar

More information

LECTURE 11 TEST DESIGN TECHNIQUES IV

LECTURE 11 TEST DESIGN TECHNIQUES IV Code Coverage Testing 1. Statement coverage testing 2. Branch coverage testing 3. Conditional coverage testing LECTURE 11 TEST DESIGN TECHNIQUES IV Code Complexity Testing 1. Cyclomatic Complexity s V

More information

Testing & Symbolic Execution

Testing & Symbolic Execution Testing & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed Behavior

More information

MSc Software Testing and Maintenance MSc Prófun og viðhald hugbúnaðar

MSc Software Testing and Maintenance MSc Prófun og viðhald hugbúnaðar MSc Software Testing and Maintenance MSc Prófun og viðhald hugbúnaðar Fyrirlestrar 31 & 32 Structural Testing White-box tests. 27/1/25 Dr Andy Brooks 1 Case Study Dæmisaga Reference Structural Testing

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 03: Black-Box Testing (advanced - Part 1) Dietmar Pfahl Spring 2018 email: dietmar.pfahl@ut.ee Black-Box vs. White-Box Specification-based Testing: Test against specification

More information

Software Testing ETSN00

Software Testing ETSN00 Software Testing ETSN00 http://cs.lth.se/etsn20 Chapter 6, 9.2-9.6 Prof. Per Runeson Lecture Chapter 6: Domain Testing Chapter 9.2-9.6: Functional Testing Black-bo testing techniques (Lab 2) Types of Testing

More information

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake Sample ISTQB examination 1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake 2 Regression testing should

More information

Testing: Coverage and Structural Coverage

Testing: Coverage and Structural Coverage Testing: Coverage and Structural Coverage Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel based on slides by Prof. Marsha Chechik and Prof. Lin Tan How would you test this

More information

Announcements. Testing. Announcements. Announcements

Announcements. Testing. Announcements. Announcements Announcements Testing HW0, HW1, and HW2 are graded Grades and feedback in Submitty Email us at csci2600@cs.lists.rpi.edu Use Submitty discussion board! HW0, HW1, and HW2, Quiz 1 and 2 Grades in Submitty

More information

Written exam TDDD04 Software Testing

Written exam TDDD04 Software Testing LiTH, Linköpings tekniska högskola IDA, Institutionen för datavetenskap Ola Leifler Written exam TDDD04 Software Testing 2016-10-26 Permissible aids Dictionary (printed, NOT electronic) Teacher on duty

More information

White-Box Testing Techniques III

White-Box Testing Techniques III White-Box Testing Techniques III Software Testing and Verification Lecture 9 Prepared by Stephen M. Thebaut, Ph.D. University of Florida White-Box Testing Topics Logic coverage (lecture I) Dataflow coverage

More information

Software Quality Assurance Dynamic Test

Software Quality Assurance Dynamic Test Software Quality Assurance Dynamic Test Contents Properties and goals Structural testing Control flow testing Data flow testing Functional test Diversified test 2 Properties and Goals Properties of dynamic

More information

EECS 481 Software Engineering Exam #1. You have 1 hour and 20 minutes to work on the exam.

EECS 481 Software Engineering Exam #1. You have 1 hour and 20 minutes to work on the exam. EECS 481 Software Engineering Exam #1 Write your name and UM uniqname on the exam. There are ten (10) pages in this exam (including this one) and seven (7) questions, each with multiple parts. Some questions

More information

Lecture 17: Testing Strategies. Developer Testing

Lecture 17: Testing Strategies. Developer Testing Lecture 17: Testing Strategies Structural Coverage Strategies (White box testing): Statement Coverage Branch Coverage Condition Coverage Data Path Coverage Function Coverage Strategies (Black box testing):

More information

Software Testing part II (white box) Lecturer: Giuseppe Santucci

Software Testing part II (white box) Lecturer: Giuseppe Santucci Software Testing part II (white box) Lecturer: Giuseppe Santucci 4. White box testing White-box (or Glass-box) testing: general characteristics Statement coverage Decision coverage Condition coverage Decision

More information

Software Engineering Software Testing Techniques

Software Engineering Software Testing Techniques Software Engineering Software Testing Techniques 1 Testability Operability it it operates cleanly Observability the the results of each test case are readily observed Controllability the the degree to

More information

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box From Pressman, Software Engineering a practitioner s approach, Chapter 14 and Pezze + Young, Software Testing and Analysis, Chapters 12-13 Structural Testing Software Engineering Andreas Zeller Saarland

More information

What is Structural Testing?

What is Structural Testing? Structural Testing What is Structural Testing? Based on Source Code Examine the internal structure of the program Test cases are derived from an examination of program s logic Do not pay any attention

More information

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 13 Path Testing Welcome to this session and we will discuss about path

More information

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful

More information

Getting those Bugs Out --Software Testing

Getting those Bugs Out --Software Testing 1 1 Getting those Bugs Out --Software Testing 1. Issues in software testing and reliability 2. Test sets, test selection criteria, and ideal test sets. 3. Defect Testing 3.1 Black Box Testing 3.2 White

More information

Advanced Software Testing Understanding Code Coverage

Advanced Software Testing Understanding Code Coverage Advanced Software Testing Understanding Code Coverage Advanced Software Testing A series of webinars, this one excerpted from Advanced Software Testing: V3, a book for technical test analysts, programmers,

More information

Testing: (A Little) Logic Coverage

Testing: (A Little) Logic Coverage Testing: (A Little) Logic Coverage Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel Why Logic Coverage? MC/DC (Modified condition/decision coverage) MC/DC is required by the

More information

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering Chapter 11, Testing Using UML, Patterns, and Java Object-Oriented Software Engineering Outline Terminology Types of errors Dealing with errors Quality assurance vs Testing Component Testing! Unit testing!

More information

Software Testing. Massimo Felici IF

Software Testing. Massimo Felici IF Software Testing Massimo Felici IF-3.46 0131 650 5899 mfelici@staffmail.ed.ac.uk What is Software Testing? Software Testing is the design and implementation of a special kind of software system: one that

More information

Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University

Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University Software Testing Minsoo Ryu Hanyang University Topics covered 1. Testing Goals and Principles 2. Testing Process 3. Testing Strategies Component testing Integration testing Validation/system testing 4.

More information

Testing Tactics. Structural Testing. Why Structural? Why Structural? Functional black box. Structural white box. Functional black box

Testing Tactics. Structural Testing. Why Structural? Why Structural? Functional black box. Structural white box. Functional black box ing Tactics Structural ing Functional black box Structural white box Software Engineering Andreas Zeller Saarland University s based on spec covers as much specified behavior as possible s based on code

More information

What s Next INF 117 Project in Software Engineering

What s Next INF 117 Project in Software Engineering What s Next IN 117 Project in Software Engineering Lecture Notes - Spring Quarter, 2008 Michele Rousseau Set 8 - esting Set 8 - esting 2 Announcements k Drop Boxes We will use drop boxes for the remainder

More information

Overview Graph Coverage Criteria

Overview Graph Coverage Criteria Overview Graph Coverage Criteria Graph Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Applied to Applied to Source FSMs Applied to Specs DNF Source Specs Source Models Design

More information

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Overview, Test specification and cases, Adequacy criteria, comparing criteria, Overview of test execution, From test case specification

More information

Darshan Institute of Engineering & Technology Unit : 9

Darshan Institute of Engineering & Technology Unit : 9 1) Explain software testing strategy for conventional software architecture. Draw the spiral diagram showing testing strategies with phases of software development. Software Testing: Once source code has

More information

Class 17. Discussion. Mutation analysis and testing. Problem Set 7 discuss Readings

Class 17. Discussion. Mutation analysis and testing. Problem Set 7 discuss Readings Class 17 Questions/comments Graders for Problem Set 6 (4); Graders for Problem set 7 (2-3) (solutions for all); will be posted on T-square Regression testing, Instrumentation Final project presentations:

More information

COS 320. Compiling Techniques

COS 320. Compiling Techniques Topic 5: Types COS 320 Compiling Techniques Princeton University Spring 2016 Lennart Beringer 1 Types: potential benefits (I) 2 For programmers: help to eliminate common programming mistakes, particularly

More information

Other criteria focus on single elements.

Other criteria focus on single elements. Path Coverage Other criteria focus on single elements. However, all tests execute a sequence of elements - a path through the program. Combination of elements matters - interaction sequences are the root

More information

Lecture 14: Chapter 18!

Lecture 14: Chapter 18! Lecture 14: Chapter 18! Testing Conventional Applications! Slide Set to accompany Software Engineering: A Practitioner s Approach, 7/e " by Roger S. Pressman Slides copyright 1996, 2001, 2005, 2009 by

More information

Testing, Fuzzing, & Symbolic Execution

Testing, Fuzzing, & Symbolic Execution Testing, Fuzzing, & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed

More information

Modern Methods in Software Engineering. Testing.

Modern Methods in Software Engineering. Testing. Modern Methods in Software Engineering Testing www.imit.kth.se/courses/2g1522 Literature used Text book Chapter 11 Introduction Content Terminology Types of errors Dealing with errors Component Testing

More information

Software Verification and Validation. Prof. Lionel Briand Ph.D., IEEE Fellow

Software Verification and Validation. Prof. Lionel Briand Ph.D., IEEE Fellow Software Verification and Validation Prof. Lionel Briand Ph.D., IEEE Fellow 1 White-Box Testing 2 White-Box vs. Black-BoxTesting: Reminder Software Representation (Model) Associated Criteria Test cases

More information

EECS 481 Software Engineering Exam #1. You have 1 hour and 20 minutes to work on the exam.

EECS 481 Software Engineering Exam #1. You have 1 hour and 20 minutes to work on the exam. EECS 481 Software Engineering Exam #1 Write your name and UM uniqname on the exam. There are ten (10) pages in this exam (including this one) and seven (7) questions, each with multiple parts. Some questions

More information

An Introduction to Systematic Software Testing. Robert France CSU

An Introduction to Systematic Software Testing. Robert France CSU An Introduction to Systematic Software Testing Robert France CSU Why do we need to systematically test software? Poor quality products can Inconvenience direct and indirect users Result in severe financial

More information

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING 1 CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING Outline 2 Quiz Black-Box Testing Equivalence Class Testing (Equivalence Partitioning) Boundary value analysis Decision Table Testing 1 3 Quiz - 1

More information

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process Verification and Validation Assuring that a software system meets a user s needs Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapters 19,20 Slide 1

More information

SFWR ENG 3S03: Software Testing

SFWR ENG 3S03: Software Testing (Slide 1 of 52) Dr. Ridha Khedri Department of Computing and Software, McMaster University Canada L8S 4L7, Hamilton, Ontario Acknowledgments: Material based on [?] Techniques (Slide 2 of 52) 1 2 3 4 Empirical

More information

People tell me that testing is

People tell me that testing is Software Testing Mark Micallef mark.micallef@um.edu.mt People tell me that testing is Boring Not for developers A second class activity Not necessary because they are very good coders 1 What is quality?

More information

Testing. Lydie du Bousquet, Ioannis Parissis. TAROT Summer School July (TAROT 2009)

Testing. Lydie du Bousquet, Ioannis Parissis. TAROT Summer School July (TAROT 2009) Testing TAROT Summer School Lustre/SCADE programs 2009 - July 6-10 Lydie du Bousquet, Ioannis Parissis 1 (TAROT 2009) Synchrone Scade/Lustre Siesta Issues 2 Synchronous / safety-critical software control/command

More information

MONIKA HEINER.

MONIKA HEINER. LESSON 1 testing, intro 1 / 25 SOFTWARE TESTING - STATE OF THE ART, METHODS, AND LIMITATIONS MONIKA HEINER monika.heiner@b-tu.de http://www.informatik.tu-cottbus.de PRELIMINARIES testing, intro 2 / 25

More information

Testing Methods: White Box Testing II

Testing Methods: White Box Testing II Testing Methods: White Box Testing II Outline Today we continue our look at white box testing with more code coverage methods, and a data coverage method We ll look at : - code coverage testing - decision

More information

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs. In this Lecture you will Learn: Testing in Software Development Process Examine the verification and validation activities in software development process stage by stage Introduce some basic concepts of

More information

Checking Multiple Conditions

Checking Multiple Conditions Checking Multiple Conditions Conditional code often relies on a value being between two other values Consider these conditions: Free shipping for orders over $25 10 items or less Children ages 3 to 11

More information

(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt

(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt Verification (See related materials in textbook.) Outline What are the goals of verification? What are the main approaches to verification? What kind of assurance do we get through testing? How can testing

More information

What is Mutation Testing?

What is Mutation Testing? What is Mutation Testing? The premise in mutation testing is that small changes are made in a module and then the original and mutant modules are compared. Similar idea to error seeding: introduce defects

More information

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan heory Lecture Plan 2 esting heory Lecture 8 Software Engineering DDC88/DDC93 autumn 28 Department of Computer and Information Science Linköping University, Sweden L - Course Introduction and Overview L2

More information

Program-based Mutation Testing

Program-based Mutation Testing Program-based Mutation Testing CS 4501 / 6501 Software Testing [Ammann and Offutt, Introduction to Software Testing, Ch. 9.2] 1 Applying Syntax-Based Testing to Programs Test requirements are derived from

More information