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) Dietmar Pfahl Spring

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

3 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Loop Testing Symbolic Execution Data-Flow Testing Lab 3

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 If-then-else There are many possible paths! 5 20 (~10 14 ) different paths loop < 20x Selective Testing

7 Selective Testing a selected path 2 Major Strategies Control flow testing Data flow testing

8 Code Coverage (Test Coverage) Definition: 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 suite) 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 For java: EclEmma (JaCoCo), Clover, etc. 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 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 (-> annotated control flow graph )

12 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Loop Testing Symbolic Execution Data-Flow Testing Lab 3

13 Control Flow Graph (CFG) MTAT / Lecture 03 / Dietmar Pfahl 2015

14 Control Flow Graph (CFG) empty Blocks (=Nodes): 4 Edges: 4 MTAT / Lecture 03 / Dietmar Pfahl 2015

15 Control Flow Graph (CFG) d 1 is a dummy node e 1 e 2 s 1 s 2 e 3 e 4 s 3 d 1 s 5 e 5 e 6 s 4 entry and exit nodes are dummy nodes e 7 e 8 s 6 Nodes: 8 Edges: 8 empty Blocks: 4 Edges: 4 MTAT / Lecture 03 / Dietmar Pfahl 2015

16 Control Flow Example s 1 d 2 e 3 e 1 e 2 e s 6 3 e d 7 e 5 d 14 3 e 8 e 9 d 1 e 10 d4 e 4 s 4 e 5 e s 12 2 e 13 e 11 If (d1) then { if (d2) then {s1} s2 while (d3) do {s3} } else { if (d4) then { repeat {s4} until (d5) } }

17 Control Flow Example CFG(t) d 1 e 1 e 2 CFG(f) If (d1) then { if (d2) then {s1} s2 If (d1) then { CFG(d1=true) while (d3) do {s3} } } else { else { if (d4) then { CFG(d1=false) repeat {s4} until (c5) } } } }

18 Control Flow Example CFG(t) d 1 e 1 e 2 CFG(f) If (d1) then { if (d2) then {s1} s2 If (d1) then { CFG(d1=true) while (d3) do {s3} } } else { else { if (d4) then { CFG(d1=false) repeat {s4} until (d5) } } } }

19 Control Flow Example CFG(if) d 1 e 1 e 2 d4 If (d1) then { if (d2) then {s1} s2 If (d1) then { CFG(if) s2 e 4 e 10 while (d3) do {s3} } CFG(while) } CFG (while) s 2 e 6 e 9 CFG (repeat) e 14 e 11 else { if (d4) then { repeat {s4} until (c5) } } else { if (d4) then { CFG(repeat) } }

20 Control Flow Example CFG(if) d 1 e 1 e 2 d4 If (d1) then { if (d2) then {s1} s2 If (d1) then { CFG(if) s2 e 4 e 10 while (d3) do {s3} } CFG(while) } CFG (while) s 2 e 6 e 9 CFG (repeat) e 14 e 11 else { if (d4) then { repeat {s4} until (d5) } } else { if (d4) then { CFG(repeat) } }

21 Control Flow Example s 1 d 2 e 3 e 1 e 2 e s 6 3 e d 7 e 5 d 14 3 e 8 e 9 d 1 e 10 d4 e 4 s 4 e 5 e s 12 2 e 13 e 11 If (d1) then { if (d2) then {s1} s2 while (d3) do {s3} } else { if (d4) then { repeat {s4} until (d5) } }

22 Overview of Control Flow Criteria s 1 s 3 d 2 e 3 d 1 e 1 e 2 e 10 d4 e 4 s 4 e 5 e s 12 2 e 13 e 6 e d 7 e 5 d 14 3 e 11 Decision (or Branch) Coverage all edges Condition Coverage Condition/Decision Coverage Multiple Condition Coverage Modified Condition Decision Coverage (MC/DC) Linearly Independent Paths Loop Testing Statement (or Block) Coverage all nodes e 8 e 9

23 Statement Coverage Execute each statement at least once Use tools to monitor execution More practice in Lab 3 A possible concern may be: Dead code

