SlideShare a Scribd company logo
1 of 21
Download to read offline
3/12/2013




To Infinity & Beyond! Using Combinatorial
       Testing to Handle Complexity
                       Presented By:
                       Andy Tinkham
                    Magenic Technologies




Testing Everything is Impossible

  The number of test cases might as well be infinite

  Interacting variables have a multiplicative effect




                                                               1
3/12/2013




             Consider this screen…




      How many test cases       What about when         What about all the 
      are needed to ensure      additional settings         rest of the 
        that this all works    are added to the poll    functionality of this 
            correctly?           creation process?             app?




             Additional complexity
• MyVote runs on iOS, Windows 8, and 
  Windows Phone 8 (and multiple devices for 
  those systems!)

• Users can log in with Twitter, Facebook, and 
  Microsoft ID

• Testing every combination of these is already 
  over 18000 test cases




                                                                                        2
3/12/2013




    We need ways to manage this
Many ways we could handle this

                                                 Test everything (delaying 
           Give up                               release while we run all 
                                                 18000+ test cases)


           Choose a subset of tests 
           to run & hope we chose                Automate the tests
           well


                              Combine tests to get a 
                              minimal test set that 
                              covers the interactions




                         One way…
• Combinatorial testing

• Simply multiplying out the test 
  cases results in a lot of duplication
• Many bugs require interactions of 
  variables
• Solution: Create set of tests to 
  cover all pairs of variables 
  interacting




                                                                                     3
3/12/2013




  When to use combinatorial tests
• You’ve got a set of interacting variables that 
  result in a large number of test cases
• You understand these variables well
• The variables are independent or you can 
  explicitly define the dependencies




                    Pitfalls
• Choosing the wrong variables or values can 
  leave gaps in your testing
• Relying solely on combinatorial testing may 
  leave important combinations untested
• In at least 1 academic study, combinatorial 
  testing didn’t do much better than random 
  testing




                                                           4
3/12/2013




                                     Variables
• What might vary in a test case

• Focus on one piece of functionality not whole system (use 
  multiple models)

• Use domain analysis skills

• Look for anything that has an impact on the results for the 
  functionality you’re testing

• May already have identified many as part of previous test 
  design efforts




                     Identifying variables


                       Function                          Application         Data 
    Input values                       Environment
                      parameters                          settings         conditions

                           Data 
       User Input                        Configuration     User settings      User role
                        structures


      Values from 
                                         Presence or          Global 
         other         Branch points                                         Data state
                                         absence of        configuration
      components




                                                                                                 5
3/12/2013




             Identifying values
• Analyze variable list one by one

• Identify default values

• Identify equivalence classes for possible values

• Name equivalence classes rather than choosing 
  representative values for now




                                                            6
3/12/2013




        Example List for Add a Poll
•   Question: Present, Not Present
•   NumberOfAnswers: 0, 1, 2, 3, 4, 5
•   CanSelectMultipleAnswers: Yes, No
•   Image: None, JPG, GIF, PNG
•   StartTime: None, Past, Present, Future
•   EndTime: None, Past, Present, Future




                Making the set
• List each value of the first variable
    – Question: Present, Not Present
• Then add the second variables values so that 
  each pair of values occurs
    – NumberOfAnswers: 0, 1, 2, 3, 4, 5




                                                         7
3/12/2013




Question   NumberOf   CanSelectMultiple   Image   StartTime   EndTime
           Answers    Answers
Present
Present
Present
Present
Present
Present
Not Pres
Not Pres
Not Pres
Not Pres
Not Pres
Not Pres




Question   NumberOf   CanSelectMultiple   Image   StartTime   EndTime
           Answers    Answers
Present    0
Present    1
Present    2
Present    3
Present    4
Present    5
Not Pres   0
Not Pres   1
Not Pres   2
Not Pres   3
Not Pres   4
Not Pres   5




                                                                               8
3/12/2013




                Continuing the set
• Repeat for the remaining variables, keeping 
  pair relationships up as you go
