Ch3-1-2-overviewLogicExpr

Ch3-1-2-overviewLogicExpr - Introduction to Software...

This preview shows pages 1–5. Sign up to view the full content.

1 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 Logic Input Space Syntax Applied to FSMs Source Applied to Applied to Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Use cases Specs Design Source DNF Specs Input Models Integ Source

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Covering Logic Expressions (3.1) Logic expressions show up in many situations Covering logic expressions is required by the US Federal Aviation Administration for safety critical software Logical expressions can come from many sources Decisions in programs FSMs and statecharts Requirements Introduction to Software Testing (Ch 3) © Ammann & Offutt 3 Tests are intended to choose some subset of the total number of truth assignments to the expressions Logic Predicates and Clauses A predicate is an expression that evaluates to a boolean value Predicates can contain boolean variables non-boolean variables that contain >, <, ==, >=, <=, != boolean function calls Internal structure is created by logical operators ¬–the negation operator –the and operator or operator implication operator Introduction to Software Testing (Ch 3) © Ammann & Offutt 4 exclusive or operator equivalence operator A clause is a predicate with no logical operators
3 Examples (a < b) f (z) D (m >= n*o) Four clauses: (a < b) – relational expression f( )bl ld f t i f (z) – boolean-valued function D – boolean variable (m >= n*o) – relational expression Most predicates have few clauses It would be nice to quantify that claim! Sources of predicates Decisions in programs Introduction to Software Testing (Ch 3) © Ammann & Offutt 5 Guards in finite state machines Decisions in UML activity graphs Requirements, both formal and informal SQL queries Humans have trouble translating from Translating from English “I am interested in SWE 637 and CS 652” course = swe637 OR course = cs652 English to Logic “If you leave before 6:30 AM, take Braddock to 495, if you leave after 7:00 AM, take Prosperity to 50, then 50 to 495” time < 6:30 path = Braddock time > 7:00 path = Prosperity Hmm this is incomplete Introduction to Software Testing (Ch 3) © Ammann & Offutt 6 Hmm … this is incomplete ! time < 6:30 path = Braddock time >= 6:30 path = Prosperity

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Testing and Covering Predicates (3.2) We use predicates in testing as follows : Developing a model of the software as one or more predicates Requiring tests to satisfy some combination of clauses Abbreviations: P is the set of predicates p is a single predicate in P C is the set of clauses in P Introduction to Software Testing (Ch 3) © Ammann & Offutt 7 C p is the set of clauses in predicate p c is a single clause in C Predicate and Clause Coverage The first (and simplest) two criteria require that each predicate
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 15

Ch3-1-2-overviewLogicExpr - Introduction to Software...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online