24 Life Insurance Example boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 In the following assume that the following preconditions have been checked: - Parameter gender is in {female, male} - Parameter age is integer and >= 18 E 5

25 Statement Coverage /1 boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 Test: AccClient(83, female)->accept AccClient(83, male)->reject E 5 0 %

26 Statement Coverage /2 boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 Test: AccClient(83, female)->true AccClient(83, male)->reject E 5 40 %

27 Statement Coverage /3 boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 Test: AccClient(83, female)->true AccClient(83, male)->false E 5 80 %

28 Statement Coverage /4 boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 Test: AccClient(83, female)->true AccClient(83, male)->false E 5 AccClient(25, male)->true 100 %

29 Same Test Suite but Incorrect Code in Life Insurance Example (1) 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 80) return(true); if (gender == male & age < 80) return(true); return(false); 1 failure d 1 = c 1 & c S 3 d 2 = c 3 & c 4 Test: Where is the bug? AccClient(83, female)->false AccClient(83, male)->false AccClient(25, male)->true 80 % E 5

30 Same Test Suite but Incorrect Code in Life Insurance Example (1) 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 80) return(true); if (gender == male & age < 80) return(true); return(false); 1 fault triggers 1 failure Test: AccClient(83, female)->false AccClient(83, male)->false AccClient(25, male)->true 1 fault 1 failure 80 % d 1 = c 1 & c 2 2 E 4 1 S d 2 = c 3 & c 4 3 5

31 Same Test Suite but Incorrect Code in Life Insurance Example (2) 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age > 85) return(true); if (gender == male & age < 80) return(true); return(false); 1 fault triggers 1 failure Test: AccClient(83, female)->false AccClient(83, male)->false AccClient(25, male)->true 1 fault 1 failure 80 % d 1 = c 1 & c 2 2 E 4 1 S d 2 = c 3 & c 4 3 5

32 Same Test Suite but Incorrect Code in Life Insurance Example (2) 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age > 80) return(true); if (gender == male & age < 80) return(true); return(false); 2 faults trigger 0 failures Test: AccClient(83, female)->true AccClient(83, male)->false AccClient(25, male)->true 2 faults d 1 = c 1 & c % 2 E 4 1 S d 2 = c 3 & c 4 3 5

33 Statement Coverage : Dead Code? 1: 2: 3: 4: 5: 6: 7: 8: 9: boolean AccClient(int age; gtype gender) if (gender == female){ if (age < 85) return(true); return(false);} if (gender == male){ if (age < 80) return(true); return(false);} return(false); Test: T d 2 = c 2 AccClient(83, female)->true AccClient(83, male)->false AccClient(25, male)->true 3 2 T/F d 1 = c 1 4 E 1 T/F d 4 = c % 8 S T d 3 = c 3 5 9

34 Statement Coverage : Dead Code? 1: 2: 3: 4: 5: 6: 7: 8: 9: boolean AccClient(int age; gtype gender) if (gender == female){ if (age < 85) return(true); return(false);} if (gender == male){ if (age < 80) return(true); return(false);} return(false); Dead code? Test: T d 2 = c 2 AccClient(83, female)->true AccClient(83, male)->false AccClient(25, male)->true 3 2 T/F d 1 = c 1 4 E 1 T/F d 4 = c % 8 S T d 3 = c 3 5 9

35 Statement Coverage : Dead Code? boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: 6: 7: 8: 9: if (gender == female){ if (age < 85) return(true); return(false);} if (gender == male){ if (age < 80) return(true); return(false);} return(false); Test: d 2 = c 2 AccClient(83, female)->true 3 2 d 1 = c 1 1 d 4 = c E 5 d 3 = c 3 9 AccClient(83, male)->false AccClient(25, male)->true 100 %

36 Decision (Branch) Coverage /1 boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 Test: AccClient(83, female)->accept AccClient(83, male)->reject E 5 0 %

