Structural Testing Review Chapter 11. 2 Measuring Gaps and Redundancy We have seen that functional testing methods may produce test suites with serious.

Slides:



Advertisements
Similar presentations
Acceptance Testing.
Advertisements

Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 11 Instructor Paulo Alencar.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
(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 ,
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION TESTING II Autumn 2011.
Chapter 8: Path Testing Csci 565.
Software Testing and Quality Assurance White Box Testing.
Testing an individual module
Chapter 5 Retrospective on Functional Testing Software Testing
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Test coverage Tor Stålhane. What is test coverage Let c denote the unit type that is considered – e.g. requirements or statements. We then have C c =
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Topics in Software Dynamic White-box Testing Part 2: Data-flow Testing
Data Flow Testing Chapter Data Flow Testing Testing All-Nodes and All-Edges in a control flow graph may miss significant test cases Testing All-Paths.
What is Software Testing? And Why is it So Hard J. Whittaker paper (IEEE Software – Jan/Feb 2000) Summarized by F. Tsui.
Path Testing + Coverage Chapter 9 Assigned reading from Binder.
Final Review  Different tests  Boundary Value Testing  Equivalence Class Testing  Decision Table Based Testing  Path Testing  Data Flow & P-Slice.
Agenda Introduction Overview of White-box testing Basis path testing
Introduction to Software Testing Chapter 8.1 Building Testing Tools –Instrumentation Paul Ammann & Jeff Offutt
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.
1 Software Testing & Quality Assurance Lecture 14 Created by: Paulo Alencar Modified by: Frank Xu.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Coverage Estimating the quality of a test suite. 2 Code Coverage A code coverage model calls out the parts of an implementation that must be exercised.
Summarizing “Structural” Testing Now that we have learned to create test cases through both: – a) Functional (blackbox)and – b) Structural (whitebox) testing.
BASIS PATH TESTING.
WHITE BOX TESTING IS4500 Copyright © 2012 by The Cathris Group and Martin J. Schedlbauer. All Rights Reserved. Do Not Duplicate or Distribute Without Written.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Structural Coverage. Measurement of structural coverage of code is a means of assessing the thoroughness of testing. Such metrics do not constitute testing.
© Dr. A. Williams, Fall Present Software Quality Assurance – Clover Lab 1 Tutorial / lab 2: Code instrumentation Goals of this session: 1.Create.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
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:
CS223: Software Engineering Lecture 26: Software Testing.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Paul Ammann & Jeff Offutt
Software Testing Structural testing 1.
BASIS PATH TESTING.
Boundaries and C0,C1 Pressman pp
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Chapter 5 Retrospective on Functional Testing Software Testing
Structural testing, Path Testing
White-Box Testing.
Paul Ammann & Jeff Offutt
Chapter 9 Path Testing–Part 1
UNIT-4 BLACKBOX AND WHITEBOX TESTING
CIS 4932 Software Testing White-Box Testing
Chapter 10 Data Flow Testing Slice Testing
White-Box Testing.
Executes a block of statements only if a test is true
Paul Ammann & Jeff Offutt
Structural Coverage.
Summary.
Structural Coverage.
Whitebox Testing.
Paul Ammann & Jeff Offutt
Whitebox Testing.
CSE 1020:Software Development
Paul Ammann & Jeff Offutt
CSCE 747 Software Testing and Quality Assurance
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing.
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Structural Testing Review Chapter 11

2 Measuring Gaps and Redundancy We have seen that functional testing methods may produce test suites with serious gaps and a lot of redundancy Structural testing analysis allows to measure the extent of these problems

3 Structural Metrics A functional testing method M produces m test cases A structural metric S identifies s coverage elements in the unit under test When the m test cases run, they traverse n coverage elements

4 Metric definitions Coverage of method M with respect to metric S as C(M,S) = n/s Redundancy of method M with respect to metric S as R(M,S) = m/s Net redundancy of method M with respect to metric S as NR(M,S) = m/n

5 Metric values for Triangle MethodmnsC(M,S)R(M,S)NR(M,S) Boundary Value Worst Case Analysis WN ECT Decision Table

6 Coverage usefulness 100% coverage is never a guarantee of bug-free software Coverage reports can point out inadequate test suites suggest the presence of surprises, such as blind spots in the test design Help identify parts of the implementation that require structural testing

7 Coverage example TEX and AWK are widely used programs with comprehensive test suites Coverage analysis showed SystemSegmentBranchP-useC-use TEX AWK

8 Is 100% coverage possible? Short-circuit evaluation Mutually exclusive conditions (x > 2) || (x < 10) Redundant predicates if (x == 0) do1; else do2; if (x != 0) do3; else do4; Dead code “This should never happen”

9 How to measure coverage? The source code is instrumented Depending on the code coverage model, code that writes to a trace file is inserted in every branch, statement etc. Most commercial tools measure segment and branch coverage

10 FAQ about Coverage Is 100% coverage the same as exhaustive testing? Are branch and path coverage the same? Can path coverage be achieved? Is every path in a control flow graph testable? Is less than 100% coverage acceptable? Can I trust a test suite without measuring coverage? When can I stop testing?

11 Some answers… When you run out of time When continued testing reveals no new faults When you cannot think of any new test cases When you reach a point of diminishing returns When mandated coverage has been attained When all faults have been removed

12 A coverage counter-example void Depository::give_change(int price) { int n_100, n_25, n_10, n_5; if (deposit <= price) { change_due = 0; } else { change_due = deposit-price; n_100 = change_due / 100; change_due = change_due – n_100*100; n_25 = change_due / 25; change_due = change_due – n_25*25; n_10 = change_due / 10; change_due = change_due – n_10*10; n_5 = change_due / 10; // A cut-and paste bug }