• When you can’t get a needed pair, first look 
  for partial rows  and set unknown values if 
  possible
• If no partial row where you can set the 
  needed value, add a new row
    – Mark currently non‐needed values as unknown




Question    NumberOf   CanSelectMultiple   Image   StartTime   EndTime
            Answers    Answers
Present     0          Yes                 None    None        None 
Present     1          No                  GIF     Past        Past
Present     2          Yes                 JPG     Present     Present
Present     3          No                  PNG     Future      Future
Present     4          Yes                 …       …           …
Present     5          No
Not Pres    0          No
Not Pres    1          Yes
Not Pres    2          No
Not Pres    3          Yes
Not Pres    4          No
Not Pres    5          Yes




                                                                                9
3/12/2013




               Creating the set
    For a detailed description of the manual 
 process, check out the Addendum to Chapter 3 
in Kaner, Bach & Pettichord’s Lessons Learned in 
                Software Testing




        Automating the process
• Luckily, we don’t have to do this by hand!

• Many tools available to create the test set for 
  us
  – Bach’s AllPairs tool (satisfice.com)
  – Hexawise
  – Microsoft’s PICT

• Let’s look at PICT




                                                           10
3/12/2013




                        PICT
• Free tool, developed at Microsoft
• Windows based
   – Other platforms have similar tools, see 
     http://pairwise.org for more info
• Command‐line based
• Reads in text files containing variables, values 
  & context then outputs test cases
• See References slide for download & 
  documentation links




      Setting up variables in PICT
• Create a text file

• List each variable on a separate line, followed 
  by a :

• List the values after the :, separated by 
  commas




                                                            11
3/12/2013




                                 Example
Question: Present, Not Present
Number Of Answers: 0, 1, 2, 3, 4, 5
Can Select Multiple Answers: Yes, No
Image: None, GIF, JPG, PNG
StartTime: None, Past, Present, Future
EndTime: None, Past, Present, Future




                                 Output
Question      Number Of    Can Select    Image   Start Time   End Time
              Answers      Multiple 
                           Answers
Not Present   1            Yes           PNG     None         Present
Not Present   5            No            None    Past         None
Present       5            Yes           GIF     Present      Future
Present       5            No            JPG     Future       Past
Not Present   2            No            JPG     None         Future
Not Present   3            Yes           GIF     Past         Past
Present       0            No            GIF     None         None
Present       4            No            GIF     Future       Present
Not Present   0            Yes           None    Future       Future
Present       1            No            PNG     Past         Future
… (16 more)   …            …             …       …            …




                                                                               12
3/12/2013




           Adding constraints
• Can’t have one time stamp be None while the 
  other is set
• Don’t edit generated files – you might lose 
  coverage of all the pairs
• Instead, add constraints to PICT model




                                                       13
3/12/2013




                  Example Model File
Question: Present, Not Present
Number Of Answers: 0, 1, 2, 3, 4, 5
Can Select Multiple Answers: Yes, No
Image: None, GIF, JPG, PNG
StartTime: None, Past, Present, Future
EndTime: None, Past, Present, Future

IF [StartTime] = "None" THEN [EndTime] = "None";
IF [EndTime] = "None" THEN [StartTime] = "None";




                                 Output
Question      Number Of    Can Select    Image   Start Time   End Time
              Answers      Multiple 
                           Answers
Not Present   4            Yes           PNG     Past         Past
Present       5            No            JPG     Present      Future
Not Present   0            Yes           None    Future       Future
Not Present   4            No            GIF     None         None
Present       2            Yes           None    Present      Present
Present       5            No            PNG     Future       Present
Not Present   4            Yes           JPG     Past         Present
Present       3            Yes           None    None         None
Present       0            No            GIF     Past         Past
Not Present   3            No            JPG     Future       Past
… (19 more)   …            …             …       …            …




                                                                               14
3/12/2013




      Positive & negative values
• Not all the test cases generated are expected 
  to pass due to invalid values
  – Question Not Present
  – Answers 0 & 1 