37 Decision (Branch) Coverage /2 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); Test: AccClient(83, female)->true AccClient(83, male)->reject AccClient(25, male)->accept 25 % T d 1 = c 1 & c 2 2 E 4 1 S d 2 = c 3 & c 4 3 5

38 Decision (Branch) Coverage /3 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); Test: AccClient(83, female)->true AccClient(83, male)->false AccClient(25, male)->accept 75 % T/F d 1 = c 1 & c 2 2 E 4 1 S F d 2 = c 3 & c 4 3 5

39 Decision (Branch) Coverage /4 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); Test: AccClient(83, female)->true AccClient(83, male)->false AccClient(25, male)->true 100 % T/F d 1 = c 1 & c 2 2 E 4 1 S T/F d 2 = c 3 & c 4 3 5

40 Condition Coverage Test all conditions (in all predicate nodes): Minimum: Each condition must evaluate at least once Simple: Each condition must evaluate at least once to true and once to false Example of a decision (predicate) with two conditions: A predicate may contain several conditions connected via Boolean operators If (A==female & B<85) then

41 Condition Coverage /1 boolean AccClient(int age; gtype gender) S 1: 2: 3: 4: 5: if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); d 1 = c 1 & c d 2 = c 3 & c 4 Test: AccClient(83, female)->accept AccClient(83, male)->reject E 5 0 %

42 Condition Coverage /2 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); Test: AccClient(83, female)->true AccClient(83, male)->reject T T T d 1 = c 1 & c 2 2 E 4 1 S d 2 = c 3 & c % or 25 %

43 Condition Coverage /3 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); Test: AccClient(83, female)->true AccClient(83, male)->false T/F T/F T d 1 = c 1 & c 2 2 E 4 1 S F T F d 2 = c 3 & c % or 62.5 %

44 Condition Coverage /4 1: 2: 3: 4: 5: boolean AccClient(int age; gtype gender) if (gender == female & age < 85) return(true); if (gender == male & age < 80) return(true); return(false); Test: AccClient(83, female)->true AccClient(83, male)->false AccClient(25, male)->true T/F T/F T d 1 = c 1 & c 2 2 E 100 % or 75 % 4 1 S F/T T F/T d 2 = c 3 & c 4 3 5

45 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) Def: A condition independently affects a decision when, by flipping that condition s outcome and holding all the others fixed, the decision outcome 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 condition outcomes within each decision is checked

46 CC, DC, C/DC, M-CC, MC/DC Examples If (A==fem & B<85) Minimum and Simple Condition (CC): (TF) A = fem; B = 200 (D: False) [(FT) A = male; B = 80 (D: False)] Decision (DC): (TT) A = fem; B = 80 (D: True) (FT) A = male; B = 80 (D: False) Condition/Decision (C/DC): (TT) A = fem; B = 80 (D: True) (FF) A = male; B = 200 (D: False) Multiple Condition (M-CC): (TT) A = fem; B = 80 (D: True) (FT) A = male; B = 80 (D: False) (TF) A = fem; B = 200 (D: False) (FF) A = male; B = 200 (D: False) Modified Condition/Decision (MC/DC): (TT) A = fem; B = 80 (D: True) (FT) A = male; B = 80 (D: False) (TF) A = fem; B = 200 (D: False)

47 Modified Condition/Decision (MC/DC) If (A=fem and B<85) then TC A B Dec 1 T (fem) T (80) T 2 F (male) T (80) F 3 T (fem) F (200) F 4 F (male) F (200) F TC1+TC2: change in A -> Dec changed TC1+TC3: change in B -> Dec changed All other TC combinations in which only one condition outcome changes don t have an effect on the decision outcome. Result: only TC1, TC2, and TC3 needed Multiple Condition: (TT) A = fem; B = 80 (D: True) (FT) A = male; B = 80 (D: False) (TF) A = fem; B = 200 (D: False) (FF) A = male; B = 200 (D: False) Modified Condition/Decision: (TT) A = fem; B = 80 (D: True) (FT) A = male; B = 80 (D: False) (TF) A = fem; B = 200 (D: False)

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

49 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

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

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

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

53 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 All Path Linearly Indep. Path Statement

