Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt

Similar documents
23.2. Representing Periodic Functions by Fourier Series. Introduction. Prerequisites. Learning Outcomes

Final Spring 2007

Chapter 2. First Order Scalar Equations

Vehicle Arrival Models : Headway

A NOTE ON THE STRUCTURE OF BILATTICES. A. Avron. School of Mathematical Sciences. Sackler Faculty of Exact Sciences. Tel Aviv University

10. State Space Methods

Finish reading Chapter 2 of Spivak, rereading earlier sections as necessary. handout and fill in some missing details!

Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

On Measuring Pro-Poor Growth. 1. On Various Ways of Measuring Pro-Poor Growth: A Short Review of the Literature

Two Coupled Oscillators / Normal Modes

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Matlab and Python programming: how to get started

2.7. Some common engineering functions. Introduction. Prerequisites. Learning Outcomes

Econ107 Applied Econometrics Topic 7: Multicollinearity (Studenmund, Chapter 8)

Chapter 2 Summary. Carnegie Learning

11!Hí MATHEMATICS : ERDŐS AND ULAM PROC. N. A. S. of decomposiion, properly speaking) conradics he possibiliy of defining a counably addiive real-valu

Predator - Prey Model Trajectories and the nonlinear conservation law

Challenge Problems. DIS 203 and 210. March 6, (e 2) k. k(k + 2). k=1. f(x) = k(k + 2) = 1 x k

Echocardiography Project and Finite Fourier Series

On Detecting Double Faults Related to Term and Literal in Boolean Expression Was: Detecting Double Faults Related to Term and Literal

5.1 - Logarithms and Their Properties

KEY. Math 334 Midterm III Winter 2008 section 002 Instructor: Scott Glasgow

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

Demodulation of Digitally Modulated Signals

