Software Testing – Lecture #1 Thomas Ball with material from M. Young, A. Memon and MSR’s FSE group.

Slides:



Advertisements
Similar presentations
Hong Zhu Department of Computing and Communication Technologies Oxford Brookes University, Oxford OX33 1HX, UK COMPSAC 2012 PANEL.
Advertisements

Lecture 8: Testing, Verification and Validation
Verification and Validation
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Click your mouse anywhere on the screen to advance the text in each slide. After the starburst appears, click a blue triangle to move to the next slide.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
Software Testing Seminar Mooly Sagiv Tel Aviv University Sunday Monday Schrieber.
(c) 2007 Mauro Pezzè & Michal Young Ch 9, slide 1 Test Case Selection and Adequacy Criteria.
Software Testing and QA Theory and Practice (Chapter 2: Theory of Program Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and.
Product Liability When goods cause injury, there is a question of product liability. There are three main issues related to product liability cases: –
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
(c) 2007 Mauro Pezzè & Michal Young Ch 10, slide 1 Functional testing.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Jul The New Geant4 License J. Perl The New Geant4 License Makes clear the user’s wide- ranging freedom to use, extend or redistribute Geant4, even.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
CHAPTER 19 WARRANTIES AND PRODUCT LIABILITY DAVIDSON, KNOWLES & FORSYTHE Business Law: Cases and Principles in the Legal Environment (8 th Ed.)
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
TOPIC – Liability for Software Failure MBA 8520 – Management and Application of Information Technology.
Software Reliability Categorising and specifying the reliability of software systems.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Middleware Promises Warranties that Don’t Indemnities that Won’t Stephen Rubin, Esquire
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
Cs205: engineering software university of virginia fall 2006 Validation David Evans
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
CMSC 345 Fall 2000 Unit Testing. The testing process.
What is Software Testing? And Why is it So Hard J. Whittaker paper (IEEE Software – Jan/Feb 2000) Summarized by F. Tsui.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Testing Theory cont. Introduction Categories of Metrics Review of several OO metrics Format of Presentation CEN 5076 Class 6 – 10/10.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
Andrew McNab - License issues - 10 Apr 2002 License issues for EU DataGrid (on behalf of Anders Wannanen) Andrew McNab, University of Manchester
NRCCL (University of Oslo, Faculty of Law) Copyleft and Open Source Jon Bing Notrwegian Research Center for Computers and Law Master Lecture 13 October.
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
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 Drivers and Stubs More Unit Testing Test Drivers and Stubs CEN 5076 Class 11 – 11/14.
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.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
CPIS 357 Software Quality & Testing I.Rehab Bahaaddin Ashary Faculty of Computing and Information Technology Information Systems Department Fall 2010.
Sales Law December 7, 2009 Winn. Sales Law December 8 Tuesday 12/8 – Teaching Evaluations (please bring laptops if possible) – Unofficial Survey on Teaching.
International Telecommunication Union New Delhi, India, December 2011 ITU Workshop on Standards and Intellectual Property Rights (IPR) Issues Philip.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
National Alliance for Medical Image Computing Licensing in NAMIC 3 requirements from NCBC RFA (paraphrased)
Legal Disclaimers Accuracy Every effort is made to provide information that is accurate. However any information contained in this website or the “article.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
Testing Integral part of the software development process.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVIII. Software Testing.
Paul Ammann & Jeff Offutt
Overview Theory of Program Testing Goodenough and Gerhart’s Theory
Software Testing.
Software Testing.
CSC 480 Software Engineering
Software Testing An Introduction.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 2 Theory of Program Testing
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Software Testing – Lecture #1 Thomas Ball with material from M. Young, A. Memon and MSR’s FSE group

Why Test?

Testing and The Software Process Three steps –X = test before coding –Y = test during coding –Z = test after coding Questions: –Who are your customers? –How to choose X, Y and Z to keep your customers happy yourself healthy

Testing: Current Challenges Test is huge cost of product development Test effectiveness and software quality hard to measure Incomplete, informal and changing specifications Downstream cost of bugs is enormous Lack of spec and implementation testing tools Integration testing across product groups Patching nightmare Versions exploding …

Testing Word

11. EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE, FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT, THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, OR OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION OF THIS EULA, EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, BREACH OF CONTRACT OR BREACH OF WARRANTY OF MICROSOFT OR ANY SUPPLIER, AND EVEN IF MICROSOFT OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Microsoft Powerpoint EULA Point EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE, FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT, THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, OR OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION OF THIS EULA, EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, BREACH OF CONTRACT OR BREACH OF WARRANTY OF MICROSOFT OR ANY SUPPLIER, AND EVEN IF MICROSOFT OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

The GPL 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Is There Any Program That Can Be Fully Tested?

Goals of the Next Two Days What is testing and what are the key problems in testing? Model-centric testing Code-centric testing

Standard Testing Questions Did this test execution succeed or fail? How shall we generate/select test cases? How do we know when we’ve tested enough? What do we know when we’re done?

1. What do we know when we’re done?

Some Testing Goals Reveal faults –Glenford Myers, The Art of Software Testing –Dijsktra Establish confidence –of reliability –of (probable) correctness –of detection (therefore absence) of particular faults Clarify/infer the specification Represent the customer Minimize risk

Testing Theory (such as it is) Plenty of negative results –Nothing guarantees correctness –Undecidability of even simple properties –Combinatorial explosion –Statistical confidence is prohibitively expensive –Being systematic may not improve fault detection as compared to simple random testing –… Few positive results –theory of finite state machines –specification-based testing

What Information Can We Exploit? Specifications (formal or informal) –in oracles –for selection, generation, adequacy Designs –… Code –for selection, generation, adequacy Usage –historical or models Organization experience

Testing for Reliability Reliability is statistical, and requires a statistically valid sampling scheme Programs are complex human artifacts with few useful statistical properties In some cases the environment has useful statistical properties –stable, pre-existing systems (telephones) –systems with thoroughly modeled environments (avionics)

Process-Based Reliability Testing Rather than relying only on properties of the program, we may use historical characteristics of the development process Reliability growth models (Musa, Littlewood, et al) project reliability based on experience with the current system and previous similar systems

2. When can we stop? Historical focus of research in 70s, 80s; no longer active.

“Adequate” testing Ideally: adequate testing ensures some property (proof by cases) –Origins in [Goodenough & Gerhart], [Weyuker and Ostrand] –In reality: as impractical as program proofs Practical “adequacy” criteria are really “inadequacy” criteria –If no case from class XX has been chosen, surely more testing is needed...

Systematic Testing Systematic (non-random) testing is aimed at program improvement, not measurement –obtaining valid samples and maximizing fault detection require different approaches –it is unlikely that one kind of testing will be satisfactory for both “Adequacy” criteria mostly negative: indications of important omissions –positive criteria (assurance) are no easier than program proofs

Partition Testing Basic idea: Divide program input space into (quasi-) equivalence classes –Underlying idea of specification-based, structural, and fault-based testing

Specification-Based Partition Testing Divide the program input space according to identifiable cases in the specification –May emphasize boundary cases –May include combinations of features or values If all combinations are considered, the space is usually too large Systematically “cover” the categories –May be driven by scripting tools or input generators –Example: Category-Partition testing [Ostrand]

Structural Coverage Testing (In)adequacy criteria –If significant parts of program structure are not tested, testing is surely inadequate Control flow coverage criteria –Statement (node, basic block) coverage –Branch (edge) and condition coverage –Data flow (syntactic dependency) coverage –Various control-flow criteria Attempted compromise between the impossible and the inadequate

Basic structural criteria (ex.) a b c d e f Edge ac is required by all-edges but not by all-nodes coverage Typical loop coverage criterion would require zero iterations (cdf), one iteration (cdedf), and multiple iterations (cdededed...df)

Data flow coverage criteria (ex.) x := 7 y := x y := y+1 z := x+y 2 reaching definitions (one is from self) 2 reaching definitions for x, and 2 reaching definitions for y Rationale: An untested def- use association could hide an erroneous computation

Structural Coverage in Practice Statement and sometimes edge or condition coverage is used in practice –Simple lower bounds on adequate testing; may even be harmful if inappropriately used for test selection Additional control flow heuristics sometimes used –Loops (never, once, many), combinations of conditions

Fault-based Testing Given a fault model –hypothesized set of deviations from correct program –typically, simple syntactic mutations; relies on coupling of simple faults with complex faults Coverage criterion: Test set should be adequate to reveal (all, or x%) faults generated by the model –similar to hardware test coverage

Fault Models Fault models are key to semiconductor testing –Test vectors graded by coverage of accepted model of faults (e.g., “stuck-at” faults) What are fault models for software? –What would a fault model look like? –How general would it be? Across application domains? Across organizations? Across time? Defect tracking is a start

The Budget Coverage Criterion A common answer to “when is testing done” –When the money is used up –When the deadline is reached This is sometimes a rational approach! –Implication 1: Test selection is more important than stopping criteria per se. –Implication 2: Practical comparision of approaches must consider the cost of test case selection

3. How shall we generate/select tests?

Test Generation: Standard Advice Specification coverage good for generation as well as adequacy –applicable to informal as well as formal specs Fault-based tests –usually ad hoc, sometimes from check-lists Program coverage last –to suggest uncovered cases, not just to achieve a coverage criterion

Symbolic Execution Proposed for test generation in early 70s Given finite path to cover – generate constraints – check for satisfiability – if satisfiable then generate input Few tools in practice

Testing after change Change to spec/code may –make some tests obsolete –change test results –require generation of new tests Selective regression testing well studied – given a code change, what tests should we run? –Scout-tool widely used in MS

4. Was this test execution correct?

The Importance of Oracles Much testing research concentrates on adequacy, ignoring oracles Much testing practice relies on the “eyeball oracle” –Expensive, especially for regression testing makes large numbers of tests infeasible –Not dependable Automated oracles are essential to cost- effective testing

Sources of Oracles Specifications –sufficiently formal (e.g., SCR tables) –but possibly incomplete (e.g., assertions in Anna, ADL, APP, Nana) Design, models –treated as specifications, as in protocol conformance testing Prior runs (capture/replay) –especially important for regression testing and GUIs; hard problem is parameterization

What can be automated? Oracles –assertions; replay; from some specifications Selection (Generation) –scripting; specification-driven; replay variations –selective regression test Coverage –statement, branch, dependence Management