54 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Loop Testing Symbolic Execution Data-Flow Testing Lab 3

55 Loop Testing simple loop nested loops concatenated loops unstructured loops MTAT / Lecture 03 / Dietmar Pfahl 2015

56 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. set loop counter to (n-1), n and (n+1): passes twice through the loop and once not where n is the maximum number of allowable passes MTAT / Lecture 03 / Dietmar Pfahl 2015

57 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 MTAT / Lecture 03 / Dietmar Pfahl 2015

58 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Loop Testing Symbolic Execution Data-Flow Testing Lab 3

59 How to find Test Cases? Analyse 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?

60 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

61 Example from Black-Box Testing Magic Function M M (x, y) result with x, y: int (32 bit) 1st if = true: x <= 100 2nd if = true: y <= 100 3rd if = true: x + y = 200 if ( x <= 0 ) if ( y <= 0 ) if ( x + y == 0 ) crash();... (if_1) && (if_2) && (if_3) -> M (100, 100) -> crash() If_1 If_2 If_3 crash

62 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:

63 Symbolic Execution Tree p: x PC: x>2 PC: path condition Solve path conditions Test input!

64 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition Solve path conditions Test input!

65 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) while-predicate = false (don t enter while-loop) Solve path conditions Test input!

66 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) while-predicate = false (don t enter while-loop) Explanation of PC: Solve path conditions Test input! while-predicate = false can happen if: - p mod q = 0 -> x mod 2 = 0 -> x = 2 * n or - sqrt(p) <= q -> sqrt(x) <= 2 -> x <= 4

67 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) while-predicate = false (don t enter while-loop) Solve path conditions Test input! p: x is prime q: 2 PC: x > 2 and (2 sqrt(x) and x = 2*n + 1) if-predicate = false (take the left branch)

68 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition Solve path conditions Test input! p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) p: x is prime q: 2 PC: x > 2 and (2 sqrt(x) and x = 2*n + 1) Explanation of PC: if-predicate = false happens if: - p mod q > 0 -> - x mod 2 > 0 -> - x mod 2 = 1 -> - x = 2*n + 1

69 Symbolic Execution Tree 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>2 1-2 PC: path condition Solve path conditions Test input! p: x is prime q: 2 PC: x > 2 and (2 sqrt(x) and x = 2*n + 1) sqrt(x) <= 2 x <= 4 2*n + 1 <= 4 n = 1 x = 3

70 Symbolic Execution Tree 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>2 1-2 PC: path condition Solve path conditions Test input! p: x is prime q: 2 PC: x > 2 and (2 sqrt(x) and x = 2*n + 1) sqrt(x) <= 2 x <= 4 2*n + 1 <= 4 n = 1 x = 3 [also satisfies PC: x > 2]

71 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) while-predicate = false (don t enter while-loop) Solve path conditions Test input!

72 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition p: x q: 2 PC: x > 2 and (2 sqrt(x) or x = 2*n) while-predicate = false (don t enter while-loop) Solve path conditions Test input! if-predicate = true (take the right branch) p: x q: 2 and factor PC: x > 2 and x = 2*n

73 Symbolic Execution Tree 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>2 1-2 PC: path condition Solve path conditions Test input! Explanation of PC: if-predicate = true happens if: - p mod q = 0 -> - x mod 2 = 0 -> - x = 2*n p: x q: 2 and factor PC: x > 2 and x = 2*n

74 Symbolic Execution Tree 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>2 1-2 PC: path condition Solve path conditions Test input! x > 2 and x = 2*n x in {2, 4, 6,...} p: x q: 2 and factor PC: x > 2 and x = 2*n

75 Symbolic Execution Tree p: x PC: x>2 p: x q: 2 PC: x>2 1-2 PC: path condition while-predicate = true (enter while-loop) p: x q: 2 PC: x > 2 and 2 < sqrt(x) and x <> 2*n Continue as voluntary homework... Solve path conditions Test input!

76 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Loop Testing Symbolic Execution Data-Flow Testing Lab 3

77 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;

