SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
The Test Case as
    Executable Example

CWI Lectures – Understanding Software
            June 14, 2012


          Arie van Deursen
            @avandeursen


                                        1
20th International Conference
    on Program Comprehension
                   Study of
the human activity of comprehending software;
the processes and technologies for supporting it




                                                   2
Programming by Example




Programming by Example,       Spreadsheet Data Manipulation Using
Daniel Halbert, 1984, Xerox          Examples, CACM, 2012        3
The Testing
Perspective

• A test case is an
  executable example of
  system behavior

• Stakeholder
  communication needs
  examples

• Throughout the full
  development cycle

                          4
webrat_steps.rb:

Cucumber          Then /^I should see "([^"]*)"$/ do |text|
                    response.should contain(text)
                  end

Feature: Log in and out
  As an administrator
  I want to restrict access to certain portions of my site
  In order to prevent users from changing the content

  Scenario: Logging in
    Given I am not logged in as an administrator
    When I go to the administrative page
    And I fill in the fields
      | Username | admin |
      | Password | secret |
    And I press "Log in"
    Then I should be on the administrative page
    And I should see "Log out"

  Scenario: Logging out ...
                                                             5
Plugin / Junit Testing in Eclipse.
         1000s of tests




                                     6
Test Suite Information Needs




 Test Confessions: A Study of Testing Practices for Plug-In Systems
Michaela Greiler, Arie van Deursen, Margaret-Anne Storey, ICSE 2012   7
Challenges
• Set of examples is incomplete

• Set of examples is too large
  – Some grouping needed
  – Redundancy
                                    Test Similarity
• Set of examples is disconnected
  – Requirements traceability
  – Backward coverage

                                                  8
Requirements                                End-to-End
    Analysis                                     Test

         ...




                                               ...
           High Level                 Integration
            Design                        Test


                   Code           Unit Test




Measuring Test Case Similarity to Support Test Suite Understanding
   Michaela Greiler, Arie van Deursen, Andy Zaidman, TOOLS 2012

                                                                     9
Measuring Test Case Similarity


                            Shared
                           word count

   Test-aware      Test                 Tests ranked
instrumentation   Traces                by similarity




                                                        10
Preliminary Evaluation
• 75 unit tests               • 37 unit
• 14 acceptance tests         • 6 end to end
• Ground truth by hand        • Ground truth from book


• Most similar match: #1 or #2 in ground truth
• Top 10: all (but one) explainable & useful
• Surprises: mostly point to issue in test suite.

• Work in progress:
  Analyzing Eclipse test suites.
                                                         11
Rethinking
             “Test Cases as Examples”
              • Languages for writing examples
                  –   Different levels of abstraction / stakeholders
                  –   Executable
                  –   Analyzable
                  –   Connected to execution traces


• Modularization and grouping of examples
   –   Different levels of abstraction / stakeholders
   –   Requirements / design / code coverage
   –   Multiple views
   –   Connected via execution traces
                                                                       12
In Conclusion
• A test case is an executable example
• Never enough, yet also too many

• Test case connection via trace similarities
• Language engineering opportunities ahead




                                                13
Photo credits
•   Passau: Andreas Brandl
    http://icpc12.sosy-lab.org/
•   Programming by Example, picture JanHeering (CWI). Photo Eelco Visser.
    http://eelcovisser.org/post/91/example-driven-research
•   The Testing Perspective: Photo “Reaching for Understanding”, Flickr
    http://www.flickr.com/photos/elizabethsalib/2741807789/
•   Andromeda Galaxy
    http://www.nasa.gov/mission_pages/spitzer/multimedia/spitzer-
    20070604.html
•   Colliding galaxies
    http://hubblesite.org/newscenter/archive/releases/2007/08/
•   Paul Klint, lecturing.
    http://www.frankwatching.com/archive/2009/05/18/het-nationaal-ict-
    event/


                                                                            14

Mais conteúdo relacionado

Mais procurados

Design For Testability
Design For TestabilityDesign For Testability
Design For TestabilityWill Iverson
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Developmentsatya sudheer
 
Seconf2011 database driven combinatorial testing
Seconf2011   database driven combinatorial testingSeconf2011   database driven combinatorial testing
Seconf2011 database driven combinatorial testingAaron Silverman
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In ActionJon Kruger
 
