© Curiosity Software Ireland Ltd. 2020
Model-Based Testing for Cypress
September 29th 2020
Moderator: Tom Pryce
Communication Manager, Curiosity Software Ireland
Thomas.Pryce@Curiosity.Software
@TomTestsToo
Gleb Bahmutov
VP of Engineering, Cypress
Gleb@Cypress.io
@bahmutov
James Walker
Director of Technology, Curiosity.
James.Walker@Curiosity.Software
@CuriositySoft
Harry Burn
Solutions Architect, Curiosity
Harry.Burn@Curiosity.Software
@CuriositySoft
© Curiosity Software Ireland Ltd. 2020
Model-Based Testing for Cypress
1. Barriers to successful test automation
2. How can MBT for Cypress help with these problems?
3. Demo: MBT for a Cypress framework
4. Questions and discussion
© Curiosity Software Ireland Ltd. 2020
1. Barriers to successful
test automation
What automation challenges are worth solving?
© Curiosity Software Ireland Ltd. 2020
Poll: What are the primary barriers to test
automation at your organisation?
© Curiosity Software Ireland Ltd. 2020
5 Barriers to in-sprint test automation
1. Automated test creation remains wholly manual (there’s never enough time!).
2. Manual test case design cannot achieve sufficient coverage for complex systems.
3. Test data destabilises automation and creates bottlenecks.
− The average QA team spend 44% of their time searching, managing and generating data.1
4. Brittle tests need maintaining manually before every release.
− 65% of World Quality Repot respondents cite difficulties in automation “because our applications change too much”2
5. Automation code might not be easily re-usable, over-working a team of skilled engineers.
− 46% of respondents lack the skilled “test automation resources” needed to achieve their desired automation rate.2
1 Sogeti, Capgemini (2020), Continuous Testing Report 2020 2 Capgemini, Sogeti, Micro Focus (2019), World Quality Report 2019-20
© Curiosity Software Ireland Ltd. 2020
Change is a real headache…
Change requests/user
stories flow in
A code change made to a
maze of components
Which tests are
affected? Which need
updating?
What has been
impacted by the
change? What
needs re-testing?
Test Automation Engineer
Automated test maintenance kills the ROI of automation
No formal mapping: code requirements
Code
Commit
© Curiosity Software Ireland Ltd. 2020
Challenges across the SDLC
Silo
‘Agile’, Continuous Testing, “DevOps”… Or mini-waterfalls?
Wall Information Hop Delay
No feedback
or traceability
Dev Automation EngineersQA/TestBAs
Effort: Repetitious.
“Flat” formats prevent
automation in QA & Dev.
Quality:Most bugs
originate in incomplete,
ambiguous requirements.
Effort: Re-coding after
misunderstood designs
and uncaught bugs.
Quality:Bugs are more
damaging the later they
are discovered.
Effort: Slowly create
and maintain 1000s of
test cases. Wait for data.
Quality:Manually
derived tests hit a
fraction of system logic.
Effort: Repetitious
scripting, growing
maintenance.
Quality: Data clashes,
false positives, false
negatives, low coverage.
Formulate complex requirements
and change requests in
disparate, unconnected formats.
Convert the incomplete designs
into code, trying to fix the impact
of changes on complex systems.
Unsystematically create high
volume, low coverage test cases,
mismatched with system designs.
Choose between creating new
scripts for new logic or
maintaining existing code.
© Curiosity Software Ireland Ltd 2020
2. Why MBT for Cypress?
How can modelling and Cypress work together to solve these problems?
© Curiosity Software Ireland Ltd. 2020
Poll: How much experience do you have
with model-based testing?
© Curiosity Software Ireland Ltd 2020
Model-Based Testing for
Cypress
Recorded
tests activity
Test Cases
BPMN
diagrams
BDD
Scenarios
Business
Requirements
Application Scans
Reactive Model
of the system
Find / Make / Allocate Test Data
Run Results
Tests
New
Iteration
 Perfect sets of tests
 Fast Maintenance
 Reusable Components
 Move faster
 Deliver with confidence
