design test case technique (equivalence partitioning and boundary value analysis)

34
1 Design test case technique Equivalence partitioning And Boundary value analysis Estimated Time: 120 mins Trainer: Tran Thanh Tuan

Upload: ryan-tran

Post on 30-Jan-2015

9.633 views

Category:

Technology


4 download

DESCRIPTION

At the end of this course, you are going to know: To provide an approach to design test case. Understand how to apply equivalence partitioning and boundary to design test case.

TRANSCRIPT

Page 1: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

1

Design test case technique Equivalence partitioning

And Boundary value analysis

Estimated Time: 120 mins

Trainer: Tran Thanh Tuan

Page 2: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

2

At the end of this course, you are going to know:

To provide an approach to design test case.

Understand how to apply equivalence partitioning and boundary to design test case.

PurposePurpose

Page 3: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

3

1.Introduction

2.What is equivalence partitioning?

3.Identify equivalence classes

4.Define the test cases

5.Combining with boundary analyze to choose data

6.Examples

7.Q&A

OutlineOutline

Page 4: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

4

IntroductionIntroduction

Google search :

how many test cases do we need?

Page 5: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

5

Advantages of EPAdvantages of EP

- To reduce the number of test cases to a necessary minimum

- To select the right test cases to cover all possible scenarios ( of course not to be absolutely sure)

Page 6: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

6

What is EP?What is EP?

Input, output domain

Equivalence classes

Page 7: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

7

How to use to design testcaseHow to use to design testcase

Test case design by EP proceeds into 2 steps:

- Identify equivalence classes

- Define the test cases

Page 8: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

8

1. Introduction

2. What is equivalence partitioning ?

3. Identify equivalence class4. Define the test case5. Combining with boundary analyze to

choose data6. Examples7. Q&A

OutlineOutline

Page 9: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

9

• Input, output: clue from requirement

• Equivalence classes are of 2 types: valid and invalid

• Ex: identify equivalence classes for this requirement “ if a pupil has total score >= 75, he will pass the exam, otherwise will fail (total score is an integer)”

Identify equivalence classesIdentify equivalence classes

Page 10: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

10

Identify equivalence classesIdentify equivalence classes

Total score Error messageSystem

Fail

Pass

Page 11: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

11

Valid equivalence classes

Invalid equivalence classes

Total score 1. >=75 2. <75

3. Null

4. String

Result of the exam

5. Pass

6. Fail

7. Error message

Identify equivalence classesIdentify equivalence classes

Page 12: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

12

1. Introduction

2. What is equivalence partitioning ?

3. Identify equivalence class4. Define the test case5. Combining with boundary analyze to

choose data6. Examples7. Q&A

OutlineOutline

Page 13: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

13

• Assign a unique number to each equivalence class

• For valid case: until all valid equivalence classes have been covered by test case, write a new test case covering as many uncover valid equivalence classes as possible.

• For invalid case: until all invalid equivalence classes have been covered by test case, write a new test case that cover one, and only one, of the uncovered invalid equivalence classes.

Define test casesDefine test cases

Page 14: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

14

• Example: write test case for “ if a pupil has total score >= 75, he will be past the exam, otherwise will fail ”, using equivalence partitioning.

Define test casesDefine test cases

Conditions Valid equivalence class

Invalid equivalence class

Total score 1. >=75 2. <753. Null4. String

Result of the exam

5. Pass6. Fail7. Error message

Test case:

• 1, 5

• 2, 6

• 3, 7

• 4, 7

Page 15: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

15

1. Introduction

2. What is equivalence partitioning?

3. Identify equivalence classes

4. Define the test cases

5. Combining with boundary analyze to choose data

6. Examples

7. Q&A

OutlineOutline

Page 16: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

16

Boundary analyze and EPBoundary analyze and EPWhat is Boundary analyze?- Is a technique to refine

equivalence partitioning- Concentrate on cases at the

extreme ends of each equivalence class.

Page 17: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

17

Boundary analyze and EPBoundary analyze and EP

Boundary values

