Deriving testcases

13
© Knowledge Tester ‘ Software Quality – a myth or reality’ Deriving Test Cases © Knowledge Tester

Transcript of Deriving testcases

Page 1: Deriving testcases

© Knowledge Tester

‘ Software Quality – a myth or reality’

Deriving Test Cases

© Knowledge Tester

Page 2: Deriving testcases

Deriving test cases

• Software Testing looks interesting; let’s learn it : One skill that every Tester needs is ‘derive test cases for a specific feature’

• What is a Test case?

• Exercise 1: Adder application

• Equivalence class partition

• Exercise 2: Doc to Pdf publishing

• Combinatorial Testing

• Bonus Exercise: Looking at the code

© Knowledge Tester

Page 3: Deriving testcases

What is a Test case?

• A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system is working correctly or not.

http://en.wikipedia.org/wiki/Test_case

• Test case does have a corresponding with Use case.

• Normally a test case has:

–ID

–Description

–Input

–Expected output.

• A Test case either ‘passes’ or ‘fails’.

• A Feature Test Plan is usually a set of Test cases.

© Knowledge Tester

Page 4: Deriving testcases

Exercise 1: Adder application

Application: Adder application which takes two 2-digit no.s and displays the sum.

Reference: 'Testing Computer Software' book by Cem Kaner, Jack Falk and Hung Q. Nguyen.

? 2 ? 3 5 ? _

© Knowledge Tester

Page 5: Deriving testcases

Adder test cases 1

Test Case Inputs Result Notes

2 + 3 5 The basic test should pass first

99 + 99 198 Addition of 2 largest numbers

-99 + -99 -198 Addition of 2 largest negative numbers

99 + 14 113 First number is largest

-38 + 55 17 Mixing +ve and –ve numbers

56 + 99 155 Second number is largest

9 + 9 18 9 is the largest single digit number

0 + 0 0 0 is a special case

0 + 23 23 First number as 0

78 + 0 78 Second number as 0

© Knowledge Tester

Page 6: Deriving testcases

Adder test cases 2

Test Case Inputs Notes

100 + 100 Beyond maximum number

<Enter> + <Enter> What if we provide nothing?

12345678 + 0 Trying a very large number

1.2 + 5 Trying a decimal number

A + b Trying not a number

<Ctrl + A> + <F10> Trying special keys

© Knowledge Tester

Page 7: Deriving testcases

Equivalence Class Partition

The concept comes from Mathematics where we break Set into sub-sets based upon some criteria. Now assuming that one element from subset of a Set is equivalent to other member of same subset, we have one Test case represent one subset.

© Knowledge Tester

Page 8: Deriving testcases

Revisiting test cases

• If we try 11+12, do we need to try 55+67?

• Is 0 +9 and 9+0 belong to same subset or different subsets?

• Are we missing some equivalence class?

• When we move this concept to other data types, it becomes interesting. Say we want to try special characters in a string: is ‘test$’ same as ‘$test’ or ‘te$st’?

© Knowledge Tester

Page 9: Deriving testcases

Exercise 2: Word to PDF publishing

© Knowledge Tester

Page 10: Deriving testcases

PDF Publishing test cases 1

Test case Notes

PDF can be generated with default options

Basic test

All pages can be published Page range options

Current page can be published Page range options

Pages range can be published Page range options

Document with Markups can be published Different Mark ups / bookmarks

Document Properties are available after publishing

Properties like Author name, Organization name etc.

PDF options are applicable What is ISO 19005-1?

PDF is opened after publishing What if Adobe Reader is not installed?

PDF can be published at any path Different type of directory selections

© Knowledge Tester

Page 11: Deriving testcases

PDF Publishing test cases 2

Test case Notes

PDF optimization works Check for different file sizes

Any File names can be provided

Publishing to locations over network LAN, WAN

Publishing older word documents Compatibility testing Office 2007/2003

Publishing huge word documents Performance testing

Word drawings are published correctly Word specific data

Embedded pictures are published correctly

Word specific data

Links in the word file are published correctly

Word specific data

© Knowledge Tester

Page 12: Deriving testcases

Combinatorial testing • What if we combine multiple

options?

• We try a set of pages publication with valid, invalid, long names?

• Let’s take 3 variations:

–Page range has 4 options.

–Non-printing information has 4 options.

–PDF options has 3.

• Total possible set of tests are 4 x 4 x 3 = 48.

• Should we run all 48 or some representative of these?

• Further study: http://www.developsense.com/pairwiseTesting.html

© Knowledge Tester

Page 13: Deriving testcases

© Knowledge Tester