MTAT Software Engineering

Size: px
Start display at page:

Download "MTAT Software Engineering"

Transcription

1 MTAT Software Engineering Lecture 11: Verification and Validation (Part 2) Dietmar Pfahl Fall

2 Exam Registration Status as of Nov 19 Exam 1: Friday, 08-Jan-2015, 14:15-16:15, room Capacity limit: 90 students Registered: 47 Free seats: 43 Exam 2: Friday, 15-Jan-2015, 14:15-16:15, room Capacity limit: 90 students Registered: 9 Free seats: 81 You must register: First-come-first-serve (FIFO) principle

3 Schedule of Lectures Week 01: Introduction to SE Week 02: Requirements Engineering I Week 03: Requirements Engineering II Week 04: Analysis Week 05: Development Infrastructure I Week 06: Development Infrastructure II Week 07: Architecture and Design Week 08: No lecture Week 09: Refactoring Week 10: Verification and Validation I Week 11: Industry Lecture (Testing) Week 12: Verification and Validation II Week 13: Agile/Lean Methods Week 14: Industry Lecture (Agile) Week 15: Measurement / Course wrap-up, review and exam preparation Week 16: no lecture

4 Structure of Lectures 09 & 11 Fundamental Definitions and Concepts Test Strategies Black-Box White-Box Assessing the Quality of Test Suites Test Coverage Mutation Testing Static Analysis Quality Prediction

5 How Do We Test This? 34 switches = 2 34 = 1.7 x possible inputs = 1.7 x tests If only 3-way interactions, need only 33 tests For 4-way interactions, need only 85 tests

6 Combinatorial Testing What is it? Methods for systematically testing t-way interaction effects of input (or configuration parameter) values. Why do it? The interaction of specific combinations of input values may trigger failures that won t be triggered if testing input (or configuration parameter) values only in isolation.

7 Two Scopes of Combinatorial Testing Test Configurations Test Inputs Size Topp Addr Phone Sm Custom Val Val Sm Preset Inv Inv Test inputs Med Custom Inv Val Med Preset Val Inv Lg Custom Val Inv Lg Preset Inv Val Test case OS CPU Protocol 1 Windows Intel IPv4 2 Windows AMD IPv6 3 Linux Intel IPv6 4 Linux AMD IPv4 Pizza Ordering System under test (SUT)

8 Combinatorial Testing Example 2 Platform configuration parameters: OS: Windows XP, Apple OS X, Red Hat Linux Browser: Internet Explorer, Firefox Protocol: IPv4, IPv6 CPU: Intel, AMD DBMS: MySQL, Sybase, Oracle Total number of combinations: 3*2*2*2*3 = 72 Do we need 72 test cases?

9 Pair-Wise Testing (2-Way Interaction) Only 10 tests needed, if we want to test all interactions of one parameter with one other parameter (pairwise interaction) # of parameter pairs: 5 2 5! 10 2!(5 2)! # of 2-way interactions N=57: N Test OS Browser Protocol CPU DBMS 1 XP IE IPv4 Intel MySQL 2 XP Firefox IPv6 AMD Sybase 3 XP IE IPv6 Intel Oracle 4 OS X Firefox IPv4 AMD MySQL 5 OS X IE IPv4 Intel Sybase 6 OS X Firefox IPv4 Intel Oracle 7 RHL IE IPv6 AMD MySQL 8 RHL Firefox IPv4 Intel Sybase 9 RHL Firefox IPv4 AMD Oracle 10 OS X Firefox IPv6 AMD Oracle

