Structural Coverage Verilog code is available to help generate tests o Code can be analyzed statically and/or simulated Easier to detect “additive” design.

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

Automated Test Data Generation Maili Markvardt. Outline Introduction Test data generation problem Black-box approach White-box approach.
The "if structure" is used to execute statement(s) only if the given condition is satisfied.
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
Data Dependencies Describes the normal situation that the data that instructions use depend upon the data created by other instructions, or data is stored.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
CS 111: Introduction to Programming Midterm Exam NAME _________________ UIN __________________ 10/30/08 1.Who is our hero? 2.Why is this person our hero?
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
Predicate Complete Testing * Thomas Ball * Thomas Ball, A Theory of Predicate-Complete Test Coverage and Generation, Technical Report MSR-TR ,
Basic Control Structures Control order of execution of statements sequential selection iteration - Repeat some action while a certain condition is true.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION TESTING II Autumn 2011.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
16/27/ :53 PM6/27/ :53 PM6/27/ :53 PMLogic Control Structures Arithmetic Expressions Used to do arithmetic. Operations consist of +,
Machine-Independent Optimizations Ⅰ CS308 Compiler Theory1.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Systems Verification and Validation Laboratory Assignment 3
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Domain testing Tor Stålhane. Domain testing revisited We have earlier looked at domain testing as a simple strategy for selecting test cases. We will.
Software (Program) Analysis. Automated Static Analysis Static analyzers are software tools for source text processing They parse the program text and.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Chapter 13: Implementation Phase 13.3 Good Programming Practice 13.6 Module Test Case Selection 13.7 Black-Box Module-Testing Techniques 13.8 Glass-Box.
Testing Theory cont. Introduction Categories of Metrics Review of several OO metrics Format of Presentation CEN 5076 Class 6 – 10/10.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Summarizing “Structural” Testing Now that we have learned to create test cases through both: – a) Functional (blackbox)and – b) Structural (whitebox) testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Reasoning about programs March CSE 403, Winter 2011, Brun.
A Review of Software Testing - P David Coward Reprinted: Information and Software Technology; Vol. 30, No. 3 April 1988 Software Engineering: The Development.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
Overview Go over parts of quiz? Another iteration structure for loop.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
1 Control Flow Graphs. 2 Optimizations Code transformations to improve program –Mainly: improve execution time –Also: reduce program size Can be done.
Testing Data Structures Tao Xie Visiting Professor, Peking University Associate Professor, North Carolina State University
Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Testing It is much better to have a plan when testing your programs than it is to just randomly try values in a haphazard fashion. Testing Strategies:
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Week 5-6 MondayTuesdayWednesdayThursdayFriday Testing I No reading Group meetings MidtermNo Section Testing II Progress report due Readings out Testing.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 23, 2005 Lecture Number: 11.
Automatic Test Generation
A Review of Software Testing - P. David Coward
Introduction to Computer Programming
CS223: Software Engineering
Software Testing.
Input Space Partition Testing CS 4501 / 6501 Software Testing
Simulation based verification: coverage
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 6 Domain Testing
Structural testing, Path Testing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Introduction to C++ Programming
“White box” or “glass box” tests
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Control Structure Testing
Institute of Computing Tech.
C. M. Overstreet Old Dominion University Fall 2005
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Structural Coverage Verilog code is available to help generate tests o Code can be analyzed statically and/or simulated Easier to detect “additive” design errors o Tests what the code actually does, not what it is supposed to do Possible to automate test generation

Structural Coverage Metrics Coverage metric is a numerical measurement of the adequacy of an arbitrary test set for verification. High coverage is a goal for test generation The measure is based on code execution 1.Toggle Coverage - Fraction of signals which have toggled 2.Statement coverage - Fraction of statements executed 3.Branch coverage - Fraction of branch directions executed 4.Path coverage - Fraction of control-flow paths executed

Toggle Coverage Counts the fraction of signals/variables whose bits have toggled ex. x = 4b0000 and x=4b0111, 75% toggle coverage Easy to compute Little functional meaning (came from manufacturing/memory test)

Statement Coverage Ensure that the “code” is completely covered during testing Statement Coverage: Requires that all statements are executed a = in1 + in2; b = 0; c = 0; while (c < a) c = c + in1; if (c < in2) out = a + b; else out = a + c; a = in1 + in2; b = 0; c = 0; c<a c<in2 c = c + in1; out = a + c;out = a + b; Test 1: in1, in2 = 0,0 Test 2: in1, in2 = -1, 1 TF T F 0,0 -1,1

