r30 - 18 Sep 2009 - 16:07:16 - WikiAdminYou are here: SETEC Wiki >  Knowledge Web  > SoftwareEngineeringCategory > AboutSoftwareTesting > BoundaryValueTesting

Boundary Valeu Testing

Boundary Value Analysis : BVA

Function F with 2 Variables : x1 and x2 When F si implemented as a program, x1 and x2 will have some boundaries :

  • a = <x1 =<b
  • c = <x2 =<d
Legitimate input is any point within the shaded area BVA focuses on the boundary of the input space to identify test cases

Traingle : boundary Value Analysis Test Cases

Generalizing Boundary Vale Analysis

  • BVA is Generalized in 2 ways :
    • by number of variables
      • a program is like a functio of n variables
      • one variable with min. min+, nom, max-, max, and the rest with nominal values
      • BVA yields 4n+1 test cases
    • by kinds of ranges
      • depend on the nature of variables
      • month--> can be encoded: Jan-1, Feb-2 (min-->Jan, min+-->Feb)
      • monthe cand be an enumerated type (for language supporting user-defined type)
      • a variable can be discrete bounded values
      • create bounded valued when no explicit bounds present
      • Boolean and Logical Variables present a problem for BVA

Limitations of BVA

  • BVA works well with several independent variables that represent bounded physical quantities
  • some variables are dependent
    • month, year in NextDate?
  • BVA does not concern
    • nature of the function
    • semantic meaning of the variables

Rubustness Testing

  • is an extension of BVA
  • includes min-, and max+ in BVA
  • there is a problem for expected outputs
    • what happens when a physical quantity exceeds its maximumM
  • Even strongly type implicit check for bounded values but we still need to perform explicit range checking and use exception handling to deal with robust values.

Robustness Test Cases (A Function with 2 Variables)

Worst-Case Testing

  • Reject single fault assumption
    • what happens when one variable has an extreme values
  • Worst-Case test cases come from cartesian product of five-element set
  • BVA test cases are a proper subset of worst-case test cases
  • yield 5n test cases
  • Robust worst-case testing
    • involves the cartesian product of seven-element set

Worst-Case Test Cases (A Function with 2 Variables)

Robust Worst-Case Test Cases (A Function with 2 Variables)

Special Value Testing

  • or "ad-hoc testing"
  • occurs when a tester
    • uses his/her domain knowledge
    • experience with similar programs
    • uses information about "soft spots" to devise test cases
  • no guidance, just "best engineering judgement"
  • depends on abilities of testers
  • examples : test Feb 28, Feb 29, and Leap Years for NextDate?

Test Cases for the Commission Problem

  • Look at BVA of output range
  • find input variable combinations that stress the boundary values $100, $1000, $1800, and $7,800

Random Testing

  • rather than choosing min, min-, nom, max-, max, use a random number generator to pick test case values
  • how many random test cases are sufficient?
    • Test cases are generated until at least one of each output occurs

Guidelines for BVA Testing

  • Test Methods base on input domain of a program
  • input variables are independent
  • unsatisfactory test cases can be generated (Feb 31, 1912)
  • 2 distinctions :
    • normal VS robust values
    • single fault VS multiple fault assumption
  • each testing method mentioned can be applied to output range
  • domain analysis can be used for internal variables (loop counter, index, pointers)

Equivalence Class Testing

Equivalence Classes

  • avoid redundancy
  • form a partition of a set, where partition refers to a collection of mutually disjoint subsets (the union is the entire set)
  • 2 implications of testing :
    • the entire set provide completeness
    • disjointendess ensures a form of redundancy
  • equivalence class testing :
    • use one element from each equivalence class

Weak Normal Equivalence Class Testing

  • Use one variable from each equivalence class (interval) in a test case
  • is based on single fault assumption

Strong Normal Equivalence Class Testing

  • is based on multipel fault assumption
  • test each element of the Cartesian product of the equivalence classes
  • the Cartesian product guarantees :
    • cover all equivanlence classes
    • cover each possible combination of inputs

Weak Robust Equivalence Class Testing

  • Robust - consider invalid values
  • Weak - single fault assumption
  • For valid inputs
    • use one value from each valid class
  • For invalid inputs
    • ue one invalid value and the remaining values will be all valid
  • Problem - specification does not define what the expected result should be for the invalid values

Strong Robust Equivalence Class Testing

  • Robust - consider invalid values
  • Strong - multiple fault assumption
  • Test cases are from each element of the Cartesian product of all the equivalence classes

Equivalence Class Test Cases : The Triangle Problem

  • Use output equivalence class
  • 4 possible outputs : Equilateral, Isosceles, Scalene, and Not ATriangle
  • 4 output equivalence class :
    • R1 ={<a,b,c> : the triangle with sides a, b, and c is equilateral}
    • R2 ={<a,b,c> : the triangle with sides a, b, and c is isosceles}
    • R3 ={<a,b,c> : the triangle with sides a, b, and c is scalene}
    • R4 ={<a,b,c> : the triangle with sides a, b, and c do not form a triangle}

Weak Normal Equivalence Class Test Cases : The Triangle Problem

Weak Robust Equivalence Class Test Cases : The Triangle Problem

Strong Robust Equivalence Class Test Cases : The Triangle Problem

Input Equivalence Classes : The Triangle Problem

Weak and Strong Normal Test Cases : The NextDate? Problem

Weak Robust Test Cases : The NextDate? Problem

Strong Robust Test Cases : The NextDate? Problem

Another Set of Input Equivalence Classes : The NextDate? Problem

Input Equivalence Class : The Commission Problem

Strong Robust Test Cases : The Commission Problem

Output Equivalence Classes and Test Cases : The Commission Problem

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r30 < r29 < r28 < r27 < r26 | More topic actions
 
Powered by SETEC Wiki
Copyright ©2012 by National Electronics and Computer Technology Center, NECTEC.
Ideas, requests, problems regarding SETEC Wiki? Send feedback