10 Pair-Wise Testing (2-Way Interaction) # of parameter pairs: 5 2 5! 10 2!(5 2)! # of 2-way interactions N=57: N 3 2 a:b 3 x 2 = 6 a:c 3 x 2 = 6 a:d 3 x 2 = 6 a:e 3 x 3 = 9 b:c 2 x 2 = 4 b:d 2 x 2 = 4 b:e 2 x 3 = 6 c:d 2 x 2 = 4 c:e 2 x 3 = 6 d:e 2 x 3 = Test OS (a) Browser (b) Protocol (c) CPU (d) DBMS (e) 1 XP IE IPv4 Intel MySQL 2 XP Firefox IPv6 AMD Sybase 3 XP IE IPv6 Intel Oracle 4 OS X Firefox IPv4 AMD MySQL 5 OS X IE IPv4 Intel Sybase 6 OS X Firefox IPv4 Intel Oracle 7 RHL IE IPv6 AMD MySQL 8 RHL Firefox IPv4 Intel Sybase 9 RHL Firefox IPv4 AMD Oracle 10 OS X Firefox IPv6 AMD Oracle

11 Pair-Wise Testing (2-Way Interaction) Only 10 tests needed, if we want to test all interactions of one parameter with one other parameter (pairwise interaction) Parameter pair 1: 3 x 2 = 6 value combinations Test OS Browser Protocol CPU DBMS 1 XP IE IPv4 Intel MySQL 2 XP Firefox IPv6 AMD Sybase 3 XP IE IPv6 Intel Oracle 4 OS X Firefox IPv4 AMD MySQL 5 OS X IE IPv4 Intel Sybase 6 OS X Firefox IPv4 Intel Oracle 7 RHL IE IPv6 AMD MySQL 8 RHL Firefox IPv4 Intel Sybase 9 RHL Firefox IPv4 AMD Oracle 10 OS X Firefox IPv6 AMD Oracle

12 Pair-Wise Testing (2-Way Interaction) Only 10 tests needed, if we want to test all interactions of one parameter with one other parameter (pairwise interaction) Pair 2: 2 x 2 = 4 value combinations Test OS Browser Protocol CPU DBMS 1 XP IE IPv4 Intel MySQL 2 XP Firefox IPv6 AMD Sybase 3 XP IE IPv6 Intel Oracle 4 OS X Firefox IPv4 AMD MySQL 5 OS X IE IPv4 Intel Sybase 6 OS X Firefox IPv4 Intel Oracle 7 RHL IE IPv6 AMD MySQL 8 RHL Firefox IPv4 Intel Sybase 9 RHL Firefox IPv4 AMD Oracle 10 OS X Firefox IPv6 AMD Oracle

13 Pair-Wise Testing (2-Way Interaction) Only 10 tests needed, if we want to test all interactions of one parameter with one other parameter (pairwise interaction) Pair 3: 3 x 3 = 9 value combinations Test OS Browser Protocol CPU DBMS 1 XP IE IPv4 Intel MySQL 2 XP Firefox IPv6 AMD Sybase 3 XP IE IPv6 Intel Oracle 4 OS X Firefox IPv4 AMD MySQL 5 OS X IE IPv4 Intel Sybase 6 OS X Firefox IPv4 Intel Oracle 7 RHL IE IPv6 AMD MySQL 8 RHL Firefox IPv4 Intel Sybase 9 RHL Firefox IPv4 AMD Oracle 10 OS X Firefox IPv6 AMD Oracle

14 Is Testing 2-Way Interactions Enough? Analyses of failure-triggering conditions showed this: Medical device (dark blue) NASA distrib. DB (light blue) Browser (green) Web server (magenta) Network security (orange) TCAS* module (purple) * Traffic Collision Avoiding System

15 ACTS Tool (NIST & UT Arlington)

16 Combinatorial Testing Links

17 One problem is left Creating test (input) data is the (relatively) easy part! How do we check that the code worked correctly on the test input?

18 How to (Automatically) Generate Test Oracles? Creating test (input) data is the (relatively) easy part! How do we check that the code worked correctly on the test input? Using existing test sets (with known oracles) easy if test sets exist Crash testing code to ensure it does not crash for randomly generated test input ( fuzz testing ) easy but of limited value Embedded assertions incorporate assertions in code to check critical states at different points in the code will they cover all possible incorrect states? Model-checking using a mathematical model of the system under test and a model checker to generate expected results for each input expensive but tractable