Test Driven Development (C#)
Test Driven Development (C#)Test Driven Development (C#)
Test Driven Development (C#)Alan Dean
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentDhaval Dalal
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...University of Hawai‘i at Mānoa
 
2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easierChristian Hujer
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentguestc8093a6
 
The problem with tdd
The problem with tddThe problem with tdd
The problem with tddDror Helper
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven DevelopmentFerdous Mahmud Shaon
 

Mais procurados (20)

Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
Agile Testing Overview
Agile Testing OverviewAgile Testing Overview
Agile Testing Overview
 
TDD (with FLOW3)
TDD (with FLOW3)TDD (with FLOW3)
TDD (with FLOW3)
 
Design For Testability
Design For TestabilityDesign For Testability
Design For Testability
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Development
 
Seconf2011 database driven combinatorial testing
Seconf2011   database driven combinatorial testingSeconf2011   database driven combinatorial testing
Seconf2011 database driven combinatorial testing
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
IDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal ToolIDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal Tool
 
A Taste of Exploratory Testing
A Taste of Exploratory TestingA Taste of Exploratory Testing
A Taste of Exploratory Testing
 
Illustrated Code (ASE 2021)
Illustrated Code (ASE 2021)Illustrated Code (ASE 2021)
Illustrated Code (ASE 2021)
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test Driven Development (C#)
Test Driven Development (C#)Test Driven Development (C#)
Test Driven Development (C#)
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
 
2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
The problem with tdd
The problem with tddThe problem with tdd
The problem with tdd
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven Development
 

Semelhante a The Test Case as Executable Example

Testing Plug-in Architectures
Testing Plug-in ArchitecturesTesting Plug-in Architectures
Testing Plug-in ArchitecturesArie van Deursen
 
EclipseCon: Test Confessions - What Eclipsers think and do about testing
EclipseCon: Test Confessions - What Eclipsers think and do about testingEclipseCon: Test Confessions - What Eclipsers think and do about testing
EclipseCon: Test Confessions - What Eclipsers think and do about testingMichaela Greiler
 
Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012Arie van Deursen
 
Clean tests
Clean testsClean tests
Clean testsAgileee
 
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalAnna Royzman
 
Software Design for Testability
Software Design for TestabilitySoftware Design for Testability
Software Design for Testabilityamr0mt
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test AutomationSauce Labs
 
Agile principles and practices
Agile principles and practicesAgile principles and practices
Agile principles and practicesVipin Jose
 
Software Test Patterns: Successes and Challenges
Software Test Patterns: Successes and ChallengesSoftware Test Patterns: Successes and Challenges
Software Test Patterns: Successes and ChallengesBob Binder
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...SQALab
 
Ohad Barzilay - Enhancing Productivity by Example - AgileIL11
Ohad Barzilay - Enhancing Productivity by Example - AgileIL11Ohad Barzilay - Enhancing Productivity by Example - AgileIL11
Ohad Barzilay - Enhancing Productivity by Example - AgileIL11AgileSparks
 
GrenchMark at CCGrid, May 2006.
GrenchMark at CCGrid, May 2006.GrenchMark at CCGrid, May 2006.
GrenchMark at CCGrid, May 2006.Alexandru Iosup
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools TrainingQEdge Tech
 
Scalable Learning Analytics and Interoperability – an assessment of potential...
Scalable Learning Analytics and Interoperability – an assessment of potential...Scalable Learning Analytics and Interoperability – an assessment of potential...
Scalable Learning Analytics and Interoperability – an assessment of potential...LACE Project
 
A New Model For Testing
A New Model For TestingA New Model For Testing
A New Model For TestingTEST Huddle
 
How to test a Mainframe Application
How to test a Mainframe ApplicationHow to test a Mainframe Application
How to test a Mainframe ApplicationMichael Erichsen
 
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
 
Maintaining Large Scale Julia Ecosystems
Maintaining Large Scale Julia EcosystemsMaintaining Large Scale Julia Ecosystems
Maintaining Large Scale Julia EcosystemsChris Rackauckas
 

Semelhante a The Test Case as Executable Example (20)

Testing Plug-in Architectures
Testing Plug-in ArchitecturesTesting Plug-in Architectures
Testing Plug-in Architectures
 
EclipseCon: Test Confessions - What Eclipsers think and do about testing
EclipseCon: Test Confessions - What Eclipsers think and do about testingEclipseCon: Test Confessions - What Eclipsers think and do about testing
EclipseCon: Test Confessions - What Eclipsers think and do about testing
 
Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012Kickoff Test Automation Day 2012
Kickoff Test Automation Day 2012
 
Clean tests
Clean testsClean tests
Clean tests
 
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
 
Software Design for Testability
Software Design for TestabilitySoftware Design for Testability
Software Design for Testability
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Agile principles and practices
Agile principles and practicesAgile principles and practices
Agile principles and practices
 
Software Test Patterns: Successes and Challenges
Software Test Patterns: Successes and ChallengesSoftware Test Patterns: Successes and Challenges
Software Test Patterns: Successes and Challenges
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
Ohad Barzilay - Enhancing Productivity by Example - AgileIL11
Ohad Barzilay - Enhancing Productivity by Example - AgileIL11Ohad Barzilay - Enhancing Productivity by Example - AgileIL11
Ohad Barzilay - Enhancing Productivity by Example - AgileIL11
 
GrenchMark at CCGrid, May 2006.
GrenchMark at CCGrid, May 2006.GrenchMark at CCGrid, May 2006.
GrenchMark at CCGrid, May 2006.
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools Training
 
Scalable Learning Analytics and Interoperability – an assessment of potential...
Scalable Learning Analytics and Interoperability – an assessment of potential...Scalable Learning Analytics and Interoperability – an assessment of potential...
Scalable Learning Analytics and Interoperability – an assessment of potential...
 
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
 
How to test a Mainframe Application
How to test a Mainframe ApplicationHow to test a Mainframe Application
How to test a Mainframe Application
 
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?
 
Maintaining Large Scale Julia Ecosystems
Maintaining Large Scale Julia EcosystemsMaintaining Large Scale Julia Ecosystems
Maintaining Large Scale Julia Ecosystems
 

Último

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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

The Test Case as Executable Example

  • 1. The Test Case as Executable Example CWI Lectures – Understanding Software June 14, 2012 Arie van Deursen @avandeursen 1
  • 2. 20th International Conference on Program Comprehension Study of the human activity of comprehending software; the processes and technologies for supporting it 2
  • 3. Programming by Example Programming by Example, Spreadsheet Data Manipulation Using Daniel Halbert, 1984, Xerox Examples, CACM, 2012 3
  • 4. The Testing Perspective • A test case is an executable example of system behavior • Stakeholder communication needs examples • Throughout the full development cycle 4
  • 5. webrat_steps.rb: Cucumber Then /^I should see "([^"]*)"$/ do |text| response.should contain(text) end Feature: Log in and out As an administrator I want to restrict access to certain portions of my site In order to prevent users from changing the content Scenario: Logging in Given I am not logged in as an administrator When I go to the administrative page And I fill in the fields | Username | admin | | Password | secret | And I press "Log in" Then I should be on the administrative page And I should see "Log out" Scenario: Logging out ... 5
  • 6. Plugin / Junit Testing in Eclipse. 1000s of tests 6
  • 7. Test Suite Information Needs Test Confessions: A Study of Testing Practices for Plug-In Systems Michaela Greiler, Arie van Deursen, Margaret-Anne Storey, ICSE 2012 7
  • 8. Challenges • Set of examples is incomplete • Set of examples is too large – Some grouping needed – Redundancy Test Similarity • Set of examples is disconnected – Requirements traceability – Backward coverage 8
  • 9. Requirements End-to-End Analysis Test ... ... High Level Integration Design Test Code Unit Test Measuring Test Case Similarity to Support Test Suite Understanding Michaela Greiler, Arie van Deursen, Andy Zaidman, TOOLS 2012 9
  • 10. Measuring Test Case Similarity Shared word count Test-aware Test Tests ranked instrumentation Traces by similarity 10
  • 11. Preliminary Evaluation • 75 unit tests • 37 unit • 14 acceptance tests • 6 end to end • Ground truth by hand • Ground truth from book • Most similar match: #1 or #2 in ground truth • Top 10: all (but one) explainable & useful • Surprises: mostly point to issue in test suite. • Work in progress: Analyzing Eclipse test suites. 11
  • 12. Rethinking “Test Cases as Examples” • Languages for writing examples – Different levels of abstraction / stakeholders – Executable – Analyzable – Connected to execution traces • Modularization and grouping of examples – Different levels of abstraction / stakeholders – Requirements / design / code coverage – Multiple views – Connected via execution traces 12
  • 13. In Conclusion • A test case is an executable example • Never enough, yet also too many • Test case connection via trace similarities • Language engineering opportunities ahead 13
  • 14. Photo credits • Passau: Andreas Brandl http://icpc12.sosy-lab.org/ • Programming by Example, picture JanHeering (CWI). Photo Eelco Visser. http://eelcovisser.org/post/91/example-driven-research • The Testing Perspective: Photo “Reaching for Understanding”, Flickr http://www.flickr.com/photos/elizabethsalib/2741807789/ • Andromeda Galaxy http://www.nasa.gov/mission_pages/spitzer/multimedia/spitzer- 20070604.html • Colliding galaxies http://hubblesite.org/newscenter/archive/releases/2007/08/ • Paul Klint, lecturing. http://www.frankwatching.com/archive/2009/05/18/het-nationaal-ict- event/ 14