Let us start with a two dimensional case. We consider a vector ( x,

This document was generated at 1:04 PM, 09/10/13 Copyright 2013 Richard T. Woodward. 4. End points and transversality conditions AGEC

Some Basic Information about M-S-D Systems

Lab #2: Kinematics in 1-Dimension

ACE 562 Fall Lecture 5: The Simple Linear Regression Model: Sampling Properties of the Least Squares Estimators. by Professor Scott H.

THE BERNOULLI NUMBERS. t k. = lim. = lim = 1, d t B 1 = lim. 1+e t te t = lim t 0 (e t 1) 2. = lim = 1 2.

Inventory Analysis and Management. Multi-Period Stochastic Models: Optimality of (s, S) Policy for K-Convex Objective Functions

!!"#"$%&#'()!"#&'(*%)+,&',-)./0)1-*23)

2. Nonlinear Conservation Law Equations

The Fundamental Theorems of Calculus

Section 4.4 Logarithmic Properties

Hamilton- J acobi Equation: Explicit Formulas In this lecture we try to apply the method of characteristics to the Hamilton-Jacobi equation: u t

KEY. Math 334 Midterm III Fall 2008 sections 001 and 003 Instructor: Scott Glasgow

AP Chemistry--Chapter 12: Chemical Kinetics

ON THE DEGREES OF RATIONAL KNOTS

Lie Derivatives operator vector field flow push back Lie derivative of

INSTANTANEOUS VELOCITY

Robust estimation based on the first- and third-moment restrictions of the power transformation model

20. Applications of the Genetic-Drift Model

14 Autoregressive Moving Average Models

Chapter Floating Point Representation

Non-uniform circular motion *

WEEK-3 Recitation PHYS 131. of the projectile s velocity remains constant throughout the motion, since the acceleration a x

Linear Response Theory: The connection between QFT and experiments

Math Week 14 April 16-20: sections first order systems of linear differential equations; 7.4 mass-spring systems.

ERROR LOCATING CODES AND EXTENDED HAMMING CODE. Pankaj Kumar Das. 1. Introduction and preliminaries

Almost Sure Degrees of Truth and Finite Model Theory of Łukasiewicz Fuzzy Logic

Second Order Linear Differential Equations

Kinematics and kinematic functions

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

An Excursion into Set Theory using a Constructivist Approach

SMT 2014 Calculus Test Solutions February 15, 2014 = 3 5 = 15.

Class Meeting # 10: Introduction to the Wave Equation

Matrix Versions of Some Refinements of the Arithmetic-Geometric Mean Inequality

Section 3.5 Nonhomogeneous Equations; Method of Undetermined Coefficients

Chapter 8 The Complete Response of RL and RC Circuits

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

Introduction to Probability and Statistics Slides 4 Chapter 4

KINEMATICS IN ONE DIMENSION

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

15. Vector Valued Functions

Diebold, Chapter 7. Francis X. Diebold, Elements of Forecasting, 4th Edition (Mason, Ohio: Cengage Learning, 2006). Chapter 7. Characterizing Cycles

KEY. Math 334 Midterm I Fall 2008 sections 001 and 003 Instructor: Scott Glasgow

Traveling Waves. Chapter Introduction

DIFFERENTIAL GEOMETRY HW 5

Logic in computer science

Learning a Class from Examples. Training set X. Class C 1. Class C of a family car. Output: Input representation: x 1 : price, x 2 : engine power

Chapter 7: Solving Trig Equations

( ) ( ) if t = t. It must satisfy the identity. So, bulkiness of the unit impulse (hyper)function is equal to 1. The defining characteristic is

The expectation value of the field operator.

Chapter #1 EEE8013 EEE3001. Linear Controller Design and State Space Analysis

EE100 Lab 3 Experiment Guide: RC Circuits

1 Review of Zero-Sum Games

Solutions from Chapter 9.1 and 9.2

Christos Papadimitriou & Luca Trevisan November 22, 2016

ACE 564 Spring Lecture 7. Extensions of The Multiple Regression Model: Dummy Independent Variables. by Professor Scott H.

On the Infinitude of Covering Systems with Least Modulus Equal to 2

Bias in Conditional and Unconditional Fixed Effects Logit Estimation: a Correction * Tom Coupé

MA 366 Review - Test # 1

Learning a Class from Examples. Training set X. Class C 1. Class C of a family car. Output: Input representation: x 1 : price, x 2 : engine power

Solutions to Assignment 1

Math 10B: Mock Mid II. April 13, 2016

Module 2 F c i k c s la l w a s o s f dif di fusi s o i n

TEACHER NOTES MATH NSPIRED

Forecasting optimally

Advanced Digital Design with the Verilog HDL, Second Edition Michael D. Ciletti Prentice Hall, Pearson Education, 2011

ES.1803 Topic 22 Notes Jeremy Orloff

4.1 - Logarithms and Their Properties

Lecture 10: The Poincaré Inequality in Euclidean space

8. Basic RL and RC Circuits

Comparing Means: t-tests for One Sample & Two Related Samples

Math 315: Linear Algebra Solutions to Assignment 6

Announcements: Warm-up Exercise:

Sections 2.2 & 2.3 Limit of a Function and Limit Laws

Chapter 2. Models, Censoring, and Likelihood for Failure-Time Data

Transcription:

Inroducion o Sofware Tesing Chaper 3.6 Disjuncive Normal Form Crieria Paul Ammann & Jeff Offu hp://www.cs.gmu.edu/~offu/sofwarees/

Disjuncive Normal Form Common Represenaion for Boolean Funcions Slighly Differen Noaion for Operaors Slighly Differen Terminology Basics: A lieral is a clause or he negaion (oversrike) of a clause Examples: a, a A erm is a se of lierals conneced by logical and and is denoed by adjacency insead of Examples: ab, ab, ab for a b, a b, a b A (disjuncive normal form) predicae is a se of erms conneced by or or is denoed by + insead of Examples: abc + ab + ac Terms are also called implicans If a erm is rue, ha implies he predicae is rue Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 2

Implican Coverage Obvious coverage idea: Make each implican evaluae o rue. Problem: Only ess rue cases for he predicae. Soluion: Include DNF represenaions for negaion. Implican Coverage (IC) : Given DNF represenaions of a predicae f and is negaion f,, for each implican in f and f,, TR conains he requiremen ha he implican evaluae o rue. Example: f = ab + bc f = b + ac Implicans: { ab, bc, b, ac } Possible es se: {TTF, FFT} Observaion: IC is relaively weak Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 3

Improving on Implican Coverage Addiional Definiions: A proper suberm is a erm wih one or more clauses removed Example: abc has 6 proper suberms: a, b, c, ab, ac, bc A prime implican is an implican such ha no proper suberm is also an implican. Example: f = ab + abc Implican ab is a prime implican Implican abc is no a prime implican (due o proper suberm ac) A redundan implican is an implican ha can be removed wihou changing he value of he predicae Example: f = ab + ac + bc ab is redundan Predicae can be wrien: ac + bc Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 4

Unique True Poins A minimal DNF represenaion is one wih only prime, nonredundan implicans. A unique rue poin wih respec o a given implican is an assignmen of ruh values so ha he given implican is rue, and all oher implicans are false Hence a unique rue poin es focuses on jus one implican A minimal represenaion guaranees he exisence of a leas one unique rue poin for each implican Unique True Poin Coverage (UTPC) : Given minimal DNF represenaions of a predicae f and is negaion f,, TR conains a unique rue poin for each implican in f and f. Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 5

Unique True Poin Example Consider again: f = ab + bc f = b + ac Implicans: { ab, bc, b, ac } Each of hese implicans is prime None of hese implicans is redundan Unique rue poins: ab: {TTT} bc: {FTF} b: {FFF, TFF, TFT} ac: {FTT} Noe ha here are hree possible (minimal) ess saisfying UTPC UTPC is fairly powerful Exponenial in general, bu reasonable cos for many common funcions No subsumpion relaion wr any of he ACC or ICC Crieria Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 6

Near False Poins A near false poin wih respec o a clause c in implican i is an assignmen of ruh values such ha f is false, bu if c is negaed (and all oher clauses lef as is), i (and hence f) evaluaes o rue. Relaion o deerminaion: a a near false poin, c deermines f Hence we should expec relaionship o ACC crieria Unique True Poin and Near False Poin Pair Coverage (CUTPNFP) : Given a minimal DNF represenaion of a predicae f,, for each clause c in each implican i,, TR conains a unique rue poin for i and a near false poin for c such ha he poins differ only in he ruh value of c. Noe ha definiion only menions f, and no f. Clearly, CUTPNFP subsumes RACC Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 7

Consider f = ab + cd CUTPNFP Example For implican ab, we have 3 unique rue poins: {TTFF, TTFT, TTTF} For clause a, we can pair unique rue poin TTFF wih near false poin FTFF For clause b, we can pair unique rue poin TTFF wih near false poin TFFF For implican cd, we have 3 unique rue poins: {FFTT, FTTT, TFTT} For clause c, we can pair unique rue poin FFTT wih near false poin FFFT For clause d, we can pair unique rue poin FFTT wih near false poin FFTF CUTPNFP se: {TTFF, FFTT, TFFF, FTFF, FFTF, FFFT} Firs wo ess are unique rue poins; ohers are near false poins Rough number of ess required: # implicans * # lierals Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 8

DNF Faul Classes ENF: Expression Negaion Faul f = ab+c f = ab+c TNF: Term Negaion Faul f = ab+c f = ab+c TOF: Term Omission Faul f = ab+c f = ab LNF: Lieral Negaion Faul f = ab+c f = ab+c LRF: Lieral Reference Faul f = ab + bcd f = ad + bcd LOF: Lieral Omission Faul f = ab + c f = a + c LIF: Lieral Inserion Faul f = ab + c f = ab + bc ORF+: Operaor Reference Faul f = ab + c f = abc ORF*: Operaor Reference Faul f = ab + c f = a + b + c Key idea is ha faul classes are relaed wih respec o esing: Tes ses guaraneed o deec cerain fauls are also guaraneed o deec addiional fauls. Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 9

Faul Deecion Relaionships Lieral Inserion Faul LIF Term Omission Faul TOF Operaor Reference Faul ORF+ Lieral Reference Faul LRF Lieral Negaion Faul LNF Term Negaion Faul TNF Lieral Omission Faul LOF Operaor Reference Faul ORF* Expression Negaion Faul ENF Inroducion o Sofware Tesing (Ch 3) Ammann & Offu

Undersanding The Deecion Relaionships Consider he TOF (Term Omission Faul) class UTPC requires a unique rue poin for every implican (erm) Hence UTPC deecs all TOF fauls From he diagram, UTPC also deecs: All LNF fauls (Unique rue poin for implican now false) All TNF fauls (All rue poins for implican are now false poins) All ORF+ fauls (Unique rue poins for joined erms now false) All ENF fauls (Any single es deecs his ) Alhough CUTPNFP does no subsume UTPC, CUTPNFP deecs all faul classes ha UTPC deecs (Converse is false) Consider wha his says abou he noions of subsumpion vs. faul deecion Lieraure has many more powerful (and more expensive) DNF crieria In paricular, possible o deec enire faul hierarchy (MUMCUT) Inroducion o Sofware Tesing (Ch 3) Ammann & Offu

Karnaugh Maps for Tesing Logic Expressions Fair Warning We use, raher han presen, Karnaugh Maps Newcomer o Karnaugh Maps probably needs a uorial Suggesion: Google Karnaugh Map Tuorial Our goal: Apply Karnaugh Maps o conceps used o es logic expressions Idenify when a clause deermines a predicae Idenify he negaion of a predicae Idenify prime implicans and redundan implicans Idenify unique rue poins Idenify unique rue poin / near false poin pairs No new maerial here on esing Jus fas shorcus for conceps already presened Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 12

K-Map: A clause deermines a predicae Consider he predicae: f = b + ac + ac Suppose we wan o idenify when b deermines f The dashed line highlighs where b changes value If wo cells joined by he dashed line have differen values for f, hen b deermines f for hose wo cells. b deermines f: ac + ac (bu NOT a ac or ac) Repea for clauses a and c c ab 00 01 0 1 Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 13

K-Map: Negaion of a predicae Consider he predicae: f = ab + bc Draw he Karnaugh Map for he negaion Idenify groups Wrie down negaion: f = b + a c c ab 00 01 c ab 00 01 0 0 1 1 Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 14

K-Map: Prime and redundan implicans Consider he predicae: f = abc + abd + abcd + abcd + acd Draw he Karnaugh Map Implicans ha are no prime: abd, abcd, abcd, acd Redundan implican: abd Prime implicans ab Three: ad, bcd, abc 00 01 cd The las is redundan Minimal DNF represenaion 00 f = ad + bcd 01 Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 15

K-Map: Unique True Poins Consider he predicae: f = ab + cd Three unique rue poins for ab TTFF, TTFT, TTTF TTTT is a rue poin, bu no a unique rue poin Three unique rue poins for cd FFTT, FTTT, TFTT Unique rue poins for f ab cd 00 01 f = ac + bc + ad + bd 00 FTFT,TFFT, FTTF, TFTF Possible UTPC es se 01 f: {TTFT, FFTT} f: {FTFT, TFFT, FTTF, TFTF} Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 16

K-Map: Unique True Poin/ Near False Poin Pairs Consider he predicae: f = ab + cd For implican ab For a, choose UTP, NFP pair TTFF, FTFF For b, choose UTP, NFP pair TTFT, TFFT For implican cd For c, choose UTP, NFP pair FFTT, FFFT For d, choose UTP, NFP pair FFTT, FFTF Possible CUTPNFP es se {TTFF, TTFT, FFTT //UTPs FTFF, TFFT, FFFT, FFTF} //NFPs ab cd 00 00 01 01 Inroducion o Sofware Tesing (Ch 3) Ammann & Offu 17