19 State-Transition Testing Input (Event) State-Transition Graph Action Create a set of test cases that triggers each state-transition at least once

20 State Table State Input (Event) Wait for Card (S1) Wait for PIN (S2) Card inserted S2 (Ask for PIN) - - Invalid PIN - S2 (Beep) - Valid PIN - S3 (Ask amount) - Cancel - S1 (Return card) Next (S3)

21 State Table 4 Test Cases: - Input Card inserted in S1 - Input Invalid PIN in S2 - Input Valid PIN in S2 - Input Cancel in S2 State Input (Event) Wait for Card (S1) Wait for PIN (S2) Card inserted S2 (Ask for PIN) - - Invalid PIN - S2 (Beep) - Valid PIN - S3 (Ask amount) - Cancel - S1 (Return card) Next (S3)

22 Error Guessing Exploratory testing, happy testing,... Always worth including Can trigger failures that systematic techniques miss Consider Past failures Intuition Experience Brain storming What is the craziest thing we can do? Lists in literature

23 Exploratory Testing Inventors: Cem Kaner, James Bach (1990s) Definition: Exploratory testing is simultaneous learning, test design, and test execution. Elements / Variants Charter: defines mission (and sometimes tactics to use) Example: Check UI against Windows interface standards Session-based test management: Defects + Notes + Interviews of the testers

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

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

26 Selective Testing a selected path Selective: Control flow testing Data flow testing

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

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

29 Control Flow Graph (CFG) e 1 e 2 s 1 s 2 e 3 e 4 s 3 d 1 s 5 e 5 e 6 s 4 s 6 e 7 e 8 Nodes: 8 Edges: 8 empty Blocks: 4 Edges: 4 MTAT / Lecture 03 / Dietmar Pfahl 2015

30 CFG Construction Example 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 c4 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) } }

31 CFG Construction Example CFG(t) c 1 d 1 d 2 CFG(f) If (c1) then { if (c2) then {s1} s2 If (c1) then { CFG(c1=true) while (c3) do {s3} } } else { else { if (c4) then { CFG(c1=false) repeat {s4} until (c5) } } } }

32 CFG Construction Example CFG(if) c 1 d 1 d 2 c4 If (c1) then { if (c2) then {s1} s2 If (c1) then { CFG(if) s2 d 4 d 10 while (c3) do {s3} } CFG(while) } CFG (while) s 2 d 6 d 9 CFG (repeat) d 14 d 11 else { if (c4) then { repeat {s4} until (c5) } } else { if (c4) then { CFG(repeat) } }

33 CFG Construction Example 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 c4 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) } }

34 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 c4 d 4 s 4 d 5 d s 12 2 d 13 d 11 Statement (or Block) Coverage all nodes Decision (or Branch) Coverage all edges Condition Coverage Condition/Decision Coverage Multiple Condition Coverage Modified Condition Decision Coverage (MC/DC) Linearly Independent Paths Simple Paths Visit-Each Loop All Paths

35 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 E 5

36 Statement Coverage Criterion: Execute each statement at least once Tools can be used to monitor execution ( coverage) Possible concern: Dead code Example: assume that due to some previous calculations, AccClient can only be invoked with parameter value gender = female

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

38 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)->accept AccClient(83, male)->reject E 5 40 %

39 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)->accept AccClient(83, male)->reject E 5 80 %

40 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)->accept AccClient(83, male)->reject E 5 AccClient(25, male)->accept 100 %

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

42 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)->accept 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

43 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)->accept AccClient(83, male)->reject 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

44 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)->accept AccClient(83, male)->reject AccClient(25, male)->accept 100 % T/F d 1 = c 1 && c 2 2 E 4 1 S T/F d 2 = c 3 && c 4 3 5

45 Decision (Branch) Coverage /? 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)->accept AccClient(83, male)->reject AccClient(25, male)->accept 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

