Paul Ammann & Jeff Offutt

Slides:



Advertisements
Similar presentations
Introduction to Software Testing Chapter 1
Advertisements

Introduction to Software Testing Chapter 3.3 Logic Coverage for Source Code Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.3 Logic Coverage from Source Code Paul Ammann & Jeff Offutt.
Paul Ammann & Jeff Offutt
Software Testing Logic Coverage. Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Logic Coverage Four Structures for Modeling Software Graphs.
Introduction to Software Testing Chapter 8.3 Logic Coverage for Source Code Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 1 Paul Ammann & Jeff Offutt SUMMARY OF PARTS 1 AND 2 FROM LAST WEEK.
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 5.5 Input Space Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.5 Input Space Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
ITEC200 Week02 Program Correctness and Efficiency.
Introduction to Software Testing Chapter 3.1 Logic Coverage Paul Ammann & Jeff Offutt.
Introduction to Software Testing Chapter 9.1 Syntax-based Testing Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 8.2
Introduction to Software Testing Chapter 5.5 Input Space Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.4 Model-Based Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 8.1 Logic Coverage Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 2.5 Graph Coverage for Specifications Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapters 1-5 Coverage Summary Paul Ammann & Jeff Offutt
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Introduction to Software Testing (2nd edition) Chapter 7.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.2 Program-based Grammars Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.1 Logic Coverage Paul Ammann & Jeff Offutt.
Introduction to Software Testing Chapter 3.4 Logic Coverage for Specifications Paul Ammann & Jeff Offutt
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 8.5 Logic Coverage for FSMs Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 8.2
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Truth Table to Statement Form
Introduction to Software Testing Chapter 8.1 Logic Coverage
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Introduction to Software Testing Chapter 3.5 Logic Coverage for FSMs
Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage
Logic Coverage CS 4501 / 6501 Software Testing
Introduction to Software Testing Chapter 5.1 Syntax-based Testing
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Programming Languages 2nd edition Tucker and Noonan
Introduction to Software Testing Chapter 8.5 Logic Coverage for FSMs
Introduction to Software Testing Chapter 3, Sec# 3.5
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.5 Logic Coverage for FSMs
Logic Coverage CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Logic Coverage Active Clause Coverage CS 4501 / 6501 Software Testing
Logic Coverage for Source Code CS 4501 / 6501 Software Testing
Introduction to Software Testing Chapter 5.1 Syntax-based Testing
Introduction to Software Testing Chapter 8.1 Logic Coverage
Introduction to Software Testing Chapter 8.5 Logic Coverage for FSMs
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Programming Languages 2nd edition Tucker and Noonan
Introduction to Software Testing Chapter 3.1, 3.2 Logic Coverage
Presentation transcript:

Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwaretest/ Introduction to Software Testing Chapter 8.4 Logic Coverage for Specifications Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwaretest/

Specifications in Software Specifications can be formal or informal Formal specs are usually expressed mathematically Informal specs are usually expressed in natural language Lots of formal languages and informal styles are available Most specification languages include explicit logical expressions, so it is very easy to apply logic coverage criteria Implicit logical expressions in natural-language specifications should be re-written as explicit logical expressions as part of test design You will often find mistakes One of the most common is preconditions … Introduction to Software Testing, Edition 2 (Ch 8) © Ammann & Offutt

Preconditions Programmers often include preconditions for their methods The preconditions are often expressed in comments in method headers Preconditions can be in javadoc, “requires”, “pre”, … Example – Saving addresses // name must not be empty // state must be valid // zip must be 5 numeric digits // street must not be empty // city must not be empty Conjunctive Normal Form I stop before the “Rewriting to …” box and ask the students to write the predicate formally. Rewriting to logical expression name != “”  state in stateList  zip >= 00000  zip <= 99999  street != “”  city != “” Introduction to Software Testing, Edition 2 (Ch 8) © Ammann & Offutt

Shortcut for Predicates in Conjunctive Normal Form A predicate is in conjunctive normal form (CNF) if it consists of clauses or disjuncts connected by the and operator A  B  C  … (A  B)  (C  D) A major clause is made active by making all other clauses true ACC tests are “all true” and then a “diagonal” of false values: A B C … 1 T 2 F 3 4 . I stop before the “ACC tests are ‘all true’ …” and ask the students to work out ACC for A & B & C Introduction to Software Testing, Edition 2 (Ch 8) © Ammann & Offutt

Shortcut for Predicates in Disjunctive Normal Form A predicate is in disjunctive normal form (DNF) if it consists of clauses or conjuncts connected by the or operator A  B  C  … (A  B)  (C  D) A major clause is made active by making all other clauses false ACC tests are “all false” and then a “diagonal” of true values: A B C … 1 F 2 T 3 4 . I stop before the “ACC tests are ‘all true’ …” and ask the students to work out ACC for A & B & C Introduction to Software Testing, Edition 2 (Ch 8) © Ammann & Offutt

Summary : Logic Coverage for Specs Logical specifications can come from lots of places : Preconditions Java asserts Contracts (in design-by-contract development) OCL conditions Formal languages Logic specifications can describe behavior at many levels : Methods and classes (unit and module testing) Connections among classes and components System-level behavior Many predicates in specifications are in disjunctive normal or conjunctive normal form—simplifying the computations Introduction to Software Testing, Edition 2 (Ch 8) © Ammann & Offutt