Simulation based verification: coverage

Slides:



Advertisements
Similar presentations
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
Advertisements

SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
EE694v-Verification-Lect5-1- Lecture 5 - Verification Tools Automation improves the efficiency and reliability of the verification process Some tools,
CS4723 Software Validation and Quality Assurance Lecture 02 Overview of Software Testing.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Structural Coverage Verilog code is available to help generate tests o Code can be analyzed statically and/or simulated Easier to detect “additive” design.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
White-box Testing Black-box Testing Extensions
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Introduction to Software Testing
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Rigorous Testing by Merging Structural and Behavioral UML Representations Presented by Chin-Yi Tsai.
Workshop on Integrating Software Testing into Programming Courses (WISTPC14:2) Friday July 18, 2014 Introduction to Software Testing.
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
Topics  Direct Predicate Characterization as an evaluation method.  Implementation and Testing of the Approach.  Conclusions and Future Work.
Tom.h.wilson Department of Geology and Geography West Virginia University Morgantown, WV.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVIII. Software Testing.
Mingze Zhang, Mun Choon Chan and A. L. Ananda School of Computing
Overview Part 1 - Storage Elements and Sequential Circuit Analysis
Measurement Model Refactoring
ICS 3UI - Introduction to Computer Science
OPERATING SYSTEMS CS 3502 Fall 2017
Testing Tutorial 7.
CS223: Software Engineering
Software Testing.
Software Testing.
Input Space Partition Testing CS 4501 / 6501 Software Testing
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
CS5123 Software Validation and Quality Assurance
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 6 Domain Testing
© LOUIS COHEN, LAWRENCE MANION AND KEITH MORRISON
VLSI Testing Lecture 6: Fault Simulation
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
John D. McGregor Session 9 Testing Vocabulary
KU College of Engineering Elec 204: Digital Systems Design
Software Testing (Lecture 11-a)
Chapter 14 Software Testing Techniques
mEEC: A Novel Error Estimation Code with Multi-Dimensional Feature
Geology Geomath Chapter 7 - Statistics tom.h.wilson
KU College of Engineering Elec 204: Digital Systems Design
Chapter 10 – Software Testing
Baisc Of Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CSE403 Software Engineering Autumn 2000 More Testing
PYTHON: BUILDING BLOCKS Sequencing & Selection
Institute of Computing Tech.
Software Testing “If you can’t test it, you can’t design it”
Basic Concepts of Algorithm
CSE 1020:Software Development
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Simulation based verification: coverage Verification coverage estimates the quality of simulation Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Coverage metrics System can’t be simulated with all possible stimuli Question: how many stimuli are needed? Coverage metrics used Coverage shows our confidence in how thoroughly we verified Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Coverage metrics Three types: Code coverage Parameter coverage Functional coverage Also will talk about Domain coverage, cross coverage, stuck-at fault coverage Digitaalsüsteemide verifitseerimise kursus

Coverage metrics: code coverage Code coverage shows how thoroughly is the code examined during simulation Based on implementation only Easy to compute Digitaalsüsteemide verifitseerimise kursus

Coverage metrics: parameter coverage How well parameters and dimensions covered in functional blocks Based on implementation, spec or both Digitaalsüsteemide verifitseerimise kursus

Coverage metrics: functional coverage Based on behaviors derived from the spec Shows the number of covered behaviors Problem: how to formally generate the behaviors and guarantee that the full functionality is covered… Digitaalsüsteemide verifitseerimise kursus

Comparison: coverage metrics None of the three types is universally best Advantages of code coverage are simplicity and formalisation Advantage of functional coverage is high verification power Parameter coverage is a trade-off between the two Coverage metrics may be used for guiding test generation To reach 100 % coverage is very much harder than to reach 90 %... Digitaalsüsteemide verifitseerimise kursus

Code coverage: statement coverage All lines except begin, end, else Example: a > x, x = y Statement coverage 8 out of 10 = 80% Digitaalsüsteemide verifitseerimise kursus

Code coverage: block coverage Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Instrumented code Instrumented code applied in code coverage analysis. Thus, simulation slowed down considerably. Turn off the code already covered by simulation In that case almost no extra time penalty towards the end of simulation Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Instrumented code Digitaalsüsteemide verifitseerimise kursus

Code coverage: branch and path More stringent than statement coverage Path coverage does not scale Digitaalsüsteemide verifitseerimise kursus

Code coverage: expression coverage Again, more stringent than statement coverage We analyze which expressions were evaluated Expressions divided into layers: E = (x1x2 + x3x4) layer 1: E = y1 + y2 layer 2: y1 = x1x2, y2 = x3x4 With multi-layer expressions, either the top layer or all layers analyzed Digitaalsüsteemide verifitseerimise kursus

Code coverage: expression coverage Minimum input tables applied: f = x1 & x2 x1 x2 - 1 f = (y ? x1 : x2) y f = (x > y) x > y meaning x <= y Expression x1 & x2 and two input stimuli: (x1=1,x2=0) and (x1=1,x2=1) In that case the expression coverage for & is 66.67% Digitaalsüsteemide verifitseerimise kursus