78 Data Flow Testing Motivation Middle ground in structural testing Node (=statement) and edge (=branch) coverage don t test interactions between statements All-path testing is infeasible Need a coverage criterion that is stronger than branch testing but feasible Intuition: Statements interact through data flow Value computed in one statement, used in another Bad value computation revealed only when it is used

79 Data Flow Testing Definitions Def assigned or changed Uses utilized (not changed) C-use (Computation) e.g. righthand 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. [0] bool AccClient(int age; gtype gender) [2] bool accept = false [1] if (gender==female & age<85) [2] accept = true; [3] if (gender==male & age<80) [4] accept = true; [5] return accept Def(2) = {accept} 2 Def(4) = {accept} Def(0) = {age, gender, accept} P-use(1) = {age, gender} P-use(3) = {age, gender} C-use(5) = {accept} 5

80 Data Flow Testing Criteria All def-use paths requires that each simple (i.e., traversing a loop at most once) definition-clear path from a definition of a variable to its use is executed All uses paths requires that for each definition-use pair of a variable at least one simple definition-clear path is executed All definitions paths... requires that at least one path from the definition of a variable to one of its uses is executed

81 Data Flow Testing Example [0] bool AccClient(int age; gtype gender) [2] bool accept = false [1] if (gender==female & age<85) [2] accept = true; [3] if (gender==male & age<80) [4] accept = true; [5] return accept Test cases needed: AccClient() is executed Considering age, there are two DU paths: (a)[0]-[1] (b)[0]-[3] Test cases: AccClient(*, *)-> *

82 Data Flow Testing Example [0] bool AccClient(int age; gtype gender) [2] bool accept = false [1] if (gender==female & age<85) [2] accept = true; [3] if (gender==male & age<80) [4] accept = true; [5] return accept Test cases needed: AccClient() is executed Considering gender, there are two DU paths: (a)[0]-[1] (b)[0]-[3] Test cases: AccClient(*, *)-> *

83 Data Flow Testing Example [0] bool AccClient(int age; gtype gender) [2] bool accept = false [1] if (gender==female & age<85) [2] accept = true; [3] if (gender==male & age<80) [4] accept = true; [5] return accept Test cases needed: (a) AccClient() is executed and if[1] and if[3] are false (b) AccClient() is executed and if[1] is true and if[3] is false (c) AccClient() is executed and if[3] is true Considering accept, there are three DU paths: (a)[0]-[5] (b)[2]-[5] (c)[4]-[5] Test cases: (a) AccClient(*, 85)-> false (b) AccClient(f, 80)-> true (c) AccClient(m, 80)-> true

84 DF-Testing for Web Applications

85 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

86 Data Flow Criteria All branches 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 All paths

87 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

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

89 Structure of Lecture 3 Introduction to White-Box Testing Control-Flow Testing Loop Testing Symbolic Execution Data-Flow Testing Lab 3

90 Lab 3 White-Box Testing Lab 3 (week 29: Mar 14 - Mar 17) - White-Box Testing (10%) Lab 3 Instructions Lab 3 Sample Code Submission Deadlines: Monday Lab: Sunday, 20 Mar, 23:59 Tuesday Labs: Monday, 21 Mar, 23:59 Wednesday Labs: Tuesday, 22 Mar, 23:59 Thursday Labs: Wednesday, 23 Mar, 23:59 Instructions Code Penalties apply for late delivery: 50% penalty, if submitted up to 24 hours late; 100 penalty, if submitted more than 24 hours late MTAT / Lecture 02 / Dietmar Pfahl 2015

91 Lab 3 White-Box Testing (cont d) Instructions Code Coverage Criteria: - Statement (Instruction) - Branch (Decision) Tool: Eclipse Plugin Control-Flow Graph Set of 10+ Test Cases 1 Set of 15+ Test Cases 2 Code Code Test Report 1 & Test Coverage 1a + 1b Test Report 2 & Test Coverage 2a + 2b MTAT / Lecture 02 / Dietmar Pfahl 2015

