Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.

Slides:



Advertisements
Similar presentations
Testing “Multiple Conditions” with Decision Table Technique
Advertisements

Overview Functional Testing Boundary Value Testing (BVT)
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Foundations of Software Testing Chapter 2: Test Generation: Requirements Last update: September 3, 2007 These slides are copyrighted. They are for use.
Introduction to Software Testing Chapter 6 Input Space Partition Testing Paul Ammann & Jeff Offutt
CompSci 230 Software Design and Construction Software Quality 2014S2 Black box testing.
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
Black box testing  Black box tests focus on the input/output behavior of the component  Black-box tests do not deal with the internal aspects of the.
Today’s Agenda  HW #1 Due  Quick Review  Finish Input Space Partitioning  Combinatorial Testing Software Testing and Maintenance 1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing and Quality Assurance
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt
Equivalence Class Testing
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 9 Functional Testing
Black Box Software Testing
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Com1040 Systems Design and Testing Part II – Testing (Based on A.J. Cowling’s lecture notes) LN-Test3: Equivalence classes and boundary conditions Marian.
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Software Engineering Chapter 23 Software Testing Ku-Yaw Chang Assistant Professor Department of Computer Science and Information.
Requirements-based Test Generation for Functional Testing (© 2012 Professor W. Eric Wong, The University of Texas at Dallas) 1 W. Eric Wong Department.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
SWE 619 © Paul Ammann Procedural Abstraction and Design by Contract Paul Ammann Information & Software Engineering SWE 619 Software Construction cs.gmu.edu/~pammann/
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
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.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Black-box Testing.
Today’s Agenda  HW #1  Finish Introduction  Input Space Partitioning Software Testing and Maintenance 1.
(1) Unit Testing and Test Planning CS2110: SW Development Methods These slides design for use in lab. They supplement more complete slides used in lecture.
Software Testing Input Space Partition Testing. 2 Input Space Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases.
Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt retest/
1 Input Space Partitioning(2). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 4  Section 4.1  Section
Equivalence Class Testing In chapter 5, we saw that all four variations of boundary value testing are vulnerable to –gaps of untested functionality, and.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
Testing and inspecting to ensure high quality An extreme and easily understood kind of failure is an outright crash. However, any violation of requirements.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt
1 © 2011 Professor W. Eric Wong, The University of Texas at Dallas Requirements-based Test Generation for Functional Testing W. Eric Wong Department of.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
1 Software Testing. 2 Equivalence Class Testing 3 The use of equivalence class testing has two motivations: –Sense of complete testing –Avoid redundancy.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Defect testing Testing programs to establish the presence of system defects.
Introduction to Software Testing. Introduction 2 Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases Specs Design Source Applied.
Paul Ammann & Jeff Offutt
Functional testing, Equivalence class testing
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
Testing Tutorial 7.
Paul Ammann & Jeff Offutt
Decision Table Testing
ISP Coverage Criteria CS 4501 / 6501 Software Testing
Input Space Partition Testing CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Overview Functional Testing Boundary Value Testing (BVT)
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
CS 1111 Introduction to Programming Fall 2018
ISP Coverage Criteria CS 4501 / 6501 Software Testing
Overview Functional Testing Boundary Value Testing (BVT)
Chapter 7 Software Testing.
Presentation transcript:

Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1

Quick Review What are the three major steps of software testing? Software Testing and Maintenance 2

Software Testing and Maintenance 3 Input Space Partitioning  Introduction  Equivalence Partitioning  Boundary-Value Analysis  Summary

Software Testing and Maintenance 4 The Test Selection Problem  The input domain of a program consists of all possible inputs that could be taken by the program.  Ideally, the test selection problem is to select a subset T of the input domain such that the execution of T will reveal all errors.  In practice, the test selection problem is to select a subset of T within budget such that it reveals as many errors as possible.

Software Testing and Maintenance 5 Example  Consider a program that is designed to sort a sequence of integers into the ascending order.  What is the input domain of this program?