Code coverage: state coverage Sequence b,a,b,a,b,a,b,a,... gives 66.67% of state coverage, as S1 and S2 traversed (2 out of 3). S4 is illegal state, thus max state coverage is 75%! Digitaalsüsteemide verifitseerimise kursus

Code coverage: transition coverage Sequence b,a,b,a,b,a,b,a,... gives 40% of transition coverage as 2 out of 5 transitions traversed. Transition S2/b not defined! Calculated by transitions specified (5) or all possible transitions (6) Digitaalsüsteemide verifitseerimise kursus

Code coverage: sequence coverage User can specify state sequences at the basis of the coverage calculation Normally essential functionality or corner cases specified Possible to keep track on which desired (or undesired) sequences were simulated Digitaalsüsteemide verifitseerimise kursus

Code coverage: toggle coverage Measures how many bits in the signals changed their state between 0 and 1 E.g. a signal for a 4-bit bus and values 0000 and 1101 would give a toggle coverage of 75% Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Parameter coverage Parameter Range Server configuration {(S1,S2): S1, S2 passive or active} Task processing time {3,...,6} Length of the queue {(m1,m2,m3): 1   mi  8, 1  i   3 } Digitaalsüsteemide verifitseerimise kursus

Parameter coverage: example Range {(S1,S2): S1, S2 passive or active} {3,...,6} {(m1,m2,m3): 1   mi  8, 1  i   3 } Server configuration Task processing time Length of the queue If simulation provides 2 server configurations: (S1 active, S2 passive) ja (S1 active, S2 active); processing times 3, 4 and 5; maximum que lengths (6,4,8), then ... ... Parameter coverages: server conf. 50 %, processing times 75 %, queue lengths 75%,50%,100% Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Functional coverage Functional coverage based on behaviors derived from the specification Functional coverage reports the ratio of covered behaviors Problem: how to formally generate behaviors and guarantee that the entire functionality is covered Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Functional coverage User defined mapping of each functional feature to a ‘cover point’  Cover points have certain conditions (ranges, defined transitions or cross etc.) Conditions for a cover point are defined in form of ‘bins’. Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Functional coverage During simulation, when conditions of a cover point hit, those bins are covered. A number of cover points can be captured under one cover group’ Collection of cover groups is usually called a ‘functional coverage model’.  Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Cross coverage Cartesian product of 2 or more coverages More stringent than using just a single coverage metric Cartesian product of several coverages may represent a huge space Digitaalsüsteemide verifitseerimise kursus

Domain coverage (boundary coverage) Every condition defines a partition of the input domain Small design error may slightly shift the partitioning in1 in2 out=0 out=1 foo (in1, in2) if (in1 < in2) out = 1; else out = 0; What if in1 < in2 should be rather in1 <= in2? What if the value of in1 or in2 is slightly wrong? Digitaalsüsteemide verifitseerimise kursus

Domain coverage: Setting up a test Testing with a value at the boundary and with a value immediately off the boundary in1 in2 out=0 out=1 1 2 foo (in1, in2) if (in1 < in2) out = 1; else out = 0; Test 1: in1, in2 = 1,1 – false, at the boundary Test 2: in1, in2 = 1,2 – true, immediately off the boundary Digitaalsüsteemide verifitseerimise kursus

Domain coverage: example Per each condition (predicate) two tests: True and immediately off the boundary False and immediately off the boundary Test 1: in1, in2 = 0,0 c = 0, and a = 0 false and at the boundary for c < a false and at the boundary for c < in2 a = in1 + in2; b = 0; c = 0; while (c < a) c = c + in1; if (c < in2) out = a + b; else out = a + c; Test 2: in1, in2 = 1,0 c = 0, and a = 1 true and at the boundary for c < a c set to 1 false and at the boundary for c < in2 3 conditions out of 4 satisfied, 75% domain coverage Digitaalsüsteemide verifitseerimise kursus

Issues with domain coverage Non-linear boundaries Partly linear boundaries: test each part separately in1 in2 2 (in2 > in1) and (in1 > 2) Higher order boundaries: no standard solutions in1 in2 (in2 > in12) Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Observation coverage Code coverage ignores the observability aspect It may happen that the covered code items have no influence to any observable point It has been showed that 100% code coverage may result in 60-80% observation coverage in the worst case [Fallah, Devadas, Keutzer DAC’98]. Thus, we should consider propagating the bug effect to an observable output Digitaalsüsteemide verifitseerimise kursus

Other metrics: stuck-at coverage Assume that a bug manifests itself as a signal line being constantly stuck to 0 (or 1) Assune single faults, i.e. only one signal line is faulty at a time Stuck-at coverage indicates how well we have excercised the structure Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Issues with coverage None of the coverage metrics provides 100% of confidence in correct functionality E.g. 100 % stuck-at coverage test for OR gate does not discover the design error OR XOR x1 x2 x1 V x2 1 x1 x2 x1  x2 1 = Digitaalsüsteemide verifitseerimise kursus

Digitaalsüsteemide verifitseerimise kursus Issues with coverage Similar problem with expression coverage 100 % expression coverage for OR gate does not discover the error OR XOR x1 x2 x1 V x2 1 x1 x2 x1  x2 1 = Thus, we need to consider a set of coverages! Digitaalsüsteemide verifitseerimise kursus