92 Next 2 Weeks Lab 3: White-Box Testing Lecture 4: Mutation Testing Static Testing (Inspection/Review) Defect Estimation In addition to do: Read textbook chapter 5 (available via OIS) MTAT / Lecture 02 / Dietmar Pfahl 2015

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 03: White-Box Testing (Textbook Ch. 5) Spring 2013 Dietmar Pfahl 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 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 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 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of Coverage/Model Based Testing Will Not Cover Statistical Methods Partition

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

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

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

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 8 Overview of software testing Wednesday Feb 8, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/53 Lecture outline Testing in general Unit testing

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

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

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Black-Box Testing and Usability Testing (Textbook Ch. 4 & 12.8) Spring 2014 Dietmar Pfahl email: dietmar.pfahl@ut.ee Lecture Chapter 4: Test case design Black-box

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

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

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

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

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

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

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

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

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

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

White-Box Testing Techniques II

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

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

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

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

Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt

Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt www.introsoftwaretesting.com Ch. 2 : Graph Coverage Four Structures for Modeling Software Graphs

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Overview of testing techniques Monday March 3, 2014 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/70 Lecture outline Background, testing in general Unit testing

More information

Formal Approach in Software Testing

Formal Approach in Software Testing Formal Approach in Software Testing #Abhishek Dixit, #Shivani Goel 1 csed, TIET biodatadixit@yahoo.co.in 2 csed, TIET shivani@tiet.ac.in Abstract Testing is an important activity for checking the correctness

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

Introduction to Software Testing Chapter 2, Sections: 2.1 & 2.2 Overview Graph Coverage Criteria

Introduction to Software Testing Chapter 2, Sections: 2.1 & 2.2 Overview Graph Coverage Criteria Introduction to Software Testing Chapter 2, Sections: 2.1 & 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwa retest/ Ch. 2 : Graph Coverage Four Structures

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 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

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

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

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

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

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

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

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

Chapter 7 Control Statements Continued

Chapter 7 Control Statements Continued Chapter 7 Control Statements Continued Logical Operators used in Boolean expressions to control behavior of if, while or for statements. && - and, - or,! - not if (the sun shines && you have the time)

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

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18 Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Software Testing 1 Defect Testing Defect testing involves

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

Lecture 2. White- box Tes2ng and Structural Coverage (see Amman and Offut, Chapter 2)

Lecture 2. White- box Tes2ng and Structural Coverage (see Amman and Offut, Chapter 2) Lecture 2 White- box Tes2ng and Structural Coverage (see Amman and Offut, Chapter 2) White- box Tes2ng (aka. Glass- box or structural tes2ng) An error may exist at one (or more) loca2on(s) Line numbers

More information

Software Testing. Software Testing

Software Testing. Software Testing Software Testing Software Testing Error: mistake made by the programmer/ developer Fault: a incorrect piece of code/document (i.e., bug) Failure: result of a fault Goal of software testing: Cause failures

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

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

Department of Electrical & Computer Engineering, University of Calgary. B.H. Far

Department of Electrical & Computer Engineering, University of Calgary. B.H. Far SENG 421: Software Metrics Software Test Metrics (Chapter 10) Department of Electrical & Computer Engineering, University of Calgary B.H. Far (far@ucalgary.ca) http://www.enel.ucalgary.ca/people/far/lectures/seng421/10/

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

Introduction. Easy to get started, based on description of the inputs

Introduction. Easy to get started, based on description of the inputs Introduction Testing is about choosing elements from input domain. The input domain of a program consists of all possible inputs that could be taken by the program. Easy to get started, based on description

More information

Advanced Test Coverage Criteria: Specify and Measure, Cover and Unmask

Advanced Test Coverage Criteria: Specify and Measure, Cover and Unmask Advanced Test Coverage Criteria: Specify and Measure, Cover and Unmask Sébastien Bardin & Nikolai Kosmatov joint work with Omar Chebaro, Robin David, Mickaël Delahaye, Michaël Marcozzi, Mike Papadakis,

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

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

Keywords Test case prioritization, TCP, software testing, Basic path testing, Source code analysis

