What s Next INF 117 Project in Software Engineering

Similar documents
Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Testing & Continuous Integration. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/19/2010

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

MTAT : Software Testing

Darshan Institute of Engineering & Technology Unit : 9

Software Quality Assurance. David Janzen

MTAT : Software Testing

Software Testing for Developer Development Testing. Duvan Luong, Ph.D. Operational Excellence Networks

Today s Lecture. A Sample Ada Program to Test. Flow Graphs. Lecture 25: Data Flow and Dependence Graphs. White-Box Testing.

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION

Aerospace Software Engineering

Software Testing. Massimo Felici IF

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18

Part 5. Verification and Validation

Equivalence Class Partitioning and Boundary Value Analysis -Black Box Testing Techniques

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Software Testing. 1. Testing is the process of demonstrating that errors are not present.

(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt

Verification Overview Testing Theory and Principles Testing in Practice. Verification. Miaoqing Huang University of Arkansas 1 / 80

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of

CSE 410 Computer Systems. Hal Perkins Spring 2010 Lecture 12 More About Caches

Topics in Software Testing

Software Testing. Testing: Our Experiences

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Integrating the classification tree method with combinatorial testing: test selection strategy

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

White Box Testing III

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Black-box Testing Techniques

White-Box Testing Techniques

Computational Systems COMP1209

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

Software Testing. Testing 1

Introduction to Software Engineering

Darshan Institute of Engineering & Technology for Diploma Studies

Introduction to Dynamic Analysis

Test Case Specifications and Test adequacy. Research Methods - Barbara Russo SwSE - Software and Systems Engineering

Equivalence Class Partitioning. Equivalence Partitioning. Definition and Example. Example set of classes

Using the code to measure test adequacy (and derive test cases) Structural Testing

Manuel Oriol, CHCRC-C, Software Testing ABB

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

MTAT : Software Testing

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing

MTAT : Software Testing

CMPSCI 521/621 Homework 2 Solutions

7.0 Test Design Techniques & Dynamic Testing

Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn. 4. Testing

Conditionals: Making Choices

Path Testing + Coverage. Chapter 8

Part I: Preliminaries 24

Lecture 18: Structure-based Testing

CS 520 Theory and Practice of Software Engineering Fall 2018

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

SOFTWARE ENGINEERING IT 0301 Semester V B.Nithya,G.Lakshmi Priya Asst Professor SRM University, Kattankulathur

Chapter 9. Software Testing

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

MTAT : Software Testing

Testing: Dataflow Coverage

Testing: Test design and testing process

Subject Software Testing Structural Testing

Software testing. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 23 Slide 1

Test design techniques

MTAT : Software Testing

Testing & Symbolic Execution

ASTQB Advance Test Analyst Sample Exam Answer Key and Rationale

Outline. Register Allocation. Issues. Storing values between defs and uses. Issues. Issues P3 / 2006

Data Flow Testing. CSCE Lecture 10-02/09/2017

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University

Quality Assurance in Software Development

Software Testing. Software Testing

Software Testing CS 408

Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt

Program Analysis. Program Analysis

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box

MTAT : Software Testing

Terminology. There are many different types of errors and different ways how we can deal with them.

Testing: Coverage and Structural Coverage

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015

Topics. Software Testing Test Driven Development Black Box Testing Unit Testing White Box Testing Coverage Testing Software Debugging

An Empirical Evaluation of Test Adequacy Criteria for Event-Driven Programs

Lecture 15 Software Testing

Verification and Validation

Verification and Validation

MSc Software Testing MSc Prófun hugbúnaðar

Software Engineering Fall 2014

MTAT : Software Testing

Testing. Outline. What is this? Terminology. Erroneous State ( Error ) Algorithmic Fault

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing

Chapter 8 Software Testing. Chapter 8 Software testing

Lecture 17: Testing Strategies. Developer Testing

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Chapter 10. Testing and Quality Assurance

Transcription:

What s Next IN 117 Project in Software Engineering Lecture Notes - Spring Quarter, 2008 Michele Rousseau Set 8 - esting Set 8 - esting 2 Announcements k Drop Boxes We will use drop boxes for the remainder of the qtr Please still post all deliverables ECEP: eam Appraisals, Peer Evals & Course Logs k Due: hursday Design Iteration #3 Code Iteration #1 Project Plan #3 k riday: Cust Approval of Design oday s Class kesting Coverage-Based esting Equivalence Partitioning Boundary Value esting Set 8 - esting 3 Set 8 - esting 4 Motivation kpeople are not perfect We make errors in design and code Goal of testing: given some code, uncover as many errors are possible kimportant and expensive activity Not unusual to spend 30-40% of total project effort on testing he Purpose of esting Design and coding are creative. but kesting is Destructive he primary goal is to break the software kvery often the same person does both coding and testing his is not ideal why? Need split personality : when you start testing, become paranoid and malicious Surprisingly hard to do: people don t like finding out that they made mistakes Set 8 - esting 5 Set 8 - esting 6 1

esting Approach esting is a process of executing software with the intent of finding errors kgood testing has a high probability of finding as-yet-undiscovered errors ksuccessful testing discovers unknown errors k If did not find any errors, need to ask Was our testing approach is good? Set 8 - esting 7 esting kunit esting kintegration esting ksystem esting kregression esting Set 8 - esting 8 V-Model of Development & esting (the big picture) Develop Requirements Requirements Review Design Design Review Code Code Review Develop Acceptance ests Acceptance est Review Develop Integration ests Integration ests Review Execute System ests Execute Integration ests Execute Unit ests Develop Unit ests Set 8 - esting Unit ests Review 9 undamental esting Questions kest Criteria: What should we test? kest Oracle: Is the test correct? kest Adequacy: How much is enough? kest Process: Is our testing effective? How to make the most of limited resources? Set 8 - esting 10 Some Commonly Used esting Approaches kcoverage or Control-flow based kdata-flow based kequivalence Partitioning kboundary Value Analysis Coverage-Based esting klow Graphs Control low Partial order of Statement Execution kdata D low low of values from Definition to Variables Graph representation of control flow and data flow relationships Set 8 - esting 11 Set 8 - esting 2

11 22 33 44 55 66 77 88 Prog P s Control low Graph (CG) 2,3,4 5 6 9 9a 9b 9 function P return INEGER is begin 9 if ( < 20 and then mod 2 = 0) then, : INEGER; 10 := + 20; READ(); READ(); 11 else while ( > 10) loop := 20; := 10; 13 end if; exit when = 10; return 2* + ; end loop; 15 end P; Set 8 - esting 13 7 10 All-Statements Coverage kselect test cases such that every node in the graph is visited Also called node coverage Guarantees that every er statement e t in the source code is executed at least once kselects minimal number of test cases Set 8 - esting All-Statements Coverage of P At least 2 test cases needed 2,3,4 5 6 7 10 9 Example all-statements-adequate test set: ( = 20, = 10) <2,3,4,5,6,7,9,10,> ( = 20, = 30) <2,3,4,5,6,7,9,,> Set 8 - esting 15 All-Branches Coverage kselect test cases such that every branch in the graph is visited Guarantees that every branch in the source code is executed at least once kmore thorough than All- Statements coverage More likely to reveal logical errors Set 8 - esting 16 All-Branches Coverage of P At least 2 test cases needed 2,3,4 5 6 7 10 9 Example all-branches-adequate test set: ( = 20, = 10) <2,3,4,5,6,7,9,10,> ( = 15, = 30) <2,3,4,5,6,7,5,9,,> Set 8 - esting 17 All-Edges Coverage kselect test cases such that every edge in the graph is visited akes complex statements into consideration treats them as separate nodes kmore thorough than All-Branches coverage More likely to reveal logical errors Set 8 - esting 18 3

All-Edges Coverage of P At least 3 test cases needed 2,3,4 5 6 9a 7 Example all-edges-adequate test set: ( = 20, = 10) <2,3,4,5,6,7,9a,9b,10,> ( = 5, = 30) <2,3,4,5,9a,,> ( = 21, = 10) <2,3,4,5,6,7,5,6,7,5,9a,9b,,> Set 8 - esting 19 9b 10 All-Paths Coverage kpath coverage Select test cases such that every path in the graph is visited Loops are a problem 0, 1, average, max iterations kmost thorough but is it feasible? Set 8 - esting 20 All-Paths Coverage of P Infinitely many test cases needed 6 7 10 234 2,3,4 5 9a 9b Example all-pathsadequate test set: ( = 5, = 10) ( = 15, = 10) ( = 25, = 10) ( = 35, = 10) Set 8 - esting 21 Subsumption of Criteria kc1 subsumes C2 if any C1- adequate test is also C2- adequate But t some 1 satisfying i C1 may detect fewer faults than some 2 satisfying C2 Set 8 - esting 22 Data-flow est connections between variable definitions ( write ) and variable uses ( read ) kvariation of the control flow graph A node represents a single statement, e t not a single-entry-single-exit chain of statements k Set DE(n) contains variables that are defined at node n (i.e., they are written) kset USE(n): variables that are read Set 8 - esting 23 Def-Use Pair ka def-use (DU) pair for variable x is a kpair of nodes (n1,n2) such that x is in DE(n1) the definition of x at n1 reaches n2 x is in USE(n2) k i.e., the value that is assigned to x at n1 is used at n2 Since the definition reaches n2, the value is not killed along some path n1 n2 Set 8 - esting 24 4

P s Control and Data low Graph 6 7 10 2,3,4 5 9a 9b est Adequacy ells you when to stop testing k Coverage-Based esting Coverage metrics when sufficient percentage of the program structure has been exercised k ault-based esting Empirical i assurance when failures/test curve flatten out Error seeding percentage of seeded faults found is proportional to the percentage of real faults found k Error-Based esting faults found in common are representative of total population of faults Equivalence Partitioning Set 8 - esting 25 Set 8 - esting 26 est Criteria k esting must select a subset of test cases that are likely to reveal failures k est Criteria provide the guidelines, rules, strategy by which test cases are selected actual test data conditions on test data requirements on test data k Equivalence partitioning is the typical approach a test of any value in a given class is equivalent to a test of any other value in that class if a test case in a class reveals a failure, then any other test case in that class should reveal the failure some approaches limit conclusions to some chosen class of errors and/or failures Set 8 - esting 27 Equivalence Partitioning (EQP) kesting technique Reduces the # of test cases Make the # of test cases manageable Systematic S t ti derivation of test t cases Reasonably tests the system Basic Principle: Some distinctions don t make a difference Set 8 - esting 28 EQP : How does it work Basic Method: Notice when any element in the partition will produce the same results (ie find the same faults) Divide inputs into equivalent partitions i.e. e ind a small # set of representative input values or each Class program behaves in an equivalent way Smaller test set but equally effective Set 8 - esting 29 EQP: Reduces test cases Input domain Large set of test inputs. Input domain partitioned into four sub-domains. Set 8 - esting 30 1 4 3 2 our test inputs, one selected from each sub-domain. 5

How to partition? Example 1 ksuppose that program P takes an input, being an integer. kor <0 perform task (1) kor >=0 perform task (2) Set 8 - esting 31 Set 8 - esting 32 wo sub-domains Equivalence class Equivalence class One Possible est Case: =-3 <0 >=0 Another test case: =15 All test inputs in the <0 sub-domain are considered equivalent. he assumption is that if one test input in this sub-domain reveals an error in the program, so will the others. his is true of the test inputs in the >=0 sub-domain also. Set 8 - esting 33 Set 8 - esting 34 EQP: Basic Process k irst you must break the input into sub-domains (partitions) Look at input and determine common properties Values with in defined range Values outside of the defined range Extremes ry to include input that will force incorrect output How well does the code perform exception handling Include inputs in and out of range Input est Data System I e Inputs causing anomalous behavior k If the sub-domains are well done should be able to create a few (or ideally) one test case that will represent the entire domain Output Set Oe Outputs which reveal the presence of defects Set 8 - esting 35 Set 8 - esting 36 6

EQP: Example 2 kinput should be a numerical month Valid Inputs: 1- kwhat are potential Classes? Input within range: 1- Out of Range High End: 20, 99, 3-digit, 4-digit Low End: Negative Numbers Alphanumeric Special Characters / Punctuation Boundary Value Analysis (BVA) k Select test cases based on the boundaries values k Look for inputs On the boundary On either side of the boundary k or numeric month example Boundary Values Low End: 0,1,2 High End: 11,,13 k Combining this technique with Equivalence Partitioning is much more effective Set 8 - esting 37 Set 8 - esting 38 EQP &BVA k Input 5-digit integer between 10,000 and 99,999, k Partitions <10,000 10,000-99,999 > 10, 000 k Boundary Values 00000 09,999 10,000 99,998 99,999 100,000 k Outside Alphanumeric Symbols Set 8 - esting 39 What do you need to do? khave a plan! Not monkey testing kcreate test cases wisely (think about what they are covering) kdefine your test cases and results ksee Read-set templates Set 8 - esting 40 Ready-set emplates khttp://readyset.tigris.org/nonav /templates/frameset.html khttp://readyset.tigris.org/nonav /templates/frameset.html t /f t l kadd results.. Pass/fail Set 8 - esting 41 Integration esting kpurpose: to exercise the interfaces between classes/modules Driven by design What should it take in? What should it supply? What happens if they send the wrong stuff? kbasic approaches op-down Bottom-up Run tests developed during the design phase Set 8 - esting 42 7

Which Approach to use? k op-down or Bottom Up? k In practice, most integration involves a combination of these strategies t System esting kblack box krunning Acceptance est Plan Set 8 - esting 43 Set 8 - esting 44 One Last Announcement kno class Wednesday Set 8 - esting 45 8