46 Decision (Branch) Coverage /? 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: d 2 = c 2 AccClient(83, female)->accept AccClient(83, male)->reject AccClient(25, male)->accept 3 2 d 1 = c 1 1 d 4 = c E 100 % S d 3 = c 3 5 9

47 Condition Coverage Test all conditions (in all predicate nodes) Each condition must evaluate at least once (or: once to true and once to false ) A (simple) condition may contain: Relational operators Arithmetic expressions... If (A<10 and B>250) then A predicate may contain several (simple) conditions connected via Boolean operators

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

49 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)->accept 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 %

50 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)->accept AccClient(83, male)->reject 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 %

51 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)->accept AccClient(83, male)->reject AccClient(25, male)->accept 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

52 Advanced Condition Coverage Condition/Decision Coverage (C/DC) as DC plus: every (simple) condition in each decision is tested in each possible outcome Modified Condition/Decision coverage (MC/DC) as above plus, every (simple) condition shown to independently affect a decision outcome (by varying that condition only) a (simple) 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 (simple) conditions within each decision taken

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

54 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

55 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

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

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

58 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 Complete Path Linearly Indep. Path Condition Decision Statement

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

60 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 Why interesting? E.g., consider: def-def-def (and no use) or use (without def)

61 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 data: AccClient(*, female)-> * AccClient(*, male)-> *

62 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 data: AccClient(*, *)-> *

63 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 # tests All def-use paths Stronger

64 OO-Testing Approaches (c) 2008 Mauro Pezzè & Michal Young MTAT / Lecture 02 / Dietmar Pfahl 2015

65 Class Testing and State push(s, elem1) Show_top(s) -> elem1 pop(s, x) -> x=elem1 pop(s, x) -> x=? The result of a method call depends on the state of the stack MTAT / Lecture 05 / Dietmar Pfahl 2015

66 Stack Example How many test cases needed to cover all feasible branches? MTAT / Lecture 05 / Dietmar Pfahl 2015

67 Stack Example How many test cases needed to cover all feasible branches? 4 decisions MTAT / Lecture 05 / Dietmar Pfahl 2015

68 Stack Example How many test cases needed to cover all feasible branches? 4 decisions MTAT / Lecture 05 / Dietmar Pfahl 2015

69 Stack Example 2 test cases are enough: MTAT / Lecture 05 / Dietmar Pfahl 2015

70 Stack Example D1 D2 D3 2 test cases are enough: D4 MTAT / Lecture 05 / Dietmar Pfahl 2015

71 Stack Example D1 D2 D3 2 test cases are enough: D3: false D4 MTAT / Lecture 05 / Dietmar Pfahl 2015

72 Stack Example D1 D2 D3 D4 2 test cases are enough: D1: false D2: true D1: false D2: true D1: false D2: true D1: true D4: true... false D3: true MTAT / Lecture 05 / Dietmar Pfahl 2015

73 Stack Example CFGs true true if if false false true if false true for false MTAT / Lecture 05 / Dietmar Pfahl 2015

74 Stack Example CFG (Class) pop() Stack() true if false Stack push(x) true if false resize() true if false true for false MTAT / Lecture 05 / Dietmar Pfahl 2015

75 State Diagram for Stack Example non_exist Stack() empty (size = 0) pop() error c [size < length - 1 ] push(x) push(x) not_empty (0 < size < length) [size = 1] pop() [size > 1] pop() [size = length - 1] push(x) / resize() push(x): size++ / pop(): size resize(): length := length * 2 MTAT / Lecture 05 / Dietmar Pfahl 2015

76 Structure of Lectures 09 & 11 Fundamental Definitions and Concepts Test Strategies Black-Box White-Box Assessing the Quality of Test Suites Test Coverage Mutation Testing Static Analysis Quality Prediction

77 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

78 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

79 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

80 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 Other Criteria: Requirements covered,...