Keywords Test case prioritization, TCP, software testing, Basic path testing, Source code analysis Volume 5, Issue 4, 2015 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com A Unit Test Case Prioritization

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

Lecture 2. White- box Tes2ng and Structural Coverage (see Amman and Offut, Chapter 2)

Lecture 2. White- box Tes2ng and Structural Coverage (see Amman and Offut, Chapter 2) Lecture 2 White- box Tes2ng and Structural Coverage (see Amman and Offut, Chapter 2) White- box Tes2ng (aka. Glass- box or structural tes2ng) An error may exist at one (or more) loca2on(s) Line numbers

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

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

MTAT Software Engineering. Written Exam 17 January Start: 9:15 End: 11:45

MTAT Software Engineering. Written Exam 17 January Start: 9:15 End: 11:45 MTAT.03.094 Software Engineering Written Exam 17 January 2014 Start: 9:15 End: 11:45 Important Notes: The exam is open book and open laptop. Web browsing is allowed, but you are not allowed to use e mail

More information

NAME (from your UF ID): UF ID#: (Please PRINT) Quiz 1 -- Spring 2017

NAME (from your UF ID): UF ID#: (Please PRINT) Quiz 1 -- Spring 2017 NAME (from your UF ID): UF ID#: (Please PRINT) -------------------- CEN 4072/6070 Software Testing & Verification ------------------ Quiz 1 -- Spring 2017 You have 30 minutes to work on this exam. It is

More information

Topics in Software Testing

Topics in Software Testing Dependable Software Systems Topics in Software Testing Material drawn from [Beizer, Sommerville] Software Testing Software testing is a critical element of software quality assurance and represents the

More information

Smart Test Case Quantifier Using MC/DC Coverage Criterion

Smart Test Case Quantifier Using MC/DC Coverage Criterion Smart Test Case Quantifier Using MC/DC Coverage Criterion S. Shanmuga Priya 1, Sheba Kezia Malarchelvi 2 Abstract Software testing, an important phase in Software Development Life Cycle (SDLC) is a time

More information

Test design techniques

Test design techniques INF3121 : Software Testing 12. 02. 2015 Lecture 4 Test design techniques Lecturer: Raluca Florea INF3121/ 12.02.2015 / Raluca Florea 1 Overview 1. The test development process 2. Categories of test design

More information

Agenda. Predicate Testing. CSE 5321/4321, Ali Sharifara, UTA

Agenda. Predicate Testing. CSE 5321/4321, Ali Sharifara, UTA Agenda Predicate Testing CSE 5321/4321, Ali Sharifara, UTA 1 Predicate Testing Introduction Basic Concepts Predicate Coverage Summary CSE 5321/4321, Ali Sharifara, UTA 2 Motivation Predicates are expressions

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

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

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

From MC/DC to RC/DC: Formalization and Analysis of Control-Flow Testing Criteria

From MC/DC to RC/DC: Formalization and Analysis of Control-Flow Testing Criteria 1 From MC/DC to RC/DC: Formalization and Analysis of Control-Flow Testing Criteria Sergiy A. Vilkomir and Jonathan P. Bowen, Member, IEEE Computer Society Abstract This paper describes an approach to formalization

More information

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia Topic: Software Verification, Validation and Testing Software Engineering Faculty of Computing Universiti Teknologi Malaysia 2016 Software Engineering 2 Recap on SDLC Phases & Artefacts Domain Analysis

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

Properties of Criteria. 1. Applicability Property. Criteria

Properties of Criteria. 1. Applicability Property. Criteria Properties of Criteria Program-based To recognize a good adequacy criteria And to discard poor choices Objective, well-defined properties 1. Applicability Property For every program, there exists an adequate

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 01: Introduction to Software Testing (Textbook Ch. 1-3) Spring 2017 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 1 Introduction and Motivation Course

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

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

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

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak CSE 403: Software Engineering, Fall 2016 courses.cs.washington.edu/courses/cse403/16au/ Unit Testing Emina Torlak emina@cs.washington.edu Outline Software quality control Effective unit testing Coverage

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