Truth Table-Based Testing Generating test cases when the test model is a truth table Reading: Binder Chapter 6.

Slides:



Advertisements
Similar presentations
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
Advertisements

Digital Circuits.
TOPIC : Reduced Ordered Binary Decision Diagrams UNIT 1: Modeling Digital Circuits Module 1 : Functional Modeling.
14004 L5 - © D. Deugo, Lecture 5 Combinational Models (Binder chapter 6)
ECE 331 – Digital System Design
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
1 CS 20 Lecture 14 Karnaugh Maps Professor CK Cheng CSE Dept. UC San Diego.
Boolean Matching in Logic Synthesis. Equivalence of Functions Equivalence of two functions defined under l Negation of input variables l Permutation of.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
Chapter 3 Combinational Logic Design
Propositional Calculus Math Foundations of Computer Science.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
EEE324 Digital Electronics Ian McCrumRoom 5B18, Lecture 4: Boolean Algebra.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
CS 151: Digital Design Chapter 3 3-8: Encoding. CS 151 Encoding Encoding - the opposite of decoding - the conversion of a maximum of 2 n input code to.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Lecture 2 – Boolean Algebra Lecturer: Amy Ching Date: 21 st Oct 2002.
Binary Decision Diagrams (BDDs)
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Lecture 4 4. Boolean functions – advanced
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Erik Jonsson School of Engineering and Computer Science FEARLESS Engineeringwww.utdallas.edu/~pervin EE/CE 2310 – HON/002 Introduction to Digital Systems.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Combination of logic gates  Logic gates can be combined to produce more complex functions.  They can also be combined to substitute one type of gate.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
© BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.
1 Digital Logic Design Week 5&6 cont’d Revision for Quiz 2/Exam.
1 CS 151: Digital Design Chapter 3: Combinational Logic Design 3-1Design Procedure CS 151: Digital Design.
Karnaugh Maps (K-Maps)
Functional Modeling.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
THE K-MAP.
C.S.Choy39 TERMINOLOGY Minterm –product term containing all input variables of a function in either true or complementary form Maxterm – sum term containing.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. De Morgan’s Theorem De Morgan’s Theorem.
DE MORGAN’S THEOREM. De Morgan’s Theorem De Morgan’s Theorem.
Digitaalsüsteemide verifitseerimise kursus1 Exercises Binary decision diagrams ROBDD generation. Shannon expansion Finding an optimal ordering Dynamic.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC:K-Map. K-Map (1)  Karnaugh Map provides a systematic method for simplifying Boolean expressions and may produce.
Lecture 1 Gunjeet kaur Dronacharya group of institutions.
Lecture 3: Incompletely Specified Functions and K Maps
Computer Science 210 Computer Organization
Combinational Circuit Design
Boolean Algebra – Part 1 ECEn 224.
Boolean Expressions Lecture No. 10.
ECE 331 – Digital System Design
Karnaugh Maps (K-Maps)
Computer Science 210 Computer Organization
Week 3 Logic will get you from A to B. Imagination will take you everywhere. Albert Einstein.
Lecture 3: Incompletely Specified Functions and K Maps
BASIC & COMBINATIONAL LOGIC CIRCUIT
Karnaugh Maps Topics covered in this presentation: Karnaugh Maps
CSE 370 – Winter 2002 – Logic minimization - 1
ECE 331 – Digital System Design
Binary Decision Diagrams
DESICION TABLE Decision tables are precise and compact way to model complicated logic. Decision table is useful when input and output data can be.
ECB2212-Digital Electronics K-Map
Gates Type AND denoted by X.Y OR denoted by X + Y NOR denoted by X + Y
CHAPTER 15 REDUCTION OF STATE TABLES STATE ASSIGNMENT
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Laws & Rules of Boolean Algebra
Digital Circuits.
Week 3 Logic will get you from A to B. Imagination will take you everywhere. Albert Einstein.
Presentation transcript:

Truth Table-Based Testing Generating test cases when the test model is a truth table Reading: Binder Chapter 6

Example truth table Variant Number Normal PressureCall For HeatDamper ShutManual ModeIgnition Enable ABCDZ

Deriving the Logic Function Review boolean algebra AB = A and B A+B = A or B ~A = not A A logic function maps n boolean input variables to a boolean output variable A truth table is an enumeration of all possible input and output values

Logic function The logic function for the example is Z = AB~C + AD Several techniques to derive it Karnaugh maps Cause-effect graphs A compact logic function will produce more powerful test cases

Truth table approaches All-Variants: Every variant is tested once. The number of tests is 2 N, infeasible for large tables All-True: All variants that produce a true outcome are tested Inappropriate if false actions are an important part of the behaviour All-False: All variants that produce a false outcome are tested Inappropriate if true actions are important

Each-Condition/All-conditions Assumption: For the logic functions X=PQR and Y=P+Q+R, the only relevant cases are: PQRX PQRY

Each-Condition/All-conditions For a logic function such as Z = AB~C + AD we apply the heuristic to every term Test cases for AB~C ABCD 010X 100X 111X 110X Test cases for AD ABCD 1XX0 0XX1 1XX1

Each-Condition/All-conditions The number of tests increases linearly with the number of product terms Values need to be assigned to the Don’t Care variables. Can be done randomly or by suspicion. Try different combinations for different test cases

Binary Decision Diagrams Compact representation of a truth table Can be used to create test suite A BDD can be generated from the truth table Start by drawing the full decision tree A left branch represents False (0) A right branch represents True (1)

Decision tree for boiler example

Reduction process Working from left to right, replace leaf nodes with equivalent constants or variables and prune the branches This way we can prune the entire left branch of the tree since it only depends on the value of A

First Reduction

Second Reduction

Final Binary Decision Diagram

BDD determinant table A BDD determinant is a root-to-leaf- path in the BDD The BDD determinant table has one row per path VariantABCDZ 10XXX0 210XDD 3111DD 4110X1

Test suite generation All combinations of sensitive variables, e.g. D, are created VariantABCDZ 10XXX0 210X00 210X X1

Variable Negation Strategy Designed to reveal faults that hide in a don’t care The test suite contains: Unique true points: A variant per term t, so that t is True and all other terms are False Near False Points: A variant for each literal in a term. The variant is obtained by negating the literal and is selected only if it makes Z=0 Each variant creates a test candidate set Unique true point candidate sets in boiler example: {12} {9,11,15}

Example truth table Variant Number Normal PressureCall For HeatDamper ShutManual ModeIgnition Enable ABCDZ

Negation variants Candidate set number Term negation Variants containing this negation Variants containing this negation where Z=0 2ABC14,1514 3A~B~C8,98 4~AB~C4,5 6A~D8,10,12,148,10,14 7~AD1,3,5,7

Selecting the test cases At least one variant from each candidate set Can be done by inspection Random selection is also used Near False Points exercise combinations of don’t care values 6% of all possible tests are created 98% of simulated bugs can be found

Test suite Candidate sets ,5 9,11,15 8,10,14 1,3,5,7 Minimum Test suite