Software Testing Input Space Partition Testing. 2 Input Space Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases.

Slides:



Advertisements
Similar presentations
Introduction to Software Testing Chapter 6 Input Space Partition Testing Paul Ammann & Jeff Offutt
Advertisements

Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
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.
Software testing.
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.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
Physical design. Stage 6 - Physical Design Retrieve the target physical environment Create physical data design Create function component implementation.
Testing an individual module
- Testing programs to establish the presence of system defects -
Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt
Testing techniques, example
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
CS 217 Software Verification and Validation Week 6, Summer 2014 Instructor: Dong Si
Introduction Telerik Software Academy Software Quality Assurance.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Testing phases. Test data Inputs which have been devised to test the system Test cases Inputs to test the system and the predicted outputs from these.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software testing techniques 3. Software testing
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
CS 217 Software Verification and Validation Week 3, Summer 2014 Instructor: Dong Si
Requirements-based Test Generation for Functional Testing (© 2012 Professor W. Eric Wong, The University of Texas at Dallas) 1 W. Eric Wong Department.
1 Software Defect Testing Testing programs to establish the presence of system defects.
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.
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.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
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
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
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 Test case design l Involves designing the test cases (inputs and outputs) used.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Defect testing Testing programs to establish the presence of system defects.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
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
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
ISP Coverage Criteria CS 4501 / 6501 Software Testing
Software Engineering (CSI 321)
Input Space Partition Testing CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Testing the Software with Blinders on
Structural testing, Path Testing
Paul Ammann & Jeff Offutt
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Paul Ammann & Jeff Offutt
Software testing.
ISP Coverage Criteria CS 4501 / 6501 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.
Introduction to Data Structure
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Software Testing Input Space Partition Testing

2 Input Space Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases Specs Design Source Applied to DNF Specs FSMs Source Input Models Integ Source

3 Benefits of ISP Can be equally applied at several levels of testing –Unit –Integration –System Relatively easy to apply with no automation Easy to adjust the procedure to get more or fewer tests No implementation knowledge is needed –just the input space

Test data: Inputs which have been devised to test the system. Test cases: Inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification. Test Data and Test Cases

Black-box testing Characteristics of Black-box testing: –Program is treated as a black box. –Implementation details do not matter. –Requires an end-user perspective. –Criteria are not precise. –Test planning can begin early.

6 Input Domains The input domain to a program contains all the possible inputs to that program For even small programs, the input domain is so large that it might as well be infinite Testing is fundamentally about choosing finite sets of values from the input domain

7 Input Domains Input parameters define the scope of the input domain –Parameters to a method –Data read from a file –Global variables –User level inputs Domain for each input parameter is partitioned into regions At least one value is chosen from each region

Data Testing If you think of a program as a function, the input of the program is its domain. Examples of program data are: –words typed into MS Word –numbers entered into Excel –picture displayed in Photoshop –the number of shots remaining in an arcade game –…

Equivalence Partitioning Equivalence partitioning is the process of methodically reducing the huge (or infinite) set of possible test cases into a small, but equally effective, set of test cases.

Equivalence partitions

11 Partitioning Domains Domain D Partition scheme q of D The partition q defines a set of blocks, Bq = b 1, b 2, … b Q The partition must satisfy two properties : 1.blocks must be pairwise disjoint (no overlap) 2.together the blocks cover the domain D (complete) b i  b j = ,  i  j, b i, b j  B q b1b1 b2b2 b3b3  b = D b  Bq

12 Using Partitions – Assumptions Choose a value from each partition Each value is assumed to be equally useful for testing Application to testing –Find characteristics in the inputs : parameters, semantic descriptions, … –Partition each characteristic –Choose tests by combining values from characteristics Example Characteristics –Input X is null –Order of the input file F (sorted, inverse sorted, arbitrary, …) –Input device (DVD, CD, VCR, computer, …)

Example: Loan application Customer Name Account number Loan amount requested Term of loan Monthly repayment Term: Repayment: Interest rate: Total paid back: 6 digits, 1st non-zero £500 to £ to 30 years Minimum £ chars. Choosing (or defining) partitions seems easy, but is easy to get wrong

Customer name Number of characters: invalidvalidinvalid 1 Valid characters: Any other A-Z a-z -’ space