81 Structure of Lectures 09 & 11 Fundamental Definitions and Concepts Test Strategies Black-Box White-Box Assessing the Quality of Test Suites Test Coverage Mutation Testing Static Analysis Quality Prediction

82 Static Analysis Document Review (manual) Different types Static Code Analysis (automatic) Structural properties / metrics

83 Static Code Analysis Example 1 Bug finding is about pointing out programming mistakes: bad practice, coding errors, unexpected behavior. One interesting example of bugs that static analysis can find is null pointer dereference. int i=0; String s = null; If (i>0) { s = "positive"; } If (s.contains("pos")) { System.out.println(s); } This code will compile but at runtime a null pointer exception will be thrown, the String s being null and calling the method contains. Static analysis tools, for instance FindBugs can find this bug and report it.

84 Static Code Analysis Example 2 Bug finding is about pointing out programming mistakes: bad practice, coding errors, unexpected behavior. One interesting example of bugs that static analysis can find is security vulnerabilities. Static analysis can be applied to find security flaws in code. With dataflow analysis, it is possible to follow the propagation of input data, and thus detect possible code injection. Example: public static void main(string args[]) { File f = new File(args[0]); f.open(); //... } This program opens a file with an argument entered in command line. The fact that we use this argument to open a file is just an example, the important fact is that we use directly an input without validation, which constitutes a serious security vulnerability. Dataflow analysis can detect this kind of flaw by finding the source of data inputs, following their propagation until their use in a sensitive instruction (like creating a File object). Source:

85 Reviews - Terminology Static testing testing without software execution Review meeting to evaluate software artifact Inspection formally defined review Walkthrough author guided review

86 Reviews complement testing

87 Relative Cost of Faults Maintenance 200 Source: Davis, A.M., Software Requirements: analysis and specification (1990)

88 Reading Techniques Ad hoc Checklist-based Defect-based Scenario-based Usage-based Perspective-based

89 Perspective-based Reading User Designer Tester Scenarios Purpose Decrease overlap (redundancy) Improve effectiveness

90 Structure of Lectures 09 & 11 Fundamental Definitions and Concepts Test Strategies Black-Box White-Box Assessing the Quality of Test Suites Test Coverage Mutation Testing Static Analysis Quality Prediction

91 Quality Prediction Quality def.: Undetected #Defects Based on product and process properties Quality = Function(Code Size Complexity) Quality = Function(Code Changes) Quality = Function(Detected #Defects) Quality = Function(Test Effort) Based on detected defects Capture-Recapture Models Reliability Growth models

92 Capture-Recapture Defect Estimation

93 Capture-Recapture Defect Estimation

94 Capture-Recapture Defect Estimation Situation: Two inspectors are assigned to inspect the same product d 1 : #defects detected by Inspector 1 d 2 : #defects detected by Inspector 2 d 12 : #defects by both inspectors N t : total #defects (detected and undetected) N r : remaining #defects (undetected) N t d 1 d d 12 2 N r N t ( d d d )

95 Capture-Recapture Example Situation: Two inspectors are assigned to inspect the same product d 1 : 50 defects detected by Inspector 1 d 2 : 40 defects detected by Inspector 2 d 12 : 20 defects by both inspectors N t : total defects (detected and undetected) N r : remaining defects (undetected) d d N t N 100 ( ) 30 d r 12

96 Advanced Capture-Recapture Models Four basic models used for inspections Degree of freedom Prerequisites for all models All reviewers work independently of each other It is not allowed to inject or remove faults during inspection

97 Advanced Capture-Recapture Models Model Probability of defect being found is equal across... Defect Reviewer Estimator M0 Yes Yes Maximum-likelihood Mt Yes No Maximum-likelihood Chao s estimator Mh No Yes Jackknife Chao s estimator Mth No No Chao s estimator

98 Mt Model Maximum-likelihood: Mt = total marked animals (=faults) at the start of the t'th sampling interval Ct = total number of animals (=faults) sampled during interval t Rt = number of recaptures in the sample Ct An approximation of the maximum likelihood estimate of population size (N) is: SUM(Ct*Mt)/SUM(Rt) First resampling: M1=50 (first inspector) C1=40 (second inspector) R1=20 N=40*50/20=100 Second resampling: M2=70 (first and second inspector) C2=40 (third inspector) R2=30 N=(40*50+40*70)/(20+30)=4800/50=96 Third resampling: M3=80 C3=30 (fourth inspector) R3=30 N=( *80)/( )=7200/80=90

99 Reliability Growth Models To predict the probability of future failure occurrence based on past (observed) failure occurrence Can be used to estimate the number of residual (remaining) faults or the time until the next failure occurs the remaining test time until a reliability objective is achieved or Application typically during system test

100 Reliability Growth Models (RGMs) 100% 95% Cumulative #Failures (m) m( t ) 0e (estimated n 0 ) t 0 0 t n 0 dt Purpose: Stop testing when a certain percentage (90%, 95%, 99%, 99.9%, ) of estimated total number of failures has been reached a certain failure rate has been reached Test Intensity (t) (CPU time, test effort, test days, calendar days, )

101 Model Selection Many different RGMs have been proposed (>100) To choose a reliability model, perform the following steps: 1. Collect failure data 2. Examine data (failure data vs. test time/effort) 3. Select a set of candidate models 4. Estimate model parameters for each candidate model Least squares method Maximum likelihood method 5. Customize model using the estimated parameters 6. Compare models with goodness-of-fit test and select the best 7. Make reliability predictions with selected model(s)

102 Next Lecture Date/Time: Friday, 27-Nov, 10:15-12:00 Topic: Agile / Lean Methods For you to do: Work on Lab Task 6 Attend assessment session for Lab Task 5

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

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

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 Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 04: Static Testing (Inspection) and Defect Estimation (Textbook Ch. 10 & 12) Spring 2013 Dietmar Pfahl email: dietmar.pfahl@ut.ee Lecture Reading Chapter 10: Reviews

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 03: Black-Box Testing (advanced) Part 2 Dietmar Pfahl Spring 2018 email: dietmar.pfahl@ut.ee Black-Box Testing Techniques Equivalence class partitioning (ECP) Boundary

More information

Specification-based test design

Specification-based test design Software and Systems Verification (VIMIMA01) Specification-based test design Zoltan Micskei, Istvan Majzik Budapest University of Technology and Economics Fault Tolerant Systems Research Group Budapest

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

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

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

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

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

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

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

Testing: Test design and testing process

Testing: Test design and testing process Testing: Test design and testing process Zoltán Micskei Based on István Majzik s slides Dept. of Measurement and Information Systems Budapest University of Technology and Economics Department of Measurement

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

Part 5. Verification and Validation

Part 5. Verification and Validation Software Engineering Part 5. Verification and Validation - Verification and Validation - Software Testing Ver. 1.7 This lecture note is based on materials from Ian Sommerville 2006. Anyone can use this

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

Black-box Testing Techniques

Black-box Testing Techniques T-76.5613 Software Testing and Quality Assurance Lecture 4, 20.9.2006 Black-box Testing Techniques SoberIT Black-box test case design techniques Basic techniques Equivalence partitioning Boundary value

More information

Course Review. Ajitha Rajan. Ajitha Rajan Course Review c 2015

Course Review. Ajitha Rajan. Ajitha Rajan Course Review c 2015 Course Review Ajitha Rajan Ajitha Rajan Course Review c 2015 Software Faults, Errors & Failures Software Fault : A static defect in the software Software Failure : External, incorrect behavior with respect

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

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

Chapter 10. Testing and Quality Assurance

Chapter 10. Testing and Quality Assurance Chapter 10 Testing and Quality Assurance Different styles of doing code review Human Reviewer Code Inspection with continuous integration infrastructure Pinger s testing set up Testing Related topics 1.

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

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

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

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

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 05: Test Lifecycle and Test Levels (Textbook Ch. 6) Spring 2016 Dietmar Pfahl email: dietmar.pfahl@ut.ee Exam Dates Capacity Limit: 75 students Exam 1: Thursday, 19

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

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

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

Software Testing. Testing 1

Software Testing. Testing 1 Software Testing Testing 1 Background Main objectives of a project: High Quality & High Productivity (Q&P) Quality has many dimensions reliability, maintainability, interoperability etc. Reliability is

More information

It is primarily checking of the code and/or manually reviewing the code or document to find errors This type of testing can be used by the developer

It is primarily checking of the code and/or manually reviewing the code or document to find errors This type of testing can be used by the developer Static testing Static testing is a software testing method that involves examination of the program's code and its associated documentation but does not require the program be executed. Dynamic testing,

More information

Software Testing for Developer Development Testing. Duvan Luong, Ph.D. Operational Excellence Networks

Software Testing for Developer Development Testing. Duvan Luong, Ph.D. Operational Excellence Networks Software Testing for Developer Development Testing Duvan Luong, Ph.D. Operational Excellence Networks Contents R&D Testing Approaches Static Analysis White Box Testing Black Box Testing 4/2/2012 2 Development

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

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing?

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing? Testing ECE/CS 5780/6780: Embedded System Design Scott R. Little Lecture 24: Introduction to Software Testing and Verification What is software testing? Running a program in order to find bugs (faults,

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

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

Introduction to Software Testing Chapter 4 Input Space Partition Testing

Introduction to Software Testing Chapter 4 Input Space Partition Testing Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/ softwaretest/ Ch. 4 : Input Space Coverage Four Structures for Modeling

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

Manuel Oriol, CHCRC-C, Software Testing ABB

Manuel Oriol, CHCRC-C, Software Testing ABB Manuel Oriol, CHCRC-C, 08.11.2017 Software Testing Slide 1 About me 1998 2004 2005 2008 2011 Slide 2 Introduction Why do we test? Did you have to deal with testing in the past? Slide 3 Ariane 5 http://www.youtube.com/watch?v=kyurqduyepi

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

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

10. Software Testing Fundamental Concepts

10. Software Testing Fundamental Concepts 10. Software Testing Fundamental Concepts Department of Computer Science and Engineering Hanyang University ERICA Campus 1 st Semester 2016 Testing in Object-Oriented Point of View Error Correction Cost

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

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

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

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems)

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) More Analysis for Functional Correctness Jonathan Aldrich Charlie Garrod School of Computer Science

