unit – 2 boundary value testing, equivalence class testing ... · unit –2 boundary value...

31
Unit 2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8 th Sem, A Div 2017 - 18 Prof. Mouna M. Naravani

Upload: others

Post on 23-Sep-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Unit – 2Boundary Value Testing,

Equivalence Class Testing, Decision Table-Based Testing

ST

8th Sem, A’ Div

2017 - 18

Prof. Mouna M. Naravani

Page 2: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision Tables

• Decision tables are used to represent and analyse complex logical relationships.

• Ideal for describing situations in which a number of combinations of actions are

taken under varying sets of conditions.

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 2

Page 3: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

➢A Decision table has 4 parts:

➢Condition stub

➢Condition entries

➢Action stub

➢Action entries

➢ The left most column is the stub portion

➢ The right is the entry portion

➢ Condition portion is denoted by c’s.

➢ Action portion is denoted by a’s

➢ A column in entry portion is a rule.

➢ -- “don’t care” entry

➢ The don’t care entry has two

interpretation:

➢ Condition is irrelevant

➢ Condition does not apply

➢ Also denoted as “n/a”

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 3

Page 4: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Indicate

inputs

Indicate

outputs

Rules are interpreted as test cases.08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 4

Page 5: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

➢Decision tables in which all the conditions are binary are called Limited Entry

Decision Tables.

➢ If conditions are allowed to have several values, the resulting tables are called

Extended Entry Decision Tables.

➢When we have binary conditions (true/false, Yes/No, 0/1), the condition portion of a

decision table is a truth table.

➢This structure guarantees that we consider every possible combination of condition

values.

➢For Limited Entry Decision Tables, if n conditions exist, there must be 2n rules.

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 5

Page 6: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision table for Login Page

Conditions

Valid ID

Valid Password

Actions

Home Page

Show message “Invalid Credentials”

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 6

Page 7: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Rule 1 Rule 2 Rule 3 Rule 4

c1: Valid Id T T F F

c2: Valid Password T F T F

a1: Home Page X

a2: Show message “Invalid

Credentials”X X X

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 7

Page 8: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision table for Online Money Transfer

Conditions

Account already approved

OTP matched

Sufficient money in account

Actions

Transfer money

Show message as insufficient balance

Block transaction in case of suspicious transactions

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 8

Page 9: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8

c1 Account already

approvedT T T T F F F F

c2 OTP Matched T T F F T F F T

c3 Sufficient money in

accountT F T F T F T F

a1 Transfer money X

a2 Show message as

insufficient balanceX

a3 Block transaction in

case of suspicious

transactionsX X X X X X

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 9

Page 10: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8

c1 Account already

approvedT T T T F F F F

c2 OTP Matched T T F F T F F T

c3 Sufficient money in

accountT F T F T F T F

a1 Transfer money X

a2 Show message as

insufficient balanceX

a3 Block transaction in

case of suspicious

transactionsX X X X X X

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 10

Page 11: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Rule 1 Rule 2 Rule 3 Rule 4 Rule 5

c1 Account already

approvedT T T T F

c2 OTP Matched T T F F --

c3 Sufficient money in

accountT F T F --

a1 Transfer money X

a2 Show message as

insufficient balanceX

a3 Block transaction in

case of suspicious

transactionsX X X

Rule Count = 8

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 11

Page 12: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision Table for Triangle Problem

Conditions:

- a, b, c, form a triangle?

- a = b?

- a = c?

- b = c?

Actions:

- Not a Triangle

- Scalene

- Isosceles

- Equilateral

- Impossible

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 12

Page 13: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision Table for Triangle Problem

Rule Counts?

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 13

Page 14: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Why are rules 3, 4, and 6 impossible?

If two pairs of integers are equal, by transitivity, the third pair must be equal; thus,

the negative entry makes these rules impossible.

Refined Decision Table for the Triangle Problem

- The choice of conditions can greatly expand the size of decision table.

- Here, the old condition (c1: a, b, c form a triangle?) is expanded to a more detailed

view of the three inequalities of the triangle property.

- If any one of these fails , the three integers do not constitute sides of a triangle.

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 14

Page 15: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Refined Decision Table for Triangle Problem

Conditions:

- a < b + c?

- b < a + c? a, b, c, form a triangle?

- c < a + b?

- a = b?

- a = c?

- b = c?

Actions:

- Not a Triangle

- Scalene

- Isosceles

- Equilateral

- Impossible

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 15

Page 16: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Refined Decision Table for the Triangle Problem

Rule Counts?

X

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 16

Page 17: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Rule Counts = 64

X

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 17

Page 18: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Test Cases for the Triangle Problem

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 18

Page 19: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 19

Page 20: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 20

Page 21: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 21

Page 22: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Inconsistent – Because the

action set are different for rules 4

and 9.

Non-Deterministic – Because

there is no way to decide whether

to apply rule 4 or rule 9.

Testers should take care when

“don’t care” entries are used in

table.

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 22

Page 23: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision Table for NextDate Function

• Example for extended entry decision table.

Conditions:

- Month in

- Day in

- Year in

Actions:

- Impossible

- Increment day

- Reset day

- Increment month

- Reset month

- Increment year

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 23

Page 24: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

The cartesian product of these contains 40 elements.08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 24

Page 25: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision Table for NextDate Function (first half)

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 25

Page 26: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

Decision Table for NextDate Function (next half)

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 26

Page 27: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 27

Page 28: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 28

Page 29: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 29

Page 30: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 30

References

➢ Paul C. Jorgensen: Software Testing, A Craftsman’s Approach, 3rd Edition, Auerbach

Publications, 2008.

Page 31: Unit – 2 Boundary Value Testing, Equivalence Class Testing ... · Unit –2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8th Sem, A’ Div

08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 31