Software Testing and Maintenance 6 Main Idea  Partition the input domain into a relatively small number of groups, and then select one representative from each group I1 I2 V1 V2 V3 Valid Invalid

Software Testing and Maintenance 7 Major Steps  Step 1: Identify the input domain  Read the requirements carefully and identify all input and output variables, any conditions associated with their use.  Step 2: Identify equivalence classes  Partition the set of values of each variable into disjoint subsets, based on the expected behavior.  Step 3: Combine equivalence classes  Use some well-defined strategies to avoid potential explosion  Step 4: Remove infeasible combinations of equivalence classes

Software Testing and Maintenance 8 Input Space Partitioning  Introduction  Equivalence Partitioning  Boundary-Value Analysis  Summary

Software Testing and Maintenance 9 Input Parameter Modeling  Step 1: Identify testable components, which could be a method, a use case, or the entire system  Step 2: Identify all of the parameters that can affect the behavior of a given testable component  Input parameters, environment configurations, state variables.  For example, insert(obj) typically behaves differently depending on whether the object is already in a list or not.  Step 3: Identify characteristics, and create partitions for each characteristic  Step 4: Select values from each partition, and combine them to create tests

Software Testing and Maintenance 10 Partition  A partition defines a set of equivalent classes, or blocks  All the members in an equivalence class contribute to fault detection in the same way  A partition must satisfy two properties:  Completeness: A partition must cover the entire domain  Disjoint: The blocks must not overlap  A partition is usually based on certain characteristic  e.g., whether a list of integer is sorted or not, whether a list allows duplicates or not

Software Testing and Maintenance 11 Interface-Based IPM (1)  The main idea is to identify parameters and values, typically in isolation, based on the interface of the component under test.  Advantage: Relatively easy to identify characteristics  Disadvantage: Not all information is reflected in the interface, and testing some functionality may require parameters in combination

Software Testing and Maintenance 12 Interface-Based IPM (2)  Range: one class with values inside the range, and two with values outside the range  For example, let speed  [ ]. Then, we generate three classes {{50}, {75}, {92}}.  String: at least one containing all legal strings and one containing all illegal strings.  For example, let fname: string be a variable to denote a first name. Then, we could generate the following classes: {{  }, {Sue}, {Sue2}, {Too long a name}}.