More information

Software technology 7. Testing (2) BSc Course Dr. Katalin Balla

Software technology 7. Testing (2) BSc Course Dr. Katalin Balla Software technology 7. Testing (2) BSc Course Dr. Katalin Balla Contents Testing techniques Static testing techniques Dynamic testing Black box testing White-box testing Testing in the agile environment

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

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

Test Automation. 20 December 2017

Test Automation. 20 December 2017 Test Automation 20 December 2017 The problem of test automation Testing has repetitive components, so automation is justified The problem is cost-benefit evaluation of automation [Kaner] Time for: test

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

Sample Exam. Certified Tester Foundation Level

Sample Exam. Certified Tester Foundation Level Sample Exam Certified Tester Foundation Level Answer Table ASTQB Created - 2018 American Stware Testing Qualifications Board Copyright Notice This document may be copied in its entirety, or extracts made,

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

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

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

Using Code Coverage to Improve the Reliability of Embedded Software. Whitepaper V

Using Code Coverage to Improve the Reliability of Embedded Software. Whitepaper V Using Code Coverage to Improve the Reliability of Embedded Software Whitepaper V2.0 2017-12 Table of Contents 1 Introduction... 3 2 Levels of Code Coverage... 3 2.1 Statement Coverage... 3 2.2 Statement

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

