How do you define Input Space Partition Testing and how can it be used with Unit Testing, Integration Testing and System Testing?
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
Input parameters define the scope of the input domain
– Parameters to a method – Data read from a file
– Global variables
User-level inputs Introduction to Software Testing
4 Input-Space Partitioning (ISP)
• Domain for each input parameter is partitioned into regions
• At least one value is chosen from each region 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 Introduction to Software Testing
Partitioning Domains
• Domain
• Partition scheme q of
• The partition q defines a set of blocks,
Bq = b1 , b2 , … bQ
• The partition must satisfy two properties :
1. blocks must be pairwise disjoint (no overlap)
2. together the blocks cover the domain D
– 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, …)
– Min separation of two aircraft – Input device (DVD, CD, VCR, computer, …) Introduction to Software Testing
• Choosing (or defining) partitions seems easy, but is easy to get wrong
• Consider the “order of file F” b1 = sorted in ascending order b2 = sorted in descending order b3 = arbitrary order but … something’s fishy … What if the file is of length 1? The file will be in all three blocks … That is, disjointness is not satisfied Solution: Each characteristic should address just one property File F sorted ascending - b1 = true - b2 = false File F sorted descending - b1 = true - b2 = false Introduction to Software Testing (Ch 4) © Ammann & Offutt 8 Properties of Partitions • If the partitions are not complete or disjoint, that means the partitions have not been considered carefully enough • They should be reviewed carefully, like any design attempt • Different alternatives should be considered
• We model the input domain in five steps … Introduction to Software Testing
Input Domain
• Step 1 : Identify testable functions (characteristics)
– Individual methods have one testable function
– In a class, each method often has the same characteristics
– Programs have more complicated characteristics—modeling documents such as UML use cases can be used to design characteristics
– Systems of integrated hardware and software components can use devices, operating systems, hardware platforms, browsers, etc
Step 2 : Find all the parameters
– Often fairly straightforward, even mechanical
– Important to be complete
– Methods : Parameters and state (non-local) variables used
– Components : Parameters to methods and state variables
– System : All inputs, including files and databases
• Step 3 : Model the input domain
– The domain is scoped by the parameters
– The structure is defined in terms of characteristics
– Each characteristic is partitioned into sets of blocks
– Each block represents a set of values
– This is the most creative design step in using ISP Introduction to Software Testing
• Step 4 :
Apply a test criterion to choose combinations of values
– A test input has a value for each parameter
– One block for each characteristic
– Choosing all combinations is usually infeasible
– Coverage criteria allow subsets to be chosen
• Step 5 : Refine combinations of blocks into test inputs
– Choose appropriate values from each block.
Unit testing means testing individual modules of an application in isolation (without any interaction with dependencies) to confirm that the code is doing things right.
Integration testing means checking if different modules are working fine when combined together as a group.
System Testing:
System testing is done to check whether the software or product
meets the specified requirements or not. It is done by both testers
and developers. It contains the System testing and Integration
testing. It is done through more positive and negative teat
cases.
Get Answers For Free
Most questions answered within 1 hours.