• We may not want multiple invalid values in a 
  test case

• Solution: Tell PICT which values are invalid




              Example Model
Question: Present, ~Not Present
Number Of Answers: ~0, ~1, 2, 3, 4, 5
Can Select Multiple Answers: Yes, No
Image: None, GIF, JPG, PNG
StartTime: None, Past, Present, Future
EndTime: None, Past, Present, Future

IF [StartTime] = "None" THEN [EndTime] = "None";
IF [EndTime] = "None" THEN [StartTime] = "None";




                                                         15
3/12/2013




                                 Output
Question      Number Of    Can Select    Image   Start Time   End Time
              Answers      Multiple 
                           Answers
… (13 more)   …            …             …       …            …
Present       3            Yes           JPG     Past         Future
Present       5            Yes           GIF     None         None
Present       4            No            None    None         None
Present       4            No            JPG     Present      Future
Present       4            No            JPG     Future       Present
~Not Present 4             Yes           PNG     Past         Past
Present       ~0           Yes           None    Future       Future
~Not Present 2             No            JPG     Past         Present
~Not Present 3             Yes           GIF     None         None
 … (14 more) …              …             …       …            …




                    Weighting values
• Not every value occurs in the real world with 
  the same frequency
• Once pairs are satisfied, PICT still has some 
  “don’t care” values in table
• “Don’t care” values are filled in with random 
  selections from the variable
• We can weight the more likely variables so 
  PICT chooses them more often




                                                                               16
3/12/2013




               Example Model
Question: Present, ~Not Present
Number Of Answers: ~0, ~1, 2, 3, 4 (10), 5
Can Select Multiple Answers: Yes, No (10)
Image: None, GIF, JPG (10), PNG
StartTime: None, Past, Present, Future
EndTime: None, Past, Present, Future

IF [StartTime] = "None" THEN [EndTime] = "None";
IF [EndTime] = "None" THEN [StartTime] = "None";




            Seeding Test Cases
• There may be some test combinations that we 
  want to ensure are included
   – Default options
   – Most common configuration

• If more than 2 variables involved in desired 
  combination, PICT may not automatically 
  generate that test

• We can give the test to PICT as a starting point 




                                                            17
3/12/2013




                    Creating seed file
• Make a separate file
• Format is same as output from PICT
    – Lines tab‐delimited
    – First line has variable names in order
    – Remaining lines have desired test case values