Static Analysis methods and tools An industrial study. Pär Emanuelsson Ericsson AB and LiU Prof Ulf Nilsson LiU

Static Analysis methods and tools An industrial study. Pär Emanuelsson Ericsson AB and LiU Prof Ulf Nilsson LiU Static Analysis methods and tools An industrial study Pär Emanuelsson Ericsson AB and LiU Prof Ulf Nilsson LiU Outline Why static analysis What is it Underlying technology Some tools (Coverity, KlocWork,

More information

Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code (contd)

Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code (contd) Feasibility of Testing to Code (contd) Feasibility of Testing to Code (contd) An incorrect code fragment for determining if three integers are equal, together with two test cases Flowchart has over 10

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

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

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

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

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

Sample Question Paper. Software Testing (ETIT 414)

Sample Question Paper. Software Testing (ETIT 414) Sample Question Paper Software Testing (ETIT 414) Q 1 i) What is functional testing? This type of testing ignores the internal parts and focus on the output is as per requirement or not. Black-box type

More information

Standard Glossary of Terms used in Software Testing. Version 3.2. Foundation Extension - Usability Terms

Standard Glossary of Terms used in Software Testing. Version 3.2. Foundation Extension - Usability Terms Standard Glossary of Terms used in Software Testing Version 3.2 Foundation Extension - Usability Terms International Software Testing Qualifications Board Copyright Notice This document may be copied in

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

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

