Logic-based test coverage
|
|
- Ernest Boyd
- 5 years ago
- Views:
Transcription
1 Logic-based test coverage!!! Basic approach Clauses and predicates Basic coverage criteria: CC, PC, CoC Structural logic coverage of source code Logic coverage of specifications Active clause coverage criteria (GACC, CACC, RACC)! Verificação e Validação de Software! Departamento de Informática! Faculdade de Ciências da Universidade de Lisboa!! Eduardo Marques, edrdo@di.fc.ul.pt
2 Logic Coverage Logic coverage approach Test criteria are based on logical expressions found in the specification or code of the SUT. Predicate An expression that evaluates to a boolean value (true or false) and may contain boolean-valued expressions connected by logical operators. Clause A boolean expression that does not make use of logical operators. Example: x > 10 (f(y) = 30 z ) is a predicate x > 10, f(y) = 30, and z are clauses and are logical operators. 2
3 Logical operators a b (and) a b (or) a (negation) a b (implication) a b (equivalence: a if and only if b ) a b (exclusive or/choice, also known as xor ) 3
4 Coverage criteria (PC, CC, CoC) Let P be a set of predicates and C the set of clauses that appear in P. For each p P let C p = { c C c occurs in p } Predicate coverage (PC) For every predicate p P, TR contains two requirements: (1) p evaluates to true, and (2) p evaluates to false. Clause coverage (CC) For every clause c C, TR contains two requirements: (1) c evaluates to true and (2) c evaluates to false. Combinatorial test coverage (CoC) Fo every p P TR contains test requirements for each possible combination of truth values of clauses in C p 4
5 Example For p1 = x > y (x = z-1 x > z ) the clauses are: a: x > y b: x = z-1 c: x > z For p2 = z > 0 z > x+y the clauses are d: z > 0 e: z > x+y For P = { p1, p2 } we have TR(PC) = { p1, p1, p2, p2 } TR(CC) = { a, a, b, b, c, c, d, d, e, e } TR(CoC) = { a b c, a b c, a b c, a b c, a b c, a b c, a b c, a b c, d e, d e, d e, d e } Exercise 1: find combinations of values for x, y, z that will satisfy the test requirements of PC, CC and CoC in turn. Observe that there are infeasible requirements for CoC. 5
6 Subsumption relations PC does not subsume CC, nor CC subsumes PC; for instance consider P = { a b } T1 = { (a = true, b = false), (a = false, b = false) } covers TR(PC) but not TR(CC) [does not cover case where b is true] T2 = { (a = true, b = false), (a = false, b = true) } covers TR(CC) but not TR(PC) CoC subsumes CC and PC of course (it covers all possible combinations) but it easily becomes impractical... 2 n test requirements are required per predicate with n independent clauses 6
7 Structural logical coverage for source code Aim: to identify test requirements (and then test cases for them) according to predicates and clauses found in source code. Clauses and predicates: identified in connection with logical operators defined by the programming language at stake. Reachability predicates: need to be derived to ensure proper evaluation of each predicate (in line with program flow) / derive test inputs. 7
8 Logical operators in source code logical expression Java expression a b a b a && b a b a! a a b a b a? b : true; a == b a b a!= b 8 Note: the & ^ ~ operators also correspond to logical operators [what are the differences between a && b and a & b, a b and a b? ]
9 Example: predicates/clauses in source code public static int daysinmonth(int m, int y) {! if (m <= 0 m > 12)! throw new IllegalArgumentException("Invalid month: " + m);! if (m == 2) {! if (y % 400 == 0 (y % 4 == 0 && y % 100!= 0))! return 29;! else! return 28;! }! } if (m <= 7) {! if (m % 2 == 1)! return 31;! return 30;! }! if (m % 2 == 0)! return 31;! return 30;! Predicates and clauses p1: c1 c2 ; c1: m <= 0, c2: m > 12! p2: c3; c3: m == 2;! p3: c4 (c5 && c6) ; c4: y % 400 == 0, c5: y % 4 == 0, c6: y % 100!= 0;! p4: c7; c7: m <= 7;! p5: c8; c8: m % 2 == 1;! p6: c9; c9: m % 2 == 0 9
10 Exercise 2: TR(CC), TR(PC), TR(CoC)? public static int daysinmonth(int m, int y) {! if (m <= 0 m > 12)! throw new IllegalArgumentException("Invalid month: " + m);! if (m == 2) {! if (y % 400 == 0 (y % 4 == 0 && y % 100!= 0))! return 29;! else! return 28;! }! } if (m <= 7) {! if (m % 2 == 1)! return 31;! return 30;! }! if (m % 2 == 0)! return 31;! return 30;! Predicates and clauses p1: c1 c2 ; c1: m <= 0, c2: m > 12! p2: c3; c3: m == 2;! p3: c4 (c5 && c6) ; c4: y % 400 == 0, c5: y % 4 == 0, c6: y % 100!= 0;! p4: c7; c7: m <= 7;! p5: c8; c8: m % 2 == 1;! p6: c9; c9: m % 2 == 0 10
11 Exercise 2 (solution) Predicates and clauses p1: c1 c2 ; c1: m <= 0, c2: m > 12! p2: c3; c3: m == 2;! p3: c4 (c5 && c6) ; c4: y % 400 == 0, c5: y % 4 == 0, c6: y % 100!= 0;! p4: c7; c7: m <= 7;! p5: c8; c8: m % 2 == 1;! p6: c9; c9: m % 2 == 0 TR(PC) = { p1, p1, p2, p2,, p6, p6 } TR(CC) = { c1, c1, c2, c2,, c9, c9 } TR(CoC) = { c1 c2, c1 c2, c1 c2, c1 c2, c4 c5 c6,, c4 c5 c6, same as CC for c3, c7,c8,c9 } 11
12 Reachability predicates public static int daysinmonth(int m, int y) {! if (m <= 0 m > 12) // p1! throw new IllegalArgumentException("Invalid month: " + m);! if (m == 2) { // p2! if (y % 400 == 0 (y % 4 == 0 && y % 100!= 0)) // p3! return 29;! Reachability predicates - r(p) 12 } else! return 28;! }! if (m <= 7) { // p4! if (m % 2 == 1) // p5! return 31;! return 30;! }! if (m % 2 == 0) // p6! return 31;! return 30;! r(p1) = true (always reached)! r(p2) = p1 = m > 0 m <= 12! r(p3) = r(p2) p2 = (m > 0 m <= 12 m == 2) = (m == 2)! r(p4) = r(p2) p2 = (m > 0 m <= 12 m!= 2)! r(p5) = r(p4) p4 = (m > 0 m <= 12 m!= 2) m <= 7! r(p6) = r(p4) p4 = (m > 0 m <= 12 m!= 2) m > 7 A reachability predicate r(p) expresses the logical conditions for p to be evaluated.
13 Exercise 3 public static int daysinmonth(int m, int y) {! if (m <= 0 m > 12) // p1! throw new IllegalArgumentException("Invalid month: " + m);! if (m == 2) { // p2! if (y % 400 == 0 (y % 4 == 0 && y % 100!= 0)) // p3! return 29;! } else! return 28;! }! if (m <= 7) { // p4! if (m % 2 == 1) // p5! return 31;! return 30;! }! if (m % 2 == 0) // p6! return 31;! return 30;! Reachability predicates - r(p) r(p1) = true (always reached)! r(p2) = p1 = m >= 0 m < 12! r(p3) = r(p2) p2 = (m > 0 m < 12 m == 2) = (m == 2)! r(p4) = r(p2) p2! r(p5) = r(p4) p4 = (m > 0 m < 12 m!= 2) m <= 7! r(p6) = r(p4) p4 = (m > 0 m < 12 m!= 2) m > 7 13 Identify test cases that satisfy PC, CC, CoC (in this order). Are there infeasible requirements?
14 Logic coverage of specifications Specifications of a software may also be subject to logical test coverage. For instance these may take the form of: Contracts: informal (e.g., Javadoc) or formal (e.g., JML) FSM abstractions 14
15 Example - a JML contract for Time.tick() public Time(int h, int m) { }! public int gethours() { }! public int getminutes() { }!! public requires getminutes() < ensures getminutes() == \old(getminutes()) + ensures gethours() == public requires getminutes() == 59 && gethours() < ensures getminutes() == ensures gethours() == \old(gethours()) + public requires getminutes() == 59 && gethours() == ensures getminutes() == ensures gethours() == public void tick() { } JML pre-conditions define the predicates of interest! 3 test cases will satisfy PC (and CC too). Identify them. 15
16 Example 2 - BoundedQueue.enqueue() /*@! public normal_behavior! requires!isfull();! ensures size() == \old(size()) + 1;! ensures elementat(\old(size())) == data;! ensures (\forall int i; i >= 0 && i < \old(size())! ==> elementat(i) == \old(elementat(i)));! also! public exceptional_behavior! requires isfull();! signals_only IllegalStateException;! */! void enqueue(e data) throws IllegalStateException;! We need to cover predicate /pre-condition isfull() See complete specification online and implementing class (BoundedQueue / BoundedArrayQueue). 16
17 Predicate determination PC and CC do not subsume one another and CoC may easily become unpractical or lead to too many infeasible requirements. How to ensure that clause-level test criteria also do have an effect on the predicate at stake? We will introduce the notion of determination: the conditions under which a clause solely determines the outcome of a predicate. For p = a ( b c ) the determination predicates are: d(a) = b c a determines p when b c! d(b) = a c b determines p when a c! d(c) = a b c determines p when a b 17
18 Determination (more formally) Determination predicate Let p P and c C p. We say that c determines p if there is a logical assignment (determination predicate) d(c) to all other clauses s.t. changing the value of c changes the value of p. Major and minor clauses [terminology] For a given c we are finding d(c) we call c the major clause and all other clauses the minor clauses. Finding the determination predicate d(c) = p [T / c ] p [F / c ] where p [X / c ] stands for p with every occurrence of the major clause c replaced by X [See example in the next slide] 18
19 Deriving determination predicates Finding the determination predicate d(c) = p [T / c ] p [F / c ] where p [X / c ] stands for p with every occurrence of the major clause c replaced by X Example 1 - taking p = a (b c)! d(a) = p [T / a ] p [F / a ] = (b c) F = b c! d(b) = p [T / b ] p [F / b ] = a (a c) = a c! d(c) = p [T / c ] p [F / c ] = a (a b) = a b! Example 2 - taking p = a (b c)! d(a) = p [T / a ] p [F / a ] = T (b c) = (b c) = b c! d(b) = p [T / b ] p [F / b ] = (a c ) a = a c! d(c) = p [T / c ] p [F / c ] = (a b ) a = a b 19
20 General Active Clause Coverage GACC criterion - For p P and c C p include two requirements in TR: (1) c d(c) (2) c d(c) Example: 2 predicates involving 5 clauses giving us 10 test requirements P= { p1, p2 } p1 = a ( b c ) p2 = x y TR(GACC) = { a d(a), a d(a), b d(b), b d(b), c d(c), c d(c), x d(x), x d(x), y d(y), y d(y) } d(a) = b c, d(b) = a c, d(c) = a b d(x) = y d(y) = x 20
21 GACC and subsumption of CC/PC By definition GACC subsumes CC... but not PC (though this may happen in many practical cases of interest) Example: for p = a b we have d(a) = T and d(b) = T... so TR(GACC) = { a, a, b, b } [Obs.: equivalent to TR(CC)] T = { [a = T, b=t ], [a=f, b=f] } satisfies GACC for p = a b but not PC. Both assignments to a and b yield p = T. T = { [a = T, b=f ], [a=f, b=t] } would also satisfy GACC but not PC. Both assignments to a and b yield p = F. Does GACC subsume PC? Not necessarily 21
22 Correlated Active Clause Coverage CACC criterion - For p P and c C p include two requirements in TR: (1) c d(c) (p = X) (2) c d(c) (p = X) where X { T, F}, that is, p must evaluate to T in one case and F in the other. By definition CACC subsumes GACC [thus CC] but also PC. In the previous slide s example: p = a b where d(a) = T and d(b) = T TR(CACC) = { a (p=x), a (p= X), b (p=y), b (p= Y) } T = { [a = T, b=t ], PC). [a=f, b=t], [a = T, b=f ] } satisfies CACC (and 22
23 GACC vs CACC (example) t a b c p = a (b c) Satisfies 1 T T T T a d(a) b d(b) c d(c) 2 T T F F b d(b) c d(c) 3 T F T F b d(b) c d(c) 4 T F F T a d(a) b d(b) c d(c) 5 F T T F a d(a) 6 F T F F 7 F F T F Determination!! d(a) = b c!! d(b) = a!! d(c) = a 8 F F F F a d(a) GACC is satisfied by { (1), (4), (5) } for instance. This choice of assignments will not cover the CACC requirements for b and c for the case where p must be false. CACC: can be satisfied by { (1), (2), (3), (5) }. Exercise: perform a similar analysis for p = a (b c). 23
24 Restricted Active Clause Coverage RACC criterion - For p P and c C p include two requirements in TR: (1) c p c (p = X) (2) c p c (p = X) where X { T, F}, that is, p must evaluate to T in one case and F in the other (as in CACC) but additionally: the minor clause assignments must be the same in both cases. Obs.: RACC subsumes CACC by definition. RACC imposes more uniform tests, but is also more likely to imply infeasible requirements. 24
25 CACC vs RACC (example) t a b c p = a (b c) Satisfies 1 T T T T a d(a) 2 T T F T a d(a) d(a) = b c 3 T F T T a d(a) 4 T F F F 5 F T T F a d(a) 6 F T F F a d(a) 7 F F T F a d(a) 8 F F F F 25 CACC coverage for a - 9 possible choices: (1), (2) or (3) combined with one of (5), (6), or (7). RACC coverage for a - only 3 possible choices: (1) combined with (5); (2) and (6); (3) and (7).
26 Example: isleapyear() public static boolean isleapyear(int y) {! return y % 400 == 0 (y % 4 == 0 && y % 100!= 0);! } a: y % 400 == 0 b: y % 4 == 0 c: y % 100!= 0! p: a (b c)!! d(a) = b c d(b) = a c d(c) = a b TR(GACC)={ (1) a ( b c), (2) a ( b c),! (3) b a c, (4) b a c,! c a b /* duplicate of (3) */, (5) c a b } y exp. value logical clause! values covered GACC requirements t true a b c (1) a ( b c) t false a b c t false a b c (2) a ( b c)! (4) b a c! (2) a ( b c)! (5) c a b 26 t true a b c (3) b a c
27 isleapyear() analysis public static boolean isleapyear(int y) {! return y % 400 == 0 (y % 4 == 0 && y % 100!= 0);! } y exp. value logical clause! values covered GACC requirements t true a b c (1) a ( b c) t false a b c t false a b c (2) a ( b c)! (4) b a c! (2) a ( b c)! (5) c a b t true a b c (3) b a c GACC coverage implies CACC coverage in this case RACC is also satisfied: (t1,t4) pair for a; (t2,t4) for b; (t3,t4) for c {t1, t2} satisfies CC and PC {t1, t3} satisfies PC but not CC CoC would lead to the following infeasible requirements 27 a b c, a b c, a b c, a b c
28 Exercise 4 public static TClass triangletype(int a, int b, int c) {! if (a <= 0 b <= 0 c <= 0) /* p1 */! return INVALID;! if (a >= b + c b >= a+c c >= a+b) /* p2 */! return INVALID;! } int count = 0;! if (a == b) /* p3 */! count++;! if (a == c) /* p4 */! count++;! if (b == c) /* p5 */! count++;! if (count == 0) /* p6 */! return SCALENE;! if (count == 1) /* p7 */! return ISOSCELES;! return EQUILATERAL;! Identify: 1) the reachability predicates; 2) TR(CC) and TR(PC) 3) test cases that satisfy a) PC b) CC 4) determination predicates for the clauses of p1 and p2 5) TR(CACC) 28 6) test cases that satisfy a) CACC b) RACC [are there infeasible requirements?]
Logic-based test coverage
Eduardo Marques, Vasco Thudichum Vasconcelos Logic-based test coverage Basic approach Clauses and predicates Basic coverage criteria: CC, PC, CoC Structural logic coverage of source code Logic coverage
More informationIntroduction 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 informationCombinatorial Clause Coverage CoC
Introduction to Software Testing Chapter 3.2 Logic Coverage Paul Ammann & Jeff Offutt Covering Logic Expressions Logic expressions show up in many situations Covering logic expressions is required by the
More informationAgenda. 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 informationIntroduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwaretest/ Ch. 3 : Logic Coverage Four Structures for Modeling Software Graphs
More informationIntroduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt www.introsoftwaretesting.com Ch. 3 : Logic Coverage Four Structures for Modeling Software Graphs Logic Input Space
More informationLogic Coverage for Source Code
Logic Coverage for Source Code CS 4501 / 6501 Software Testing [Ammann and Offutt, Introduction to Software Testing, Ch. 8] 1 Structural Logic Coverage for Source Code Aim: to identify test requirements
More informationLogic Coverage. Moonzoo Kim School of Computing KAIST. The original slides are taken from Chap. 8 of Intro. to SW Testing 2 nd ed by Ammann and Offutt
Logic Coverage Moonzoo Kim School of Computing KAIST The original slides are taken from Chap. 8 of Intro. to SW Testing 2 nd ed by Ammann and Offutt Covering Logic Expressions Logic expressions show up
More informationCOMP 3705 Advanced Software Engineering: Software Testing
COMP 3705 Advanced Software Engineering: Software Testing Prof. Matt Rutherford For Next Week Readings For Midterm: Chapter 1 and Sections 2.1-2.6, 3.1 3.5 New material: Chapter 4 Homework #5 http://mjrutherford.org/teaching/2009/winter/comp3705/homeworks
More informationLogic Coverage from Source Code
Logic Coverage from Source Code Moonzoo Kim School of Computing KAIST The original slides are taken from Chap. 8 of Intro. to SW Testing 2 nd ed by Ammann and Offutt Logic Expressions from Source Predicates
More informationIntroduc)on to So,ware Tes)ng (2nd edi(on) Overview Graph Coverage Criteria. Paul Ammann & Jeff OffuA. hap:// so,waretest/
Tes)ng (2nd edi(on) Overview Graph Coverage Criteria Paul Ammann & Jeff OffuA hap://www.cs.gmu.edu/~offua/ so,waretest/ First version, 23 September 2013 Graph Coverage Four Structures for Modeling Software
More informationTesting: (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 informationIntroduction. 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 informationIntroduction to Software Testing Chapter 3, Sec# 3.3 Logic Coverage for Source Code
Introduction to Software Testing Chapter 3, Sec# 3.3 Logic Coverage for Source Code Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/soft waretest/ Logic Expressions from Source Predicates are derived
More informationLecture 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 informationLecture 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 informationDRAFT: Prepublication draft, Fall 2014, George Mason University Redistribution is forbidden without the express permission of the authors
Chapter 9 Syntax-based Testing Date last generated: September 29, 2014. DRAFT: Prepublication draft, Fall 2014, George Mason University Redistribution is forbidden without the express permission of the
More informationFormal Methods for Java
Formal Methods for Java Lecture 6: Introduction to JML Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg May 15, 2017 Jochen Hoenicke (Software Engineering) Formal Methods for Java
More informationThe Java Modeling Language JML
The Java Modeling Language JML Néstor Cataño ncatano@puj.edu.co Faculty of Engineering Pontificia Universidad Javeriana The Java Modelling Language JML p.1/47 Lecture Plan 1. An Introduction to JML 2.
More informationSoftware Testing - Introduction -
Software Testing - Introduction - Bugs? What is testing? The RIP model. How important is testing? Test case, test requirement, coverage criteria, coverage level, criteria subsumption. An introduction to
More informationTesting, Debugging, Program Verification
Testing, Debugging, Program Verification Automated Test Case Generation, Part II Wolfgang Ahrendt & Vladimir Klebanov & Moa Johansson 12 December 2012 TDV: ATCG II /GU 2011-12-12 1 / 17 Recap Specification-/Model-Based
More informationCS 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 informationIntroduction 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 informationSoftware 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 informationProgramming 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 informationEVALUATING THE EFFECTIVENESS OF TEST COVERAGE CRITERIA USING MUTATION ANALYSIS. An evaluation of test coverage criteria in C#
EVALUATING THE EFFECTIVENESS OF TEST COVERAGE CRITERIA USING MUTATION ANALYSIS An evaluation of test coverage criteria in C# Examensarbete inom huvudområdet Informationsteknologi Grundnivå 30 Högskolepoäng
More informationSoftware 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 informationRigorous Software Development CSCI-GA
Rigorous Software Development CSCI-GA 3033-009 Instructor: Thomas Wies Spring 2013 Lecture 6 Disclaimer. These notes are derived from notes originally developed by Jochen Hoenicke. They are copyrighted
More informationPath Testing + Coverage. Chapter 8
Path Testing + Coverage Chapter 8 Structural Testing n Also known as glass/white/open box testing n A software testing technique whereby explicit knowledge of the internal workings of the item being tested
More informationAn 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 informationTRIAL EXAM C Software Engineering using Formal Methods TDA293 / DIT270
TRIAL EXAM C Software Engineering using Formal Methods TDA293 / DIT270 also serving as additional training material for the course Formal Methods for Software Development, TDA294/DIT271 1 Exam/Tenta SEFM
More informationBlack-Box, Functional Testing
Black-Box, Functional Testing 1 Introduction Based on the definition of what a program s specification, as opposed to its structure Does the implementation correctly implement the functionality as per
More informationModel Transformation Impact on Test Artifacts: An Empirical Study
Model Transformation Impact on Test Artifacts: An Empirical Study Anders Eriksson Informatics Research Center University of Skövde, Sweden anders.eriksson@his.se Birgitta Lindström Sten F. Andler Informatics
More informationSoftware 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 informationFormal Methods for Software Development
Formal Methods for Software Development Java Modeling Language, Part II Wolfgang Ahrendt 29 September 2017 FMSD: Java Modeling Language /GU 171029 1 / 62 JML Modifiers JML extends the JAVA modifiers by
More informationTesting: 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 informationCS 112 Introduction to Programming
CS 112 Introduction to Programming Conditional Statements Boolean Expressions and Methods Yang (Richard) Yang Computer Science Department Yale University 308A Watson, Phone: 432-6400 Email: yry@cs.yale.edu
More informationCS 112 Introduction to Programming
CS 112 Introduction to Programming Conditional Statements Boolean Expressions and Methods Yang (Richard) Yang Computer Science Department Yale University 308A Watson, Phone: 432-6400 Email: yry@cs.yale.edu
More informationFormale Entwicklung objektorientierter Software
Formale Entwicklung objektorientierter Software Praktikum im Wintersemester 2008/2009 Prof. P. H. Schmitt Christian Engel, Benjamin Weiß Institut für Theoretische Informatik Universität Karlsruhe 5. November
More informationReasoning About Imperative Programs. COS 441 Slides 10
Reasoning About Imperative Programs COS 441 Slides 10 The last few weeks Agenda reasoning about functional programming It s very simple and very uniform: substitution of equal expressions for equal expressions
More information7. Testing and Debugging Concurrent Programs
7. Testing and Debugging Concurrent Programs The purpose of testing is to find program failures => A successful test is a test that causes a program to fail. Ideally, tests are designed before the program
More informationSTRUCTURAL 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 informationProgramming with Contracts. Juan Pablo Galeotti, Alessandra Gorla Saarland University, Germany
Programming with Contracts Juan Pablo Galeotti, Alessandra Gorla Saarland University, Germany Contract A (formal) agreement between Method M (callee) Callers of M Rights Responsabilities Rights Responsabilities
More informationJML What are model fields? Translation to JavaDL Demo. JML Model Fields. Christian Engel. ITI, Universität Karlsruhe. 08.
ITI, Universität Karlsruhe 08. Juni 2005 Outline JML 1 JML 2 3 4 JML JML...... is a specification language tailored to Java. JML JML...... is a specification language tailored to Java.... serves as an
More informationMTAT : 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 informationCS 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 information6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )
6. Combinational Circuits George Boole (85 864) Claude Shannon (96 2) Signals and Wires Digital signals Binary (or logical ) values: or, on or off, high or low voltage Wires. Propagate digital signals
More informationJava Modelling Language (JML) References
Java Modelling Language (JML) References www.jmlspecs.org G. T. Leavens and Y. Cheon, Design by Contract with JML, August 2005. C. Marché, C. Paulin-Mohring, and X. Urbain, The Krakatoa Tool for Cerification
More informationTesting: 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 informationJML. Java Modeling Language
JML Java Modeling Language Overview About the JML Project DBC Design By Contract JML concepts, examples, syntax and capabilities Basics Exceptions Invariants Assertions Quantifiers Other keywords JML hiding
More informationAdvanced JML Erik Poll Radboud University Nijmegen
JML p.1/23 Advanced JML Erik Poll Radboud University Nijmegen JML p.2/23 Core JML Remember the core JML keywords were requires ensures signals invariant non null pure \old, \forall, \result JML p.3/23
More informationMTAT : 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 informationProgramming 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 informationSTRUCTURAL 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 informationBoolean Representations and Combinatorial Equivalence
Chapter 2 Boolean Representations and Combinatorial Equivalence This chapter introduces different representations of Boolean functions. It then discusses the applications of these representations for proving
More informationEquivalence Class Partitioning. Equivalence Partitioning. Definition and Example. Example set of classes
Equivalence Class Partitioning Equivalence Partitioning From S. Somé, A. Williams 1 Suppose that we were going to test a method that implements the absolute value function for integers. Definition public
More informationWhat 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 informationAdvanced Topics Combining S. M. T
Advanced Topics Combining S. M. T 1 an empirical study of predicate dependence levels and trends Icse 2003 david binkley mark harman Or How to use slicing to measure testability 2 overview evolutionary
More informationMTAT : 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 informationStructural 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 informationGEARMOTORS AF MOTORS FOR INVERTER C-1
C-1 C-2 C-3 C-4 R R C-5 C-6 C-7 1.47 14.7 584Hz 438Hz 318Hz 270Hz 234Hz 206Hz 167Hz 140Hz 121Hz 100Hz 81.4Hz 68.6Hz 59.4Hz 49.2Hz 40.2Hz 33.7Hz 28.9Hz 24.5Hz 21.2Hz 17.9Hz 15.2Hz 12.8Hz 3.11 4.15 5.70
More informationModern Methods in Software Engineering. Testing.
Modern Methods in Software Engineering Testing www.imit.kth.se/courses/2g1522 Literature used Text book Chapter 11 Introduction Content Terminology Types of errors Dealing with errors Component Testing
More informationInput Space Partitioning
Input Space Partitioning Instructor : Ali Sharifara CSE 5321/4321 Summer 2017 CSE 5321/4321, Ali Sharifara, UTA 1 Input Space Partitioning Introduction Equivalence Partitioning Boundary-Value Analysis
More informationPropositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson
Propositional Calculus: Boolean Algebra and Simplification CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Topics Motivation: Simplifying Conditional Expressions
More informationTesting 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 informationMTAT : 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 informationAdvanced 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 informationSubject 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 informationIntroduction 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 informationMTAT : 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 informationStructural 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 informationQuantification. Using the suggested notation, symbolize the statements expressed by the following sentences.
Quantification In this and subsequent chapters, we will develop a more formal system of dealing with categorical statements, one that will be much more flexible than traditional logic, allow a deeper analysis
More informationDataflow-based Coverage Criteria
Dataflow-based Coverage Criteria W. Eric Wong Department of Computer Science The University of Texas at Dallas ewong@utdallas.edu http://www.utdallas.edu/~ewong Dataflow-based Coverage Criteria ( 2012
More informationPropositional Calculus. Math Foundations of Computer Science
Propositional Calculus Math Foundations of Computer Science Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they can use it to
More informationMSc 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 informationOverview 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 informationCSE431 Translation of Computer Languages
CSE431 Translation of Computer Languages Semantic Analysis Doug Shook Control Structure Analysis Three major phases for Java: Type Checking How might this apply to control structures? Reachability Analysis
More informationJava Modelling Language (JML) References
Java Modelling Language (JML) References G. T. Leavens and Y. Cheon. Design by Contract with JML, August 2005. L. Burdy, Y. Cheon, D. Cok, M. Ernst, J. Kiniry, G. T. Leavens, K. R. M. Leino, and E. Poll.
More informationSE 3S03 - Tutorial 10. Helen Brown. Week of Mar 23, 2015
SE 3S03 - Tutorial 10 Department of Computing and Software McMaster University Week of Mar 23, 2015 : Acknowledgments: The material of these slides is based on [1] 1/34 Outline Edge : Path : 2/34 Recall
More informationIntroduction to Software Testing Chapter 2.3 Graph Coverage for Source Code. Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt Overview The most common application of graph criteria is to program source Graph : Usually the control
More informationOverview The Java Modeling Language (Part 1) Related Work
Overview The Java Modeling Language (Part 1) Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at
More informationFormal Specification and Verification
Formal Specification and Verification Proof Obligations Bernhard Beckert Based on a lecture by Wolfgang Ahrendt and Reiner Hähnle at Chalmers University, Göteborg Formal Specification and Verification:
More informationTest 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 informationData Flow Coverage 1. Stuart Anderson. Stuart Anderson Data Flow Coverage 1 c 2011
Data Flow Coverage 1 Stuart Anderson Why Consider Data Flow? 1 Control Flow: Statement and branch coverage criteria are weak. Condition coverage and path coverage are more costly and can become infeasible.
More informationCS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F
1 Logical Operations 1.1 And The and operator is a binary operator, denoted as, &,, or sometimes by just concatenating symbols, is true only if both parameters are true. A B A B F T F F F F The expression
More informationQueues. CITS2200 Data Structures and Algorithms. Topic 5
CITS2200 Data Structures and Algorithms Topic 5 Queues Implementations of the Queue ADT Queue specification Queue interface Block (array) representations of queues Recursive (linked) representations of
More informationAnnouncements. Specifications. Outline. Specifications. HW1 is due Thursday at 1:59:59 pm
Announcements HW1 is due Thursday at 1:59:59 pm Specifications 2 Outline Specifications Benefits of specifications Specification conventions Javadoc JML PoS specifications Specifications A specification
More informationInput validation - wrap-up discussion & complementary aspects -
Input validation - wrap-up discussion & complementary aspects - Questões de Segurança em Engenharia de Software (QSES) Mestrado em Segurança Informática Departamento de Ciência de Computadores Faculdade
More informationFormal Methods for Java
Formal Methods for Java Lecture 1: Introduction Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg October 26, 2011 Jochen Hoenicke (Software Engineering) Formal Methods for Java October
More informationEXERCISES (Software Engineering)
Chapter 1 1. What is Software Engineering? 2. What is Requirement Engineering? EXERCISES (Software Engineering) 3. What are the Different types of Architectures in Software Engineering? 4. How many subdisciplines
More informationSpecification-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 informationThe Java Modeling Language (Part 1)
The Java Modeling Language (Part 1) Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at
More informationFault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13
Fault-based testing Automated testing and verification J.P. Galeotti - Alessandra Gorla slides by Gordon Fraser How good are my tests? How good are my tests? Path testing Boundary interior testing LCSAJ
More informationProgram-based Mutation Testing
Program-based Mutation Testing CS 4501 / 6501 Software Testing [Ammann and Offutt, Introduction to Software Testing, Ch. 9.2] 1 Applying Syntax-Based Testing to Programs Test requirements are derived from
More informationAdvanced JML. and more tips and pitfalls. David Cok, Joe Kiniry, and Erik Poll
Advanced JML and more tips and pitfalls David Cok, Joe Kiniry, and Erik Poll Eastman Kodak Company, University College Dublin, and Radboud University Nijmegen David Cok, Joe Kiniry & Erik Poll - ESC/Java2
More informationThe Effectiveness of Test Coverage Criteria for Relational Database Schema Integrity Constraints
The Effectiveness of Test Coverage Criteria for Relational Database Schema Integrity Constraints PHIL MCMINN and CHRIS J. WRIGHT, University of Sheffield GREGORY M. KAPFHAMMER, Allegheny College Despite
More informationMSc 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 informationSoftware 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 informationIntroduction to Boolean logic and Logical Gates
Introduction to Boolean logic and Logical Gates Institute of Statistics Fall 2014 We saw the importance of the binary number system for data representation in a computer system. We ll see that the construction
More informationFormal Specification and Verification
Formal Specification and Verification Formal Specification, Part III Bernhard Beckert Adaptation of slides by Wolfgang Ahrendt Chalmers University, Gothenburg, Sweden Formal Specification and Verification:
More information