• Seeded test cases can specify all values for test or 
  just some (PICT will populate the remaining 
  values
• File name is passed in to PICT command line call 
  with /e: option




                   Example Seed File
Question      Number Of    Can Select    Image   Start Time   End Time
              Answers      Multiple 
                           Answers
Not Present   4            Yes           PNG     Past         Past
Present                    No            GIF




                                                                               18
3/12/2013




                Generating tests
• Install PICT
• Add directory with PICT.exe to PATH 
  environment variable
• From a Command Prompt, run
    pict.exe model_file.txt [options] > output_file.txt




                   PICT Options
•   /o:N ‐ Order of combinations (default: 2)
•   /d:C ‐ Separator for values  (default: ,)
•   /a:C ‐ Separator for aliases (default: |)
•   /n:C ‐ Negative value prefix (default: ~)
•   /e:file ‐ File with seeding rows
•   /r[:N]  ‐ Randomize generation, N ‐ seed
•   /c      ‐ Case‐sensitive model evaluation
•   /s      ‐ Show model statistics




                                                                19
3/12/2013




    Test Automation with Combinatorics

• Generated test cases can be fed in to custom‐
  built parser & executed
• Using names for equivalence classes allows 
  you to generate data on the fly
   – Pick different values every time
   – Find data that matches needs in current 
     environment
• Variable values can also be keyword actions




                        References
• PICT download 
  http://download.microsoft.com/download/f/5/5/f55484df‐8494‐48fa‐
  8dbd‐8c6f76cc014b/pict33.msi

• PICT documentation 
  http://msdn.microsoft.com/en‐us/library/cc150619.aspx

• More information on pair‐wise testing
  http://pairwise.org

• Bach & Schroeder’s comparison of pairwise & 
  randomly selected test cases
  http://www.testingeducation.org/wtst5/PairwisePNSQC2004.pdf




                                                                           20
3/12/2013




Contact Information


        Andy Tinkham
    Magenic Technologies
    andyt@magenic.com
     http://magenic.com

 http://ohours.org/andytinkham
    http://testerthoughts.com
 http://twitter.com/andytinkham




                                        21

More Related Content

Similar to To Infinity and Beyond! Using Combinatorial Testing to Handle Complexity

Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Trisha Gee
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceAmit Sharma
 
Creativity and Curiosity - The Trial and Error of Data Science
Creativity and Curiosity - The Trial and Error of Data ScienceCreativity and Curiosity - The Trial and Error of Data Science
Creativity and Curiosity - The Trial and Error of Data ScienceDamianMingle
 
DataEngConf SF16 - Three lessons learned from building a production machine l...
DataEngConf SF16 - Three lessons learned from building a production machine l...DataEngConf SF16 - Three lessons learned from building a production machine l...
DataEngConf SF16 - Three lessons learned from building a production machine l...Hakka Labs
 
STARCANADA 2013 Keynote: Lightning Strikes the Keynotes
STARCANADA 2013 Keynote: Lightning Strikes the KeynotesSTARCANADA 2013 Keynote: Lightning Strikes the Keynotes
STARCANADA 2013 Keynote: Lightning Strikes the KeynotesTechWell
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpicsLanette Creamer
 
Mini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem managementMini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem managementBetclic Everest Group Tech Team
 
Lessons learned in agile romania
Lessons learned in agile romaniaLessons learned in agile romania
Lessons learned in agile romaniaOpenAgile Romania
 
Testing in the Wild
Testing in the WildTesting in the Wild
Testing in the WildDawn Code
 
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...Daniel Roggen
 
Developing in R - the contextual Multi-Armed Bandit edition
Developing in R - the contextual Multi-Armed Bandit editionDeveloping in R - the contextual Multi-Armed Bandit edition
Developing in R - the contextual Multi-Armed Bandit editionRobin van Emden
 
Can we induce change with what we measure?
Can we induce change with what we measure?Can we induce change with what we measure?
Can we induce change with what we measure?Michaela Greiler
 
Agile Testing in the Enterprise 2016
Agile Testing in the Enterprise   2016Agile Testing in the Enterprise   2016
Agile Testing in the Enterprise 2016Janet Gregory
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMPuneet Kulyana
 
How to Win Machine Learning Competitions ?
How to Win Machine Learning Competitions ? How to Win Machine Learning Competitions ?
How to Win Machine Learning Competitions ? HackerEarth
 
A New Model For Testing
A New Model For TestingA New Model For Testing
A New Model For TestingTEST Huddle
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniquesAshutosh Garg
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques2PiRTechnologies
 

Similar to To Infinity and Beyond! Using Combinatorial Testing to Handle Complexity (20)

Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Is Groovy better for testing than Java?
Is Groovy better for testing than Java?
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inference
 
Creativity and Curiosity - The Trial and Error of Data Science
Creativity and Curiosity - The Trial and Error of Data ScienceCreativity and Curiosity - The Trial and Error of Data Science
Creativity and Curiosity - The Trial and Error of Data Science
 
DataEngConf SF16 - Three lessons learned from building a production machine l...
DataEngConf SF16 - Three lessons learned from building a production machine l...DataEngConf SF16 - Three lessons learned from building a production machine l...
DataEngConf SF16 - Three lessons learned from building a production machine l...
 
STARCANADA 2013 Keynote: Lightning Strikes the Keynotes
STARCANADA 2013 Keynote: Lightning Strikes the KeynotesSTARCANADA 2013 Keynote: Lightning Strikes the Keynotes
STARCANADA 2013 Keynote: Lightning Strikes the Keynotes
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpics
 
Mini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem managementMini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem management
 
Lessons learned in agile romania
Lessons learned in agile romaniaLessons learned in agile romania
Lessons learned in agile romania
 
Testing in the Wild
Testing in the WildTesting in the Wild
Testing in the Wild
 
Mini datathon
Mini datathonMini datathon
Mini datathon
 
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
 
Developing in R - the contextual Multi-Armed Bandit edition
Developing in R - the contextual Multi-Armed Bandit editionDeveloping in R - the contextual Multi-Armed Bandit edition
Developing in R - the contextual Multi-Armed Bandit edition
 
Can we induce change with what we measure?
Can we induce change with what we measure?Can we induce change with what we measure?
Can we induce change with what we measure?
 
Agile Testing in the Enterprise 2016
Agile Testing in the Enterprise   2016Agile Testing in the Enterprise   2016
Agile Testing in the Enterprise 2016
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
How to Win Machine Learning Competitions ?
How to Win Machine Learning Competitions ? How to Win Machine Learning Competitions ?
How to Win Machine Learning Competitions ?
 
New model
New modelNew model
New model
 
A New Model For Testing
A New Model For TestingA New Model For Testing
A New Model For Testing
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
 

Recently uploaded

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

To Infinity and Beyond! Using Combinatorial Testing to Handle Complexity

  • 1. 3/12/2013 To Infinity & Beyond! Using Combinatorial Testing to Handle Complexity Presented By: Andy Tinkham Magenic Technologies Testing Everything is Impossible  The number of test cases might as well be infinite  Interacting variables have a multiplicative effect 1
  • 2. 3/12/2013 Consider this screen… How many test cases  What about when  What about all the  are needed to ensure  additional settings  rest of the  that this all works  are added to the poll  functionality of this  correctly? creation process? app? Additional complexity • MyVote runs on iOS, Windows 8, and  Windows Phone 8 (and multiple devices for  those systems!) • Users can log in with Twitter, Facebook, and  Microsoft ID • Testing every combination of these is already  over 18000 test cases 2
  • 3. 3/12/2013 We need ways to manage this Many ways we could handle this Test everything (delaying  Give up release while we run all  18000+ test cases) Choose a subset of tests  to run & hope we chose  Automate the tests well Combine tests to get a  minimal test set that  covers the interactions One way… • Combinatorial testing • Simply multiplying out the test  cases results in a lot of duplication • Many bugs require interactions of  variables • Solution: Create set of tests to  cover all pairs of variables  interacting 3
  • 4. 3/12/2013 When to use combinatorial tests • You’ve got a set of interacting variables that  result in a large number of test cases • You understand these variables well • The variables are independent or you can  explicitly define the dependencies Pitfalls • Choosing the wrong variables or values can  leave gaps in your testing • Relying solely on combinatorial testing may  leave important combinations untested • In at least 1 academic study, combinatorial  testing didn’t do much better than random  testing 4
  • 5. 3/12/2013 Variables • What might vary in a test case • Focus on one piece of functionality not whole system (use  multiple models) • Use domain analysis skills • Look for anything that has an impact on the results for the  functionality you’re testing • May already have identified many as part of previous test  design efforts Identifying variables Function  Application  Data  Input values Environment parameters settings conditions Data  User Input Configuration User settings User role structures Values from  Presence or  Global  other  Branch points Data state absence of  configuration components 5
  • 6. 3/12/2013 Identifying values • Analyze variable list one by one • Identify default values • Identify equivalence classes for possible values • Name equivalence classes rather than choosing  representative values for now 6
  • 7. 3/12/2013 Example List for Add a Poll • Question: Present, Not Present • NumberOfAnswers: 0, 1, 2, 3, 4, 5 • CanSelectMultipleAnswers: Yes, No • Image: None, JPG, GIF, PNG • StartTime: None, Past, Present, Future • EndTime: None, Past, Present, Future Making the set • List each value of the first variable – Question: Present, Not Present • Then add the second variables values so that  each pair of values occurs – NumberOfAnswers: 0, 1, 2, 3, 4, 5 7
  • 8. 3/12/2013 Question NumberOf CanSelectMultiple Image StartTime EndTime Answers Answers Present Present Present Present Present Present Not Pres Not Pres Not Pres Not Pres Not Pres Not Pres Question NumberOf CanSelectMultiple Image StartTime EndTime Answers Answers Present 0 Present 1 Present 2 Present 3 Present 4 Present 5 Not Pres 0 Not Pres 1 Not Pres 2 Not Pres 3 Not Pres 4 Not Pres 5 8
  • 9. 3/12/2013 Continuing the set • Repeat for the remaining variables, keeping  pair relationships up as you go • When you can’t get a needed pair, first look  for partial rows  and set unknown values if  possible • If no partial row where you can set the  needed value, add a new row – Mark currently non‐needed values as unknown Question NumberOf CanSelectMultiple Image StartTime EndTime Answers Answers Present 0 Yes None None None  Present 1 No GIF Past Past Present 2 Yes JPG Present Present Present 3 No PNG Future Future Present 4 Yes … … … Present 5 No Not Pres 0 No Not Pres 1 Yes Not Pres 2 No Not Pres 3 Yes Not Pres 4 No Not Pres 5 Yes 9
  • 10. 3/12/2013 Creating the set For a detailed description of the manual  process, check out the Addendum to Chapter 3  in Kaner, Bach & Pettichord’s Lessons Learned in  Software Testing Automating the process • Luckily, we don’t have to do this by hand! • Many tools available to create the test set for  us – Bach’s AllPairs tool (satisfice.com) – Hexawise – Microsoft’s PICT • Let’s look at PICT 10
  • 11. 3/12/2013 PICT • Free tool, developed at Microsoft • Windows based – Other platforms have similar tools, see  http://pairwise.org for more info • Command‐line based • Reads in text files containing variables, values  & context then outputs test cases • See References slide for download &  documentation links Setting up variables in PICT • Create a text file • List each variable on a separate line, followed  by a : • List the values after the :, separated by  commas 11
  • 12. 3/12/2013 Example Question: Present, Not Present Number Of Answers: 0, 1, 2, 3, 4, 5 Can Select Multiple Answers: Yes, No Image: None, GIF, JPG, PNG StartTime: None, Past, Present, Future EndTime: None, Past, Present, Future Output Question Number Of  Can Select  Image Start Time End Time Answers Multiple  Answers Not Present 1 Yes PNG None Present Not Present 5 No None Past None Present 5 Yes GIF Present Future Present 5 No JPG Future Past Not Present 2 No JPG None Future Not Present 3 Yes GIF Past Past Present 0 No GIF None None Present 4 No GIF Future Present Not Present 0 Yes None Future Future Present 1 No PNG Past Future … (16 more) … … … … … 12
  • 13. 3/12/2013 Adding constraints • Can’t have one time stamp be None while the  other is set • Don’t edit generated files – you might lose  coverage of all the pairs • Instead, add constraints to PICT model 13
  • 14. 3/12/2013 Example Model File Question: Present, Not Present Number Of Answers: 0, 1, 2, 3, 4, 5 Can Select Multiple Answers: Yes, No Image: None, GIF, JPG, PNG StartTime: None, Past, Present, Future EndTime: None, Past, Present, Future IF [StartTime] = "None" THEN [EndTime] = "None"; IF [EndTime] = "None" THEN [StartTime] = "None"; Output Question Number Of  Can Select  Image Start Time End Time Answers Multiple  Answers Not Present 4 Yes PNG Past Past Present 5 No JPG Present Future Not Present 0 Yes None Future Future Not Present 4 No GIF None None Present 2 Yes None Present Present Present 5 No PNG Future Present Not Present 4 Yes JPG Past Present Present 3 Yes None None None Present 0 No GIF Past Past Not Present 3 No JPG Future Past … (19 more) … … … … … 14
  • 15. 3/12/2013 Positive & negative values • Not all the test cases generated are expected  to pass due to invalid values – Question Not Present – Answers 0 & 1  • We may not want multiple invalid values in a  test case • Solution: Tell PICT which values are invalid Example Model Question: Present, ~Not Present Number Of Answers: ~0, ~1, 2, 3, 4, 5 Can Select Multiple Answers: Yes, No Image: None, GIF, JPG, PNG StartTime: None, Past, Present, Future EndTime: None, Past, Present, Future IF [StartTime] = "None" THEN [EndTime] = "None"; IF [EndTime] = "None" THEN [StartTime] = "None"; 15
  • 16. 3/12/2013 Output Question Number Of  Can Select  Image Start Time End Time Answers Multiple  Answers … (13 more) … … … … … Present 3 Yes JPG Past Future Present 5 Yes GIF None None Present 4 No None None None Present 4 No JPG Present Future Present 4 No JPG Future Present ~Not Present 4 Yes PNG Past Past Present ~0 Yes None Future Future ~Not Present 2 No JPG Past Present ~Not Present 3 Yes GIF None None … (14 more) … … … … … Weighting values • Not every value occurs in the real world with  the same frequency • Once pairs are satisfied, PICT still has some  “don’t care” values in table • “Don’t care” values are filled in with random  selections from the variable • We can weight the more likely variables so  PICT chooses them more often 16
  • 17. 3/12/2013 Example Model Question: Present, ~Not Present Number Of Answers: ~0, ~1, 2, 3, 4 (10), 5 Can Select Multiple Answers: Yes, No (10) Image: None, GIF, JPG (10), PNG StartTime: None, Past, Present, Future EndTime: None, Past, Present, Future IF [StartTime] = "None" THEN [EndTime] = "None"; IF [EndTime] = "None" THEN [StartTime] = "None"; Seeding Test Cases • There may be some test combinations that we  want to ensure are included – Default options – Most common configuration • If more than 2 variables involved in desired  combination, PICT may not automatically  generate that test • We can give the test to PICT as a starting point  17
  • 18. 3/12/2013 Creating seed file • Make a separate file • Format is same as output from PICT – Lines tab‐delimited – First line has variable names in order – Remaining lines have desired test case values • Seeded test cases can specify all values for test or  just some (PICT will populate the remaining  values • File name is passed in to PICT command line call  with /e: option Example Seed File Question Number Of  Can Select  Image Start Time End Time Answers Multiple  Answers Not Present 4 Yes PNG Past Past Present No GIF 18
  • 19. 3/12/2013 Generating tests • Install PICT • Add directory with PICT.exe to PATH  environment variable • From a Command Prompt, run pict.exe model_file.txt [options] > output_file.txt PICT Options • /o:N ‐ Order of combinations (default: 2) • /d:C ‐ Separator for values  (default: ,) • /a:C ‐ Separator for aliases (default: |) • /n:C ‐ Negative value prefix (default: ~) • /e:file ‐ File with seeding rows • /r[:N]  ‐ Randomize generation, N ‐ seed • /c      ‐ Case‐sensitive model evaluation • /s      ‐ Show model statistics 19
  • 20. 3/12/2013 Test Automation with Combinatorics • Generated test cases can be fed in to custom‐ built parser & executed • Using names for equivalence classes allows  you to generate data on the fly – Pick different values every time – Find data that matches needs in current  environment • Variable values can also be keyword actions References • PICT download  http://download.microsoft.com/download/f/5/5/f55484df‐8494‐48fa‐ 8dbd‐8c6f76cc014b/pict33.msi • PICT documentation  http://msdn.microsoft.com/en‐us/library/cc150619.aspx • More information on pair‐wise testing http://pairwise.org • Bach & Schroeder’s comparison of pairwise &  randomly selected test cases http://www.testingeducation.org/wtst5/PairwisePNSQC2004.pdf 20
  • 21. 3/12/2013 Contact Information Andy Tinkham Magenic Technologies andyt@magenic.com http://magenic.com http://ohours.org/andytinkham http://testerthoughts.com http://twitter.com/andytinkham 21