Loan amount invalidvalidinvalid 499

Design test cases Test Case DescriptionExpected OutcomeNew Tags Covered 1 2 Name:John Smith Acc no: Loan:2500 Term:3 years Name:AB Acc no: Loan:500 Term:1 year Term:3 years Repayment:79.86 Interest rate:10% Total paid: Term:1 year Repayment:44.80 Interest rate:7.5% Total paid: V1, V2, V3, V4, V B1, B3, B5,.....

Search routine specification procedure Search (Key : INTEGER ; T: array 1..N of INTEGER; Found : BOOLEAN; L: 1..N) ; Pre-condition -- the array has at least one element 1 <= N Post-condition -- the element is found and is referenced by L ( Found and T (L) = Key) or -- the element is not in the array ( not Found and not (exists i, 1 >= i >= N, T (i) = Key ))

Inputs which conform to the pre- conditions. Inputs where a pre-condition does not hold. Inputs where the key element is a member of the array. Inputs where the key element is not a member of the array. Search routine input partitions

Search routine test cases

Binary search (Java)

Binary search equiv. partitions

Binary search flow graph

1, 2, 3, 8, 9 1, 2, 3, 4, 6, 7, 2 1, 2, 3, 4, 5, 7, 2 1, 2, 3, 4, 6, 7, 2, 8, 9 Test cases should be derived so that all of these paths are executed A dynamic program analyser may be used to check that paths have been executed Independent paths

25 Two Approaches to Input Domain Modeling 1. Interface-based approach –Develops characteristics directly from individual input parameters –Simplest application 2. Functionality-based approach –Develops characteristics from a behavioral view of the program under test –Harder to develop—requires more design effort –May result in better tests, or fewer tests that are as effective

26 1. Interface-Based Approach Mechanically consider each parameter in isolation This is an easy modeling technique and relies mostly on syntax Some domain and semantic information won’t be used Ignores relationships among parameters

27 2. Functionality-Based Approach Identify characteristics that correspond to the intended functionality Requires more design effort from tester Can incorporate domain and semantic knowledge Can use relationships among parameters Modeling can be based on requirements, not implementation The same parameter may appear in multiple characteristics, so it’s harder to translate values to test cases

28 Identifying Functionalities, Parameters and Characteristics Interface-based : Translate parameters to characteristics Candidates for characteristics : –Preconditions and postconditions –Relationships among variables –Relationship of variables with special values (zero, null, blank, …) Should not use program source – characteristics should be based on the input domain –Program source should be used with graph or logic criteria

29 Interface vs Functionality-Based public boolean findElement (List list, Object element) // Effects: if list or element is null throw NullPointerException // else return true if element is in the list, false otherwise Interface-Based Approach Two parameters : list, element Characteristics : list is null (block1 = true, block2 = false) list is empty (block1 = true, block2 = false) Functionality-Based Approach Two parameters : list, element Characteristics : number of occurrences of element in list (0, 1, >1) element occurs first in list (true, false) element occurs last in list (true, false)

30 Example Handling Constraints Sorting an array –Input : variable length array of arbitrary type –Outputs : sorted array, largest value, smallest value Characteristics: Length of array Type of elements Max value Min value Position of max value Position of min value Partitions: Len { 0, 1, , 101..MAXINT } Type { int, char, string, other } Max {  0, 1, >1, ‘a’, ‘Z’, ‘b’, …, ‘Y’ } Min { … } Max Pos { 1, 2.. Len-1, Len } Min Pos { 1, 2.. Len-1, Len }

Example: student access A university computer system allows students an allocation of disc space depending on their projects. If they have used all their allotted space, they are only allowed restricted access, i.e. to delete files, not to create them. This is assuming they have logged on with a valid username and password. What are the input and output conditions?

List the input and output conditions list the ‘output conditions’ under the input conditions list the ‘input conditions’ in the first column of the table

Determine input combinations add columns to the table for each unique combination of input conditions. each entry in the table may be either ‘T’ for true, ‘F’ for false.

Complete the table determine the expected output conditions for each combination of input conditions

Determine test case groups each column is at least one test case

Design test cases usually one test case for each column but can be none or several