Branch Coverage Branch Coverage: Requires that all branch directions are executed 2 branches, 4 possibilities, 3 are executed, 75% branch coverage a = in1 + in2; b = 0; c = 0; while (c < a) c = c + in1; if (c < in2) out = a + b; else out = a + c; a = in1 + in2; b = 0; c = 0; c<a c<in2 c = c + in1; out = a + c;out = a + b; Test 1: in1=0, in2=0 Test 2: in1=-1, in2=1 TF T F 0,0 -1,1

Test Sequence for Higher Coverage 100% statement and branch coverage High coverage goal directs test generation a = in1 + in2; b = 0; c = 0; while (c < a) c = c + in1; if (c < in2) out = a + b; else out = a + c; a = in1 + in2; b = 0; c = 0; c<a c<in2 c = c + in1; out = a + c;out = a + b; Test 1: in1,in2 = 1,0 Test 2: in1,in2 = -1,1 TF T F -1,1 1,0

Path Coverage Each pattern covers a different control path Infinite number of paths with a loop a = in1 + in2; b = 0; c = 0; c<a c<in2 c = c + in1; out = a + c;out = a + b; TF T F -1,1 1,0 0,0

Domain (Boundary) Coverage Each conditional predicate defines partitions the input space A small error may move the partition foo (in1, in2) if (in1 < in2) out = 1; else out = 0; in1 in2 out=0 out=1 What if in1 < in2 should be in1 <= in2? What if in1 or in2 has a slightly incorrect value?

Domain Test Goal Test with input data on the boundary and just on either side of the boundary foo (in1, in2) if (in1 < in2) out = 1; else out = 0; in1 in2 out=0 out=1 Test 1: in1, in2 = 1,1 - False, on the boundary Test 2: in1, in2 = 1,2 - True, just off the boundary 1 1 2

Domain Test Example a = in1 + in2; b = 0; c = 0; while (c < a) c = c + in1; if (c < in2) out = a + b; else out = a + c; Test 1: in1, in2 = 0,0 Sets c = 0, and a = 0 False and on-boundary for c < a False and on-boundary for c < in2 Test 2: in1, in2 = 1,0 Sets c = 0, and a = 0 True and near-boundary for c < a c set to 1 in loop False and on-boundary for c < in2 Need to satisfy 2 conditions for each predicate:  True and on/near-boundary  False and on/near-boundary 3 of 4 conditions satisfied, 75% coverage

Domain Test Complications Non-standard Domain Boundaries Piecewise Linear Boundaries: Test each linear piece separately (in2 > in1) and (in1 > 2) in1 in2 2 Higher Degree Boundaries: No standard solution in1 in2 (in2 > in1 2 )

Finite State Machine Metrics These metrics assume that the HDL is written in an FSM style o A ‘case’ statement which switches on a single ‘state’ var o Each control path assigns the state variable case state is when 0 => x = 0; state = 3; when 1 => x = 1; state = 2;. State Coverage - All states are entered Transition Coverage = All transitions are traversed

a = in1 + in2; b = 0; c = 0; while (c < a) c = c + in1; if (c < in2) out = a + b; else out = a + c; out = a - c; Erroneous statement Test 0,0 executes erroneous statement but does not detect the error Detection constraint includes a - c != a + c Optimism in a Coverage Metric 100% statement coverage does not guarantee error detection Test constraints may not be the same as detection constraints

Pessimism in a Coverage Metric 100% coverage may not be possible  Fault detection conditions may not be satisfiable  Undetectable faults are redundant, can be ignored  Identifying redundant faults in NP-complete a = in1 + in2; b = 0; c = 0; c<a c<in2 c = c + in1; out = a + c;out = a + b; TF T F This path cannot be executed Sub-100% coverage is misleading

Functional Coverage Test goals are defined based on the features in the specification The implementation (HDL) is not used to create tests Coverage events are “interesting” events which might reveal errors Coverage events must be defined manually because they are extracted from the specification Ex. Did overflow occur? Was x=17? Did an add follow a subtract?

Functional Coverage Results add sub shl shr noop illegal port1 port2port3port4 X X X X Status report indicates which events have been covered (and how often) Can compute the cross product of events to get complex events Many such events may be impossible or uninteresting