Software Testing and Quality Assurance - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Software Testing and Quality Assurance

Description:

Loops Two If/then/else statements C1a x+y 2 C1b x+y3 C2b(C1 F) 3x-4y3 (2,0) TT FT (3/22,0) (1,0) TF FF (0,2) (0,3/22) (0,4/3) ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 12
Provided by: khal168
Category:

less

Transcript and Presenter's Notes

Title: Software Testing and Quality Assurance


1
Software Testing and Quality Assurance
  • Lecture 6 - Software Testing Techniques

2
Lecture Outline
  • Introduction to domain testing.
  • How to select test cases based on domain
    boundaries.

3
Domain Testing
  • Partition input of a program using the program
    structure itself.
  • Input space is first partitioned into a set of
    mutually exclusive classes.
  • Each corresponds to a program path.
  • Test cases are selected from
  • The domain boundaries
  • Points close to the domain boundaries.

4
Example
  • int f (float x, y)
  • float w, z
  • w x y
  • if (x y 2)
  • z x - 3y
  • else
  • z 2x - 5y
  • if (z w gt 3)
  • z f(x,y,z)
  • else
  • z g(x,y,z)
  • Return z

Two If/then/else statements
5
Example
  • int f (float x, y)
  • float w, z
  • w x y
  • if (x y 2)
  • z x - 3y
  • else
  • z 2x - 5y
  • if (z w gt 3)
  • z f(x,y,z)
  • else
  • z g(x,y,z)
  • Return z

C1a xy2
C1b xylt2
C2a(C1 T) 2x-2ygt3
C2b(C1 F) 3x-4ygt3
6
Domains for the program
(2,0)
TT
FF
(3/22,0)
(0,2)
FT
(1,0)
TF
(0,3/22)
(0,4/3)
7
Simple Compound Predicates
  • Simple predicates contain a set of variables such
    as
  • lt, gt, etc.
  • Create simple boundaries.
  • Compound predicate are
  • AND operators
  • OR operators
  • Combination of both

8
Compound Predicate -Example
X 0 V X 2
X 0
X 2
Function 1
Function 2
Sun-domain
Sun-domain
This region is not part of the sub-domain being
tested.
9
Loops in programs
  • If each program path corresponds to a function
    then for loops
  • We may have an infinite number of paths.
  • An infinite number of equivalence classes.
  • Apply zero- to-many rule.
  • Minimum number of times a loop can execute is
    zero.
  • Some loops have upper bound, so treat that as a
    path.

10
Loops in programs
  • Zero times - we can test paths that do no execute
    the loop.
  • Once - test that the loop can be entered and
    result of single iteration are correct.
  • Twice - to test that the results remain correct
    between different iterations of loop.
  • N times (more than 2) - to test that an arbitrary
    number of iterations returns the correct results
    and
  • N 1 times - test that after an arbitrary number
    of iterations the result remain correct.

11
Key points
  • To select test cases, input space is first
    partitioned into a set of equivalence classes.
  • Simple predicates.
  • Compound predicates.
  • Loops
Write a Comment
User Comments (0)
About PowerShow.com