Page 18: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

18

Boundary analyze and EPBoundary analyze and EPBoundary value analysis?- Is to use input variable value at the

minimum, just above minimum, just below minimum, normal, at the maximum, just below maximum, just above maximum

Page 19: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

19

Boundary analyze and EPBoundary analyze and EP

Example:

• “ if a pupil has total score >= 75, he will pass the exam, otherwise will fail (total score is an integer)”

Conditions Valid equivalence classes

Invalid equivalence classes

Total score 1. >=75 2. <753. Null4. String

Result of the exam

5. Pass6. Fail7. Error message

Test case:

1. 1, 5

2. 2, 6

3. 3, 7

4. 4, 7

Data to test:1a. 75, pass

1b. 76, pass

2. 74, fail

3. Null, error message

4a. A, error message

4b. I am a tester of EW and I love this job, error message

Page 20: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

20

1. Introduction

2. What is equivalence partitioning?

3. Identify equivalence classes

4. Define the test cases

5. Combining with boundary analyze to choose data

6. Examples

7. Q&A

OutlineOutline

Page 21: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

21

1. Login function- Requirement:

The Registered User enters credentials – a username and password – and submits the credentials.

The System verifies the user’s credentials.The System presents the homepage with hello user name and log out link.

If the user has been inactive, the system presents a message indicating that the account has been inactive.If invalid username or password, the system determines that the combination of username and password is in error.( username: maximum 25 chars, not have space, unique, a-z, A-Z, number, password: minimum 6 chars long)

ExamplesExamples

Page 22: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

22

ExamplesExamples

Database

Homepage

SystemPassword

Username

Button Submit

Error message of username or password is incorrectError message of inactive account

Nothing happen

Relation of username and password

Page 23: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

23

• Identify equivalence class:

ExamplesExamples

Page 24: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

24

• Identify test caseValid case– 1,2,3,4,5,12,13,14,18,20,21,24,27– 1,2,3,4,12,13,14,18,20,21,25,27Invalid case– 1,6,12,13,14,19,22,21,24,28– 7,12,19,22,21,25,28– 8,4,5,14,19,22,21,25,28– 9,1,2,3,4,12,18,20,21,24,29– 10,14,18,22,21,24,28– 11,13,19,21,22,24,28– 1,3,4,15,19,20,23,25,28– 1,3,4,16,19,20,24,28– 1,3,4,17,19,20,24,28– 1,3,4,12,13,18,25,26,30

ExamplesExamples

Page 25: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

25

1. Search function- Requirement:

User fill in search field then click search. The system will find all search string in the document and highlight them.If no one is found, message on form to indicate no result found.( search like Notepad)

ExamplesExamples

Page 26: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

26

ExamplesExamples

Relationship of search text and search data

SearchSearch data

Search text

Message indicates that no search found

Highlight all the occurrences of the search text in the search data

Nothing happen

Button Search

Relationship of search text and button Search

Page 27: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

27

• Identify equivalence class:ExamplesExamples

Page 28: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

28

• Identify test caseValid case– 1,10,12,13, 17,21,22– 2,10,12,14,18,21,25– 3,4,5,6,7,8,10,12,14,17,21,25Invalid case– 9,21– 3,4,8,11,12,17,21,24, 26– 3,6,7,10,13,15,18,21,22– 3,10,12,14,19,20,23

ExamplesExamples

Page 29: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

29

One page summaryOne page summary

Page 30: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

30

• To provide an approach to design test case • Understand how to apply equivalence partitioning and boundary analysis

to design test case

PurposePurpose

Page 31: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

31

1. Introduction

2. What is equivalence partitioning?

3. Identify equivalence classes

4. Define the test cases

5. Combining with boundary analyze to choose data

6. Examples

7. Q&A

OutlineOutline

Page 32: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

32

Q&AQ&A

Page 33: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

33

ReferencesReferences

• The art of software testing

• Internet

Page 34: Design Test Case Technique (Equivalence partitioning And Boundary value analysis)

34

Thank you!!!Thank you!!!