Static Analysis of C++ Projects with CodeSonar

Static Analysis of C++ Projects with CodeSonar Static Analysis of C++ Projects with CodeSonar John Plaice, Senior Scientist, GrammaTech jplaice@grammatech.com 25 July 2017, Meetup C++ de Montréal Abstract Static program analysis consists of the analysis

More information

F. Tip and M. Weintraub FUNCTIONAL TESTING

F. Tip and M. Weintraub FUNCTIONAL TESTING F. Tip and M. Weintraub FUNCTIONAL TESTING ACKNOWLEDGEMENTS Thanks go to Andreas Zeller for allowing incorporation of his materials 2 HOW TO TELL IF A SYSTEM MEETS EXPECTATIONS? Two options: 1. testing:

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

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

Program Analysis. Program Analysis

Program Analysis. Program Analysis Program Analysis Class #4 Program Analysis Dynamic Analysis 1 Static VS Dynamic Analysis Static analysis operates on a model of the SW (without executing it) If successful, produces definitive information

More information

Objectives. Chapter 19. Verification vs. validation. Topics covered. Static and dynamic verification. The V&V process

Objectives. Chapter 19. Verification vs. validation. Topics covered. Static and dynamic verification. The V&V process Objectives Chapter 19 Verification and Validation Assuring that a software system meets a user s need are to introduce software verification and validation (V&V) and to discuss the distinction between

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

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

Basic Concepts of Reliability

Basic Concepts of Reliability Basic Concepts of Reliability Reliability is a broad concept. It is applied whenever we expect something to behave in a certain way. Reliability is one of the metrics that are used to measure quality.

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

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

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

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

Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 22 Slide 1

Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 22 Slide 1 Verification and Validation Slide 1 Objectives To introduce software verification and validation and to discuss the distinction between them To describe the program inspection process and its role in V

More information

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1 Verification vs validation Verification: "Are we building the product right?. The software should

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

18-642: Unit Testing 1/31/ Philip Koopman

18-642: Unit Testing 1/31/ Philip Koopman 18-642: Unit Testing 1/31/2018 2017-2018 Philip Koopman YOU ARE HERE Product Requirements SPECIFY PRODUCT SPECIFY SOFTWARE Software Requirements TRACEABILITY & VALIDATION Test Plan & Test Results Test

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

[IT6004-SOFTWARE TESTING] UNIT 2

[IT6004-SOFTWARE TESTING] UNIT 2 1. List the two basic Testing strategies. UNIT 2 Black box testing. White box testing. 2. What are the knowledge sources for Black box testing? Requirements Document specification Domain knowledge Defect

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