Test Automation
© Curiosity Software Ireland Ltd 2020
Solving challenges in automation
Modelling does the hardwork upfront, helping break barriers to test automation:
1. Modelling automates potentially slow and repetitive test case and data creation.
2. It minimises manual rework – updating models updates all artefacts generated from them.
3. Test generation optimises tests to find bugs earlier and at less cost to fix.
4. Modelling reduces silos, miscommunication, and the need to convert assets from one format to another –
everything ripples from the models.
5. Re-usability frees up engineering time – engineers focus on feeding in new code which is re-used across
cross-functional teams.
6. Model-based testing minimises test data frustrations, creating unique combinations for every test.
© Curiosity Software Ireland Ltd 2020
Across the SDLC: Collaborate,
communicate, share and re-use
The models then automate the creation test assets and specifications, driving
accurate development and in-sprint testing
Skills sharing & cross-team collaboration:
People who understand the user
requirements
People who understand testing
People who understand automation
People who understand data
People who understand integration
People who understand CI/CD
A single source of truth for all assets
Test scripts
Test Cases
Written Requirements & Diagrams
Gherkin specifications
Test Data
Service Definitions & Virtual Services
Cross-team alignment & real-time communication • No technical debt • In-sprint
automation • Minimal dev rework • Avoid duplicate effect and cumbersome maintenance
© Curiosity Software Ireland Ltd 2020
Modelling is an accelerator, not
replacement, for good automation
With modelling, automation becomes a largely automated comparison
of the modelled system to the system built in code.
That means accurate regression tests executed in-sprint.
Feeding in new code to your Cypress framework, it becomes re-usable in
future sprints and by non-coders.
You can focus on testing what’s new and interesting, testing fast-
changing systems.
Demo
© Curiosity Software Ireland Ltd. 2020
© Curiosity Software Ireland Ltd 2020
What value has model-based
testing delivered at
organisations?
Harry Burn
Solutions Architect, Curiosity
Harry.Burn@Curiosity.Software
@CuriositySoft
© Curiosity Software Ireland Ltd 2020
Questions and Discussion
© Curiosity Software Ireland Ltd 2020
Carry on the conversation?
• We’d love to chat further. Book a web meeting at
calendly.com/curiosity-james
• Want to try MBT? Visit Testmodeller.io for a free trial. Use our free
Cypress tutorial to get started.
• Follow @CuriositySoft and @Cypress_io.
• Email us on James.Walker@Curiosity.Software or Gleb@Cypress.io
© Curiosity Software Ireland Ltd 2020
Thank you
James.Walker@Curiosity.Software
Gleb@Cypress.io
Harry.Burn@Curiosity.Software

