1841f07subdomains2aug23 question u what is the main purpose of software testing?

19
1 841f07subdomains2Aug23 Question What is the main purpose of software testing?

Upload: rosaline-miles

Post on 14-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

1841f07subdomains2Aug23

Question

What is the main purpose of software testing?

Page 2: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

2841f07subdomains2Aug23

Testing Basics

Subdomains

Page 3: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?
Page 4: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

4841f07subdomains2Aug23

Failure Set

The failure set for a fault is the set of points in the program domain that display the fault, that is, cause the output to be different from specified.

Page 5: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

5841f07subdomains2Aug23

Programming task

Who had the smallest failure set?

Who had the largest failure set?

Who had a strange failure set?

Page 6: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

6841f07subdomains2Aug23

Failure Set

-15

-10

-5

0

5

10

15

-15 -10 -5 0 5 10 15

Series1

Page 7: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?
Page 8: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

8841f07subdomains2Aug23

Subdomain

A subdomain is a set of input points (data points, tests, etc) that are treated identically by the program. That is, they take the same path through the program and the same operations are applied to the values.

Or a set of such subdomains Sometimes called a partition

Page 9: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

9841f07subdomains2Aug23

Different uses in the literature

Much like mine – with mutual exclusion Arbitrary division of the input domain Any definable subset of the input domain

Other?

Page 10: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

10841f07subdomains2Aug23

Example - Payroll Problem

Wages must be greater than zero and less than 100

Hours must be greater than zero and less than 80

Time and a half is paid on hours over 40

Page 11: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

11841f07subdomains2Aug23

Subdomains of Example

I II

0,0

0,100

40,0 80,0

Page 12: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

12841f07subdomains2Aug23

TTYP – how do faults affect the subdomains?

Pay = hours * wage

If hours > 40 then pay = pay + .5*(hours-40)*wage Consider some possible faults in the payroll

program– Can you find faults that affect a whole subdomain?

– Can you find faults that move the boundaries?

– Can you find faults that make bigger changes?

Page 13: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

13841f07subdomains2Aug23

Boundary Testing Example - 2on/1off

V

I II

I-V : (0,100),(40,100),(20,99)

II-V : (41,100),(79,100),(60,99)

I-II : (40,1),(40,99),(41,50)

Page 14: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

14841f07subdomains2Aug23

Triangle Example

cin >> a >> b >> c ;type = “scalene”;if (a == b || a == c || b == c) type= “isosceles”;if (a == b && a == c) type = “equilateral”;if (a >= b+c || b >= a+c || c >= a+b) type=“not a triangle”;if (a <= 0 || b <= 0 || c <= 0) type=“bad input”;cout<< type;

Page 15: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

15841f07subdomains2Aug23

Triangle Domain : a = b plane

a=b

c

a=b=c

a=b=.5c

not a triangle

isosceles

bad inputs

isosceles

bad inputs

Page 16: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

16841f07subdomains2Aug23

Triangle Domain : a = .5b plane

a=.5b

c

a=.5b=.5c

not a triangle

scalene

bad inputs

isosceles

bad inputs

a+b=c

a=b+c

scalene

not a triangle

Page 17: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

17841f07subdomains2Aug23

Control Flow Graph

I: cout

B: type = isoscles

D: type = equilateral

F: type = not a triangle

H: type = bad input

A: type = scalene

C: if

E: if

G: if

Page 18: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

18841f07subdomains2Aug23

TTYP - subdomains

Are paths the best subdomains? Would a functional decomposition be

better? Should we re-define the term subdomain?

Page 19: 1841f07subdomains2Aug23 Question u What is the main purpose of software testing?

19841f07subdomains2Aug23

For Tuesday, Aug 28

Read ch28 – Shrostrup’s chapter on testing