SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Deriving Test Cases




                     ‘ Software Quality –
                       a myth or reality’
© Knowledge Tester
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
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
Exercise 1: Adder application
  Application: Adder application which takes two 2-digit no.s and displays the
  sum.

             ?2
             ?3
              5
             ?_
  Reference: 'Testing Computer Software' book by Cem Kaner, Jack Falk and
  Hung Q. Nguyen.



© Knowledge Tester
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
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
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
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
Exercise 2: Word to PDF publishing




© Knowledge Tester
PDF Publishing test cases 1
  Test case                                 Notes
  PDF can be generated with default         Basic test
  options
  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   Properties like Author name, Organization
  publishing                                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
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         Word specific data
  correctly
  Links in the word file are published    Word specific data
  correctly
  …



© Knowledge Tester
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/pairw
      iseTesting.html

© Knowledge Tester
© Knowledge Tester

More Related Content

PPTX
Software project management
PPTX
unit testing and debugging
PPTX
Integration testing
PPTX
Network security model.pptx
PPTX
Designing Techniques in Software Engineering
PPTX
Introdution and designing a learning system
PPTX
software maintenance
PPTX
Metrics for project size estimation
Software project management
unit testing and debugging
Integration testing
Network security model.pptx
Designing Techniques in Software Engineering
Introdution and designing a learning system
software maintenance
Metrics for project size estimation

What's hot (20)

PDF
Input Space Partitioning
PDF
Constructive Cost Model - II (COCOMO-II)
PPTX
N queens using backtracking
PPTX
Software Engineering.pptx
PDF
Unit 1.2 Stepwise Project Planning.pdf
PPTX
Path Testing
PPTX
SOFTWARE PARADIGM
PPTX
Load runner & win runner
PPTX
Planning the development process
PPT
Classical Planning
PPT
Formal Specification in Software Engineering SE9
PPTX
Cryptographic algorithms
PPT
Pretty good privacy
PPTX
AI: AI & Searching
PPTX
cryptography ppt free download
PPTX
Public key algorithm
PPTX
Walkthrough and inspection (Walkthrough)
PPTX
Introduction to Java -unit-1
PPTX
Regression testing
PPTX
Lect3 conventional vs modern spm
Input Space Partitioning
Constructive Cost Model - II (COCOMO-II)
N queens using backtracking
Software Engineering.pptx
Unit 1.2 Stepwise Project Planning.pdf
Path Testing
SOFTWARE PARADIGM
Load runner & win runner
Planning the development process
Classical Planning
Formal Specification in Software Engineering SE9
Cryptographic algorithms
Pretty good privacy
AI: AI & Searching
cryptography ppt free download
Public key algorithm
Walkthrough and inspection (Walkthrough)
Introduction to Java -unit-1
Regression testing
Lect3 conventional vs modern spm
Ad

Viewers also liked (7)

PDF
Excellent testcase
PDF
ARTIST Project general presentation
PPT
PPTX
Project Management PERT and CPM
PPTX
Pert & cpm project management
PPT
Risk management in software engineering
PPTX
RMMM-Risk Management,Mitigation and Monitoring.
Excellent testcase
ARTIST Project general presentation
Project Management PERT and CPM
Pert & cpm project management
Risk management in software engineering
RMMM-Risk Management,Mitigation and Monitoring.
Ad

Similar to Deriving testcases (20)

PDF
Testing computer software
PPTX
Tdd pecha kucha_v2
PPS
Test case design_the_basicsv0.4
PPT
Growing software from examples
PDF
Agile Testing: Solving the Agilist\'s Dilemma
ODP
Black boxtesting
KEY
An introduction to mutation testing
PDF
Engineering Software Products: 9. testing
PDF
The Rule of Three
PPT
Testing Fundamentals
PPT
Black box-software-testing-douglas-hoffman2483
PPTX
4.3 Development and Testing
PPT
Defect Testing in Software Engineering SE20
PDF
To Infinity and Beyond! Using Combinatorial Testing to Handle Complexity
PPTX
Test Design For Everyone
PPTX
Artificial intelligence in qa
PDF
Junit Recipes - Elementary tests (2/2)
PDF
03 expressions.ppt
PDF
Bdd and-testing
PDF
Behaviour Driven Development and Thinking About Testing
 
Testing computer software
Tdd pecha kucha_v2
Test case design_the_basicsv0.4
Growing software from examples
Agile Testing: Solving the Agilist\'s Dilemma
Black boxtesting
An introduction to mutation testing
Engineering Software Products: 9. testing
The Rule of Three
Testing Fundamentals
Black box-software-testing-douglas-hoffman2483
4.3 Development and Testing
Defect Testing in Software Engineering SE20
To Infinity and Beyond! Using Combinatorial Testing to Handle Complexity
Test Design For Everyone
Artificial intelligence in qa
Junit Recipes - Elementary tests (2/2)
03 expressions.ppt
Bdd and-testing
Behaviour Driven Development and Thinking About Testing
 

Deriving testcases

  • 1. Deriving Test Cases ‘ Software Quality – a myth or reality’ © Knowledge Tester
  • 2. 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
  • 3. 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
  • 4. Exercise 1: Adder application Application: Adder application which takes two 2-digit no.s and displays the sum. ?2 ?3 5 ?_ Reference: 'Testing Computer Software' book by Cem Kaner, Jack Falk and Hung Q. Nguyen. © Knowledge Tester
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. Exercise 2: Word to PDF publishing © Knowledge Tester
  • 10. PDF Publishing test cases 1 Test case Notes PDF can be generated with default Basic test options 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 Properties like Author name, Organization publishing 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
  • 11. 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 Word specific data correctly Links in the word file are published Word specific data correctly … © Knowledge Tester
  • 12. 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/pairw iseTesting.html © Knowledge Tester