Software Testing and Maintenance 13 Interface-Based IPM (3)  Enumeration: Each value in a separate class  For example, consider auto_color  {red, blue, green}. The following classes are generated, {{red}, {blue}, {green}}  Array: One class containing all legal arrays, one containing only the empty array, and one containing arrays larger than the expected size  For example, consider int[] aName = new int [3]. The following classes are generated: {{[]}, {[-10, 20]}, {[-9, 0, 12, 15]}.

Software Testing and Maintenance 14 Functionality-Based IPM (1)  The main idea is to identify characteristics that correspond to the intended functionality of the component under test  Advantage: Includes more semantic information, and does not have to wait for the interface to be designed  Disadvantage: Hard to identify characteristics, parameter values, and tests

Software Testing and Maintenance 15 Functionality-Based IPM (2)  Preconditions explicitly separate normal behavior from exceptional behavior  For example, a method requires a parameter to be non- null.  Postconditions indicates what kind of outputs may be produced  For example, if a method produces two types of outputs, then we want to select inputs so that both types of outputs are tested.  Relationships between different parameters can also be used to identify characteristics  For example, if a method takes two object parameters x and y, we may want to check what happens if x and y point to the same object or to logically equal objects

Software Testing and Maintenance 16 Example (1)  Consider a triangle classification program which inputs three integers representing the lengths of the three sides of a triangle, and outputs the type of the triangle.  The possible types of a triangle include scalene, equilateral, isosceles, and invalid. int classify (int side1, int side2, int side3) 0: scalene, 1: equilateral, 2: isosceles; -1: invalid

Software Testing and Maintenance 17 Example (2)  Interface-based IPM: Consider the relation of the length of each side to some special value such as zero Partitionb1b2b3 Relation of Side 1 to 0 > 0= 0< 0 Relation of Side 2 to 0 > 0= 0< 0 Relation of Side 3 to 0 > 0= 0< 0

Software Testing and Maintenance 18 Example (3)  Functionality-based IPM: Consider the traditional geometric classification of triangles Partitionb1b2b3b4 Geometric classification ScaleneIsocelesEquilateralInvalid

Software Testing and Maintenance 19 Example (4) Partitionb1b2b3b4 Geometric classification ScaleneIsoceles, not equilateral EquilateralInvalid Paramb1b2b3b4 Triangle(4, 5, 6)(3, 3, 4)(3, 3, 3)(3, 4, 8)

Software Testing and Maintenance 20 GUI Design (1)  Suppose that an application has a constraint on an input variable X such that it can only assume integer values in the range  Without GUI, the application must check for out- of-range values.  With GUI, the user may be able to select a valid value from a list, or may be able to enter a value in a text field.

Software Testing and Maintenance 21 GUI Design (2) Application 1 2 Correct values Incorrect values GUI-A Core Application Correct values GUI-B Core Application Correct values 2

Software Testing and Maintenance 22 Input Space Partitioning  Introduction  Equivalence Partitioning  Boundary-Value Analysis  Summary

Software Testing and Maintenance 23 Motivation  Programmers often make mistakes in processing values at and near the boundaries of equivalence classes.  For example, a method M is supposed to compute a function f1 when condition x <= 0 and function f2 otherwise. However, M has an error such that it computes f1 for x < 0 and f2 otherwise.

Software Testing and Maintenance 24 Boundary-Value Analysis  A test selection technique that targets faults in applications at the boundaries of equivalence classes.  Partition the input domain  Identify the boundaries for each partition  Select test data such that each boundary value occurs in at least one test input

Software Testing and Maintenance 25 Example  Consider a method findPrices that takes two inputs, item code ( ) and quantity ( ).  The method accesses a database to find and display the unit price, the description, and the total price, if the code and quantity are valid.  Otherwise, the method displays an error message and return.

Software Testing and Maintenance 26 Example (2)  Equivalence classes for code:  E1: Values less than 99  E2: Values in the range  E3: Values greater than 999  Equivalence classes for quantity:  E4: Values less than 1  E5: Values in the range  E6: Values greater than 100

Software Testing and Maintenance 27 Example (3) E1 E E4 E5 E6

Software Testing and Maintenance 28 Example (4)  Tests are selected to include, for each variable, values at and around the boundary  An example test set is T = { t1: (code = 98, qty = 0), t2: (code = 99, qty = 1), t3: (code = 100, qty = 2), t4: (code = 998, qty = 99), t5: (code = 999, qty = 100), t6: (code = 1000, qty = 101) }

Software Testing and Maintenance 29 Example (5) public void findPrice (int code, int qty) { if (code 999) { display_error (“Invalid code”); return; } // begin processing }

Software Testing and Maintenance 30 Example (6)  One way to fix the problem is to replace t1 and t6 with the following four tests: t7 = (code = 98, qty = 45), t8 = (code = 1000, qty = 45), t9 = (code = 250, qty = 0), t10 = (code = 250, qty = 101).

Software Testing and Maintenance 31 Input Space Partitioning  Introduction  Equivalence Partitioning  Boundary-Value Analysis  Summary

Software Testing and Maintenance 32 Summary  Test selection is about sampling the input space in a cost-effective manner.  The notions of equivalence partitioning and boundary analysis are so common that sometimes we apply them without realizing it.  Interface-based IPM is easier to perform, but may miss some important semantic information; functionality-based IPM is more challenging, but can be very effective in many cases.  Boundary analysis considers values both at and near boundaries.