Model-Based Testing for Cypress

  • 1.
    © Curiosity SoftwareIreland Ltd. 2020 Model-Based Testing for Cypress September 29th 2020 Moderator: Tom Pryce Communication Manager, Curiosity Software Ireland Thomas.Pryce@Curiosity.Software @TomTestsToo Gleb Bahmutov VP of Engineering, Cypress Gleb@Cypress.io @bahmutov James Walker Director of Technology, Curiosity. James.Walker@Curiosity.Software @CuriositySoft Harry Burn Solutions Architect, Curiosity Harry.Burn@Curiosity.Software @CuriositySoft
  • 2.
    © Curiosity SoftwareIreland Ltd. 2020 Model-Based Testing for Cypress 1. Barriers to successful test automation 2. How can MBT for Cypress help with these problems? 3. Demo: MBT for a Cypress framework 4. Questions and discussion
  • 3.
    © Curiosity SoftwareIreland Ltd. 2020 1. Barriers to successful test automation What automation challenges are worth solving?
  • 4.
    © Curiosity SoftwareIreland Ltd. 2020 Poll: What are the primary barriers to test automation at your organisation?
  • 5.
    © Curiosity SoftwareIreland Ltd. 2020 5 Barriers to in-sprint test automation 1. Automated test creation remains wholly manual (there’s never enough time!). 2. Manual test case design cannot achieve sufficient coverage for complex systems. 3. Test data destabilises automation and creates bottlenecks. − The average QA team spend 44% of their time searching, managing and generating data.1 4. Brittle tests need maintaining manually before every release. − 65% of World Quality Repot respondents cite difficulties in automation “because our applications change too much”2 5. Automation code might not be easily re-usable, over-working a team of skilled engineers. − 46% of respondents lack the skilled “test automation resources” needed to achieve their desired automation rate.2 1 Sogeti, Capgemini (2020), Continuous Testing Report 2020 2 Capgemini, Sogeti, Micro Focus (2019), World Quality Report 2019-20
  • 6.
    © Curiosity SoftwareIreland Ltd. 2020 Change is a real headache… Change requests/user stories flow in A code change made to a maze of components Which tests are affected? Which need updating? What has been impacted by the change? What needs re-testing? Test Automation Engineer Automated test maintenance kills the ROI of automation No formal mapping: code requirements Code Commit
  • 7.
    © Curiosity SoftwareIreland Ltd. 2020 Challenges across the SDLC Silo ‘Agile’, Continuous Testing, “DevOps”… Or mini-waterfalls? Wall Information Hop Delay No feedback or traceability Dev Automation EngineersQA/TestBAs Effort: Repetitious. “Flat” formats prevent automation in QA & Dev. Quality:Most bugs originate in incomplete, ambiguous requirements. Effort: Re-coding after misunderstood designs and uncaught bugs. Quality:Bugs are more damaging the later they are discovered. Effort: Slowly create and maintain 1000s of test cases. Wait for data. Quality:Manually derived tests hit a fraction of system logic. Effort: Repetitious scripting, growing maintenance. Quality: Data clashes, false positives, false negatives, low coverage. Formulate complex requirements and change requests in disparate, unconnected formats. Convert the incomplete designs into code, trying to fix the impact of changes on complex systems. Unsystematically create high volume, low coverage test cases, mismatched with system designs. Choose between creating new scripts for new logic or maintaining existing code.
  • 8.
    © Curiosity SoftwareIreland Ltd 2020 2. Why MBT for Cypress? How can modelling and Cypress work together to solve these problems?
  • 9.
    © Curiosity SoftwareIreland Ltd. 2020 Poll: How much experience do you have with model-based testing?
  • 10.
    © Curiosity SoftwareIreland Ltd 2020 Model-Based Testing for Cypress Recorded tests activity Test Cases BPMN diagrams BDD Scenarios Business Requirements Application Scans Reactive Model of the system Find / Make / Allocate Test Data Run Results Tests New Iteration  Perfect sets of tests  Fast Maintenance  Reusable Components  Move faster  Deliver with confidence Test Automation
  • 11.
    © Curiosity SoftwareIreland Ltd 2020 Solving challenges in automation Modelling does the hardwork upfront, helping break barriers to test automation: 1. Modelling automates potentially slow and repetitive test case and data creation. 2. It minimises manual rework – updating models updates all artefacts generated from them. 3. Test generation optimises tests to find bugs earlier and at less cost to fix. 4. Modelling reduces silos, miscommunication, and the need to convert assets from one format to another – everything ripples from the models. 5. Re-usability frees up engineering time – engineers focus on feeding in new code which is re-used across cross-functional teams. 6. Model-based testing minimises test data frustrations, creating unique combinations for every test.
  • 12.
    © Curiosity SoftwareIreland Ltd 2020 Across the SDLC: Collaborate, communicate, share and re-use The models then automate the creation test assets and specifications, driving accurate development and in-sprint testing Skills sharing & cross-team collaboration: People who understand the user requirements People who understand testing People who understand automation People who understand data People who understand integration People who understand CI/CD A single source of truth for all assets Test scripts Test Cases Written Requirements & Diagrams Gherkin specifications Test Data Service Definitions & Virtual Services Cross-team alignment & real-time communication • No technical debt • In-sprint automation • Minimal dev rework • Avoid duplicate effect and cumbersome maintenance
  • 13.
    © Curiosity SoftwareIreland Ltd 2020 Modelling is an accelerator, not replacement, for good automation With modelling, automation becomes a largely automated comparison of the modelled system to the system built in code. That means accurate regression tests executed in-sprint. Feeding in new code to your Cypress framework, it becomes re-usable in future sprints and by non-coders. You can focus on testing what’s new and interesting, testing fast- changing systems.
  • 14.
    Demo © Curiosity SoftwareIreland Ltd. 2020
  • 15.
    © Curiosity SoftwareIreland Ltd 2020 What value has model-based testing delivered at organisations? Harry Burn Solutions Architect, Curiosity Harry.Burn@Curiosity.Software @CuriositySoft
  • 16.
    © Curiosity SoftwareIreland Ltd 2020 Questions and Discussion
  • 17.
    © Curiosity SoftwareIreland Ltd 2020 Carry on the conversation? • We’d love to chat further. Book a web meeting at calendly.com/curiosity-james • Want to try MBT? Visit Testmodeller.io for a free trial. Use our free Cypress tutorial to get started. • Follow @CuriositySoft and @Cypress_io. • Email us on James.Walker@Curiosity.Software or Gleb@Cypress.io
  • 18.
    © Curiosity SoftwareIreland Ltd 2020 Thank you James.Walker@Curiosity.Software Gleb@Cypress.io Harry.Burn@Curiosity.Software

Editor's Notes

  • #2 Logo and picture okay?
  • #5  Include: Insufficient test coverage Test scripting is too complex or too time-consuming Test maintenance time Unavailable, incomplete or inaccurate test data Difficulty in knowing what to test Lab and/or environment set-up challenges Not included: Slow run result analysis Testing instability or false positives
  • #10 I’ve used model-based testing extensively (over many years and projects) I’ve had some experience in using model-based testing (in one or two projects) I have tried some example techniques or tools (e.g. free trials and ‘playing around’) I have no model-based testing experience What level of experience do you have with MBT? Loads – I’m an expert / more than you Moderate None
  • #16 MBTA works as an accelerator, not a replacement. It allows you to: Minimize duplicate effort and avoid repetitious test scripting – engineers focus on creating what’s needed. Cross-functional can re-use the code! Automate maintenance of existing code – focus on newly added/updated logic. No test data frustrations – “Just in time” data avoids frustrating data clashes, false positives, and false negatives. Optimise tests for quality - automation finds bugs before they hit production.