Introduction to Software Testing Chapter 3.4 Logic Coverage for Specifications Paul Ammann & Jeff Offutt www.introsoftwaretesting.com.

Slides:



Advertisements
Similar presentations
Geometry Logic.
Advertisements

Introduction to Software Testing Chapter 1
TRUTH TABLES Section 1.3.
TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Truth Tables Presented by: Tutorial Services The Math Center.
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.
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 3.1, 3.2 Logic Coverage Paul Ammann & Jeff Offutt
1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: The Moon is made of green cheese. Trenton.
Introduction to Software Testing Chapter 1 Paul Ammann & Jeff Offutt SUMMARY OF PARTS 1 AND 2 FROM LAST WEEK.
Introduction to Software Testing Chapter 9.2 Challenges in Testing Software – Software Testability Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 5.5 Input Space Grammars Paul Ammann & Jeff Offutt
Discussion #18 1/13 Discussion #18 Resolution with Propositional Calculus; Prenex Normal Form.
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Gates and Circuits. Three Main Gates  AND  OR  NOT.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Introduction to Software Testing Chapter 3.1 Logic Coverage Paul Ammann & Jeff Offutt.
Introduction to Software Testing Chapter 8.2
Chapter 3 Introduction to Logic © 2008 Pearson Addison-Wesley. All rights reserved.
Truth Tables for Negation, Conjunction, and Disjunction.
3.2 – Truth Tables and Equivalent Statements
Intro to Discrete Structures
Introduction to Software Testing Chapter 5.2 Program-based Grammars Paul Ammann & Jeff Offutt
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 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Introduction to Software Testing Chapter 8.1 Logic Coverage Paul Ammann & Jeff Offutt
Math 240: Transition to Advanced Math Deductive reasoning: logic is used to draw conclusions based on statements accepted as true. Thus conclusions are.
Introduction to Software Testing Chapter 8.1 Building Testing Tools –Instrumentation Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 5.1 Syntax-based Testing 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
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
Conditional Statements
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
How do I show that two compound propositions are logically equivalent?
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria 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.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Chapter 1 Logic and proofs
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Logical functors and connectives. Negation: ¬ The function of the negation is to reverse the truth value of a given propositions (sentence). If A is true,
Introduction to Software Testing Chapter 8.2
Introduction to Software Testing Chapter 8.1 Logic Coverage
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Software Testing Syntactic Logic Coverage Criteria
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.5 Logic Coverage for FSMs
Introduction to Software Testing Chapter 5.1 Syntax-based Testing
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 8.5 Logic Coverage for FSMs
Introduction to Software Testing Chapter 3, Sec# 3.5
Introduction to Software Testing Chapter 3.5 Logic Coverage for FSMs
Paul Ammann & Jeff Offutt
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
Presentation transcript:

Introduction to Software Testing Chapter 3.4 Logic Coverage for Specifications Paul Ammann & Jeff Offutt

Introduction to Software Testing (Ch 3), © Ammann & Offutt 2 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 (Ch 3), © Ammann & Offutt 3 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 Rewriting to logical expression name != “”  state in stateList  zip >=  zip <=  street != “”  city != “”

Introduction to Software Testing (Ch 3), © Ammann & Offutt 4 Shortcut for Conjunctive Clauses Conjunctive clauses are connected only by the and operator Each major clause is made active by making all other clauses true The tests are “all true” and then a “diagonal” of false values: ABC… 1TTT 2FTT… 3TFT 4TTF......

Introduction to Software Testing (Ch 3), © Ammann & Offutt 5 Shortcut for Disjunctive Clauses Disjunctive clauses are connected only by the or operator Each major clause is made active by making all other clauses false The tests are “all false” and then a “diagonal” of true values: ABC… 1FFF 2TFF… 3FTF 4FFT......

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 Logical 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 (Ch 3), © Ammann & Offutt 6