SlideShare a Scribd company logo
1 of 41
Download to read offline
How I automate negative tests
An anecdote of effective practices in actual project implementations
198
8
200
5
200
9
201
4
201
6
201
7
• One of the market leaders in low
code platforms
• Help organizations to build and
improve apps in lightening speed
(months turn into weeks)
• In-house cloud support (and support
for major cloud vendors)
• Based out of Rotterdam, Boston,
and London
Mendix
Disclaimer
“Quality is value to some person” 

Gerald (Jerry) M. Weinberg
“Testing is questioning a product in order to
evaluate it”

James Bach
• What is negative testing?
• The light-bulb moment
• Why negative testing is needed?
• How I write (better) negative tests: inspired by true events
• Recap: helpful practices
• Conclusion
• Q&A
Agenda
“testing the system by giving invalid data” – an accepted answer in
stackoverflow
“Tests aimed at showing that a component or system does not work.
Negative testing is related to the tester's attitude rather than a specific
test approach or test design technique, e.g., testing with invalid input
values or exceptions.” - ISTQB Glossary
Some negative test scenarios for testing a pen –
• Change medium to write-on
• Replace the refill with an empty one
• Put the pen in liquid and verify
What is Negative testing?
• It is different from positive testing
• Fragile and not straightforward
• Too improbable to some
• Sometimes the term is used as a guide word heuristic
• There is nothing negative in negative testing
The light-bulb moment
• Prevents application from crashing
• Finds defects – improved quality
• Increases testing coverage
• More stable and reliable application
• Ensures application handles both good and bad data well
Why negative testing is needed?
Good Input Process Good Output Bad Input Process Ok Output
☺ 😉
How I write (better) negative tests:
inspired by true events
• Ask end user examples for negative scenarios
• Makes application robust
• Sparks productive discussions within the team
• May result in new business rule(s) and/or recruitments
• Also talk in terms of What the product should not do...
Discuss negative acceptance criteria too
Send email with
repayment link
Flow diagram of online donation system
• Ask end user examples for negative scenarios
• Makes application robust
• Sparks productive discussions within the team
• May result in new business rule(s) and/or recruitments
• Also talk in terms of What the product should not do...
Discuss negative acceptance criteria too
Should
not show
exceptio
n
Flow diagram of online donation system
• The classic question applies here
• Depends on risk and frequency of use
• If costly to maintain – consider ROI
• Technically challenging – implement feature differently
• Write test friendly code – less fragile tests
What and what not to automate
• Should have clear test objective
• Should verify an user behavior
• Group tests into functional slices –
➢Separate test to check routing to different banks
➢Seperate tests to check payment method decisioning
• Group tests based on type –
➢granular functional tests
➢integration tests
➢E2E/chain tests
Separate tests with clear test objective
Flow diagram of online donation system
• Should have clear test objective
• Should verify an user behavior
• Group tests into functional slices –
➢Separate test to check routing to different banks
➢Seperate tests to check payment method decisioning
• Group tests based on type –
➢granular functional tests
➢integration tests
➢E2E/chain tests
Separate tests with clear test objective
Flow diagram of online donation system
• Should have clear test objective
• Should verify an user behavior
• Group tests into functional slices –
➢Separate test to check routing to different banks
➢Seperate tests to check payment method decisioning
• Group tests based on type –
➢granular functional tests
➢integration tests
➢E2E/chain tests
Separate tests with clear test objective
Flow diagram of online donation system
Scenario: Check cancel payment functionality in an online donation application
Set up:
➢Execute a head-less test automation script
➢Trigger a database script to populate the data
Actual test: Test only the payment cancelling feature
Test set up can be a hack
Fill in donor
details
Choose mode of
payment
Cancel payment
Negative testing exposes loose ends
Positive scenario of successful payment for an online donation system:
• Comments box is an optional field
• So, often not filled
Negative scenario of spamming the application:
• The same comments box is a key component
• The team may agree to change the behavior
– only available to authenticated user
Negative testing exposes loose ends
Positive scenario of successful payment for an online donation system:
• Comments box is an optional field
• So, often not filled
Negative scenario of spamming the application:
• The same comments box is a key component
• The team may agree to change the behavior
– only available to authenticated user
• Negative tests can result in false positives
False positives
Positive test like –
auth_user.should
have_comments(“. t-helper-
textarea”)
• Will pass if the comments section
is available
• Will fail if the comments section is
removed/changed
Negative test like –
guest_user.should_not
have_comments(“. t-helper-
textarea”)
• Will pass if the comments section is
removed
• Will pass even if class is renamed to
t-helper-comments in DOM
Positive Test Negative Test False positive
• Balance with DRY (Don’t Repeat Yourself) opposite
• Write adjacent helper methods
Possible solutions to false positives
Scenario: User is able to add and delete contribution cause
Technical assertion
Functionally un-automatable!
Flow diagram of online donation system (new
Scenario: User is able to add and delete contribution cause
Technical assertion
Functionally un-automatable!
Scenario: User is able to add and delete donation cause
Customized assertion
Customized assertions
Scenario: Check deletion of a particular object (split shapes) in a modeling tool
Test should not test “Test Data”
Say NO to these kind of tests Say YES to these kind of tests
Scenario: Validate length of donor’s first name
Implementation impacts negative test
automation
Explicit Tests
No Tests
• The examples are phrased out as what customers don’t want
• Convert examples to positive behavior
• A sample scenario can be –
Given we’ve gone live with the front page

When the president of USA resigns on the same day

Then the site shouldn’t go down under the weight of people reading that ne
• Negative scenarios are powerful - often related to interesting stories
Negative non-functional scenarios in BDD
• “Postive test bias” exists in TDD approach
Negative testing in TDD
Number of
Test Cases
28.67%
71.33%
Positive TCs Negative TCs
Number of
Defects
Found
71.15%
28.85%
Positive TCs Negative TCs
Source:
Title: Effects of Negative Testing on TDD: An Industrial
Experiment
Author: Adnan Causevic, Rakesh Shukla, Sasikumar
Punnekkat
Feature flag in negative testing
Usage of feature flag:
✓Early access
✓Run A/B tests
✓Newbie vs Power user
Example
A Feature Flag (or Feature Toggle) is the ability to easily turn on/off features
of an application.
• A test to check the donor and donation details are available in different tabs
only with feature flag
• A test to check the donor and donation details are not available in tabbed view
without feature flag
• Separate test(s) for detailed checks of the tabbed views
Feature flag is live
• A test to check the donor and donation details are available in different tabs
only with feature flag
• A test to check the donor and donation details are not available in tabbed view
without feature flag
• Separate test(s) for detailed checks of the tabbed views
Feature flag is removed
✓ Discuss both positive and negative A/C
✓ Write test friendly code - less fragile tests
✓ Separate tests with clear test objective
✓ Focus on test, set up can be hack
✓ Negative testing exposes loose ends
✓ DRY opposite and adjacent helper
methods
✓ Customized assertions
✓ Test functionality not test data
✓ Implementation impacts
✓ Give positive twist to negative
non-functional BDD scenarios
✓ Positive test bias in TDD
✓ Feature flags in negative testin
Recap: helpful practices
× Testing strategy is based on “positive” testing
× Teams map tests to requirements
× Customers face issues related to untested conditions
× Customers used product in an unusual way
✓Testing a product against requirements is necessary but not enough
✓It’s more of a mindset change – everyone in team should be involved
✓More negative testing will lead to more positive outcomes
Time to get positive about negative testing
Thanks
tuhinmitra88@gmail.com Questions? @tuhinSub

More Related Content

What's hot

Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic TestingJimi Patel
 
Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself ) Globant
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and TechniqueSachin-QA
 
Test case techniques
Test case techniquesTest case techniques
Test case techniquesPina Parmar
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Mani Kanth
 
Testing fundamental stqa
Testing fundamental stqaTesting fundamental stqa
Testing fundamental stqaSwati Patel
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box TestingTestbytes
 
Documentation Example Testing: Value & Impact
Documentation Example Testing: Value & ImpactDocumentation Example Testing: Value & Impact
Documentation Example Testing: Value & ImpactDallas Kennedy
 
6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhardeepikakaler1
 
6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhardeepikakaler1
 
Software testing Training in Chandigarh (ppt)
Software testing Training in Chandigarh (ppt)Software testing Training in Chandigarh (ppt)
Software testing Training in Chandigarh (ppt)vicky shah
 
Software Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingSoftware Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingNikita Knysh
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic TestingHoang Nguyen
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box TestingMariamKhan120
 

What's hot (18)

Software Testing Presentation
Software Testing PresentationSoftware Testing Presentation
Software Testing Presentation
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Testing overview
Testing overviewTesting overview
Testing overview
 
Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself )
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)
 
Testing fundamental stqa
Testing fundamental stqaTesting fundamental stqa
Testing fundamental stqa
 
Sw testing and qa basics
Sw testing and qa basicsSw testing and qa basics
Sw testing and qa basics
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Documentation Example Testing: Value & Impact
Documentation Example Testing: Value & ImpactDocumentation Example Testing: Value & Impact
Documentation Example Testing: Value & Impact
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar
 
6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar6 weeks summer training in software testing,jalandhar
6 weeks summer training in software testing,jalandhar
 
Software testing Training in Chandigarh (ppt)
Software testing Training in Chandigarh (ppt)Software testing Training in Chandigarh (ppt)
Software testing Training in Chandigarh (ppt)
 
Software Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingSoftware Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box Testing
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 

Similar to Tuhin Mitra: How I Automate My Negative Tests

Beyond "Quality Assurance"
Beyond "Quality Assurance"Beyond "Quality Assurance"
Beyond "Quality Assurance"Jason Benton
 
Why Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsWhy Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsdpaulmerrill
 
Is Test Planning a lost art in Agile? by Michelle Williams
Is Test Planning a lost art in Agile? by Michelle WilliamsIs Test Planning a lost art in Agile? by Michelle Williams
Is Test Planning a lost art in Agile? by Michelle WilliamsQA or the Highway
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case WritingSarah Goldberg
 
Quality analysis pdf to study For your education
Quality analysis pdf to study For your educationQuality analysis pdf to study For your education
Quality analysis pdf to study For your educationShraddhatadmare1
 
Can testing be Agile
Can testing be Agile Can testing be Agile
Can testing be Agile Samuel Adesoga
 
A Software Testing Intro
A Software Testing IntroA Software Testing Intro
A Software Testing IntroEvozon Test Lab
 
Mt s3 methodoligies&principles
Mt s3 methodoligies&principlesMt s3 methodoligies&principles
Mt s3 methodoligies&principlesTestingGeeks
 
Software testing
Software testingSoftware testing
Software testingPreeti Mishra
 
Patrick McKenzie Opticon 2014: Advanced A/B Testing
Patrick McKenzie Opticon 2014: Advanced A/B TestingPatrick McKenzie Opticon 2014: Advanced A/B Testing
Patrick McKenzie Opticon 2014: Advanced A/B TestingPatrick McKenzie
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...AgileNetwork
 
Small is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignSmall is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignGeorgina Tilby
 
Mt s11 test_design
Mt s11 test_designMt s11 test_design
Mt s11 test_designTestingGeeks
 
Data and Consumer Product Development
Data and Consumer Product DevelopmentData and Consumer Product Development
Data and Consumer Product DevelopmentGaurav Bhalotia
 
Benchmarking
BenchmarkingBenchmarking
Benchmarkingnavya sree
 
V Model in Software Testing
V Model in Software TestingV Model in Software Testing
V Model in Software TestingAbdul Raheem
 
Design testabilty
Design testabiltyDesign testabilty
Design testabiltyRichard Neeve
 
A/B Testing Best Practices - Do's and Don'ts
A/B Testing Best Practices - Do's and Don'tsA/B Testing Best Practices - Do's and Don'ts
A/B Testing Best Practices - Do's and Don'tsRamkumar Ravichandran
 

Similar to Tuhin Mitra: How I Automate My Negative Tests (20)

Beyond "Quality Assurance"
Beyond "Quality Assurance"Beyond "Quality Assurance"
Beyond "Quality Assurance"
 
Why Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsWhy Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOps
 
Is Test Planning a lost art in Agile? by Michelle Williams
Is Test Planning a lost art in Agile? by Michelle WilliamsIs Test Planning a lost art in Agile? by Michelle Williams
Is Test Planning a lost art in Agile? by Michelle Williams
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case Writing
 
Quality analysis pdf to study For your education
Quality analysis pdf to study For your educationQuality analysis pdf to study For your education
Quality analysis pdf to study For your education
 
Can testing be Agile
Can testing be Agile Can testing be Agile
Can testing be Agile
 
A Software Testing Intro
A Software Testing IntroA Software Testing Intro
A Software Testing Intro
 
Mt s3 methodoligies&principles
Mt s3 methodoligies&principlesMt s3 methodoligies&principles
Mt s3 methodoligies&principles
 
Software testing
Software testingSoftware testing
Software testing
 
Patrick McKenzie Opticon 2014: Advanced A/B Testing
Patrick McKenzie Opticon 2014: Advanced A/B TestingPatrick McKenzie Opticon 2014: Advanced A/B Testing
Patrick McKenzie Opticon 2014: Advanced A/B Testing
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
 
Small is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignSmall is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case Design
 
Mt s11 test_design
Mt s11 test_designMt s11 test_design
Mt s11 test_design
 
Data and Consumer Product Development
Data and Consumer Product DevelopmentData and Consumer Product Development
Data and Consumer Product Development
 
Benchmarking
BenchmarkingBenchmarking
Benchmarking
 
V Model in Software Testing
V Model in Software TestingV Model in Software Testing
V Model in Software Testing
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Design testabilty
Design testabiltyDesign testabilty
Design testabilty
 
Testing
TestingTesting
Testing
 
A/B Testing Best Practices - Do's and Don'ts
A/B Testing Best Practices - Do's and Don'tsA/B Testing Best Practices - Do's and Don'ts
A/B Testing Best Practices - Do's and Don'ts
 

More from Anna Royzman

TLC2018 Bertold Kolics: Funnels of Hiring Test Engineers
TLC2018 Bertold Kolics: Funnels of Hiring Test EngineersTLC2018 Bertold Kolics: Funnels of Hiring Test Engineers
TLC2018 Bertold Kolics: Funnels of Hiring Test EngineersAnna Royzman
 
TLC2018 Dwayne Green: Let's Get Deliberate - for Managers
TLC2018 Dwayne Green:  Let's Get Deliberate - for ManagersTLC2018 Dwayne Green:  Let's Get Deliberate - for Managers
TLC2018 Dwayne Green: Let's Get Deliberate - for ManagersAnna Royzman
 
TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)
TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)
TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)Anna Royzman
 
TLC2018 Gitte Klitgaard: Imposter Syndrome
TLC2018 Gitte Klitgaard: Imposter SyndromeTLC2018 Gitte Klitgaard: Imposter Syndrome
TLC2018 Gitte Klitgaard: Imposter SyndromeAnna Royzman
 
TLC2018 Justin Ison: Delivering Flawless UI - Challenges and Solutions
TLC2018 Justin Ison: Delivering Flawless UI - Challenges and SolutionsTLC2018 Justin Ison: Delivering Flawless UI - Challenges and Solutions
TLC2018 Justin Ison: Delivering Flawless UI - Challenges and SolutionsAnna Royzman
 
TLC2018 Melissa Tondi: Finding Efficiencies in Software Testing
TLC2018 Melissa Tondi: Finding Efficiencies in Software TestingTLC2018 Melissa Tondi: Finding Efficiencies in Software Testing
TLC2018 Melissa Tondi: Finding Efficiencies in Software TestingAnna Royzman
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingAnna Royzman
 
TLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and Delivery
TLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and DeliveryTLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and Delivery
TLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and DeliveryAnna Royzman
 
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
 
TLC2018 Thomas Haver: The Science of Testing
TLC2018 Thomas Haver: The Science of TestingTLC2018 Thomas Haver: The Science of Testing
TLC2018 Thomas Haver: The Science of TestingAnna Royzman
 
TLC2018 Thomas Haver: Transform with Enterprise Automation
TLC2018 Thomas Haver: Transform with Enterprise AutomationTLC2018 Thomas Haver: Transform with Enterprise Automation
TLC2018 Thomas Haver: Transform with Enterprise AutomationAnna Royzman
 
TLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 years
TLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 yearsTLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 years
TLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 yearsAnna Royzman
 
The Three Pillars of Successful Test Leadership: Driving Projects, Process an...
The Three Pillars of Successful Test Leadership: Driving Projects, Process an...The Three Pillars of Successful Test Leadership: Driving Projects, Process an...
The Three Pillars of Successful Test Leadership: Driving Projects, Process an...Anna Royzman
 
Alexandra Schieren: It's Just...
Alexandra Schieren: It's Just...Alexandra Schieren: It's Just...
Alexandra Schieren: It's Just...Anna Royzman
 
Simon Peter Schrijver: Exploratory Testing Live
Simon Peter Schrijver: Exploratory Testing LiveSimon Peter Schrijver: Exploratory Testing Live
Simon Peter Schrijver: Exploratory Testing LiveAnna Royzman
 
Simon Peter Schrjver: Pair Testing
Simon Peter Schrjver: Pair TestingSimon Peter Schrjver: Pair Testing
Simon Peter Schrjver: Pair TestingAnna Royzman
 
Wing Wong: Quality Coaching
Wing Wong: Quality CoachingWing Wong: Quality Coaching
Wing Wong: Quality CoachingAnna Royzman
 
Sumeet Mandloi: Robust Security Testing Framework
Sumeet Mandloi: Robust Security Testing FrameworkSumeet Mandloi: Robust Security Testing Framework
Sumeet Mandloi: Robust Security Testing FrameworkAnna Royzman
 
Sumeet Mandloi: Artificial Intelligence Tools in QA Functions
Sumeet Mandloi: Artificial Intelligence Tools in QA FunctionsSumeet Mandloi: Artificial Intelligence Tools in QA Functions
Sumeet Mandloi: Artificial Intelligence Tools in QA FunctionsAnna Royzman
 
Sara Tabor: Testing For Accessibility - ARIA Ready For It?
Sara Tabor: Testing For Accessibility - ARIA Ready For It?Sara Tabor: Testing For Accessibility - ARIA Ready For It?
Sara Tabor: Testing For Accessibility - ARIA Ready For It?Anna Royzman
 

More from Anna Royzman (20)

TLC2018 Bertold Kolics: Funnels of Hiring Test Engineers
TLC2018 Bertold Kolics: Funnels of Hiring Test EngineersTLC2018 Bertold Kolics: Funnels of Hiring Test Engineers
TLC2018 Bertold Kolics: Funnels of Hiring Test Engineers
 
TLC2018 Dwayne Green: Let's Get Deliberate - for Managers
TLC2018 Dwayne Green:  Let's Get Deliberate - for ManagersTLC2018 Dwayne Green:  Let's Get Deliberate - for Managers
TLC2018 Dwayne Green: Let's Get Deliberate - for Managers
 
TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)
TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)
TLC2018 Gitte Klitgaard: Experience Hierarchy (Workshop)
 
TLC2018 Gitte Klitgaard: Imposter Syndrome
TLC2018 Gitte Klitgaard: Imposter SyndromeTLC2018 Gitte Klitgaard: Imposter Syndrome
TLC2018 Gitte Klitgaard: Imposter Syndrome
 
TLC2018 Justin Ison: Delivering Flawless UI - Challenges and Solutions
TLC2018 Justin Ison: Delivering Flawless UI - Challenges and SolutionsTLC2018 Justin Ison: Delivering Flawless UI - Challenges and Solutions
TLC2018 Justin Ison: Delivering Flawless UI - Challenges and Solutions
 
TLC2018 Melissa Tondi: Finding Efficiencies in Software Testing
TLC2018 Melissa Tondi: Finding Efficiencies in Software TestingTLC2018 Melissa Tondi: Finding Efficiencies in Software Testing
TLC2018 Melissa Tondi: Finding Efficiencies in Software Testing
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing Testing
 
TLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and Delivery
TLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and DeliveryTLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and Delivery
TLC2018 Tanya Kravtsov: 10 Steps to CI, Testing and Delivery
 
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
 
TLC2018 Thomas Haver: The Science of Testing
TLC2018 Thomas Haver: The Science of TestingTLC2018 Thomas Haver: The Science of Testing
TLC2018 Thomas Haver: The Science of Testing
 
TLC2018 Thomas Haver: Transform with Enterprise Automation
TLC2018 Thomas Haver: Transform with Enterprise AutomationTLC2018 Thomas Haver: Transform with Enterprise Automation
TLC2018 Thomas Haver: Transform with Enterprise Automation
 
TLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 years
TLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 yearsTLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 years
TLC2018 Valeriy Burmistrov: Testing Leaders in 5-10 years
 
The Three Pillars of Successful Test Leadership: Driving Projects, Process an...
The Three Pillars of Successful Test Leadership: Driving Projects, Process an...The Three Pillars of Successful Test Leadership: Driving Projects, Process an...
The Three Pillars of Successful Test Leadership: Driving Projects, Process an...
 
Alexandra Schieren: It's Just...
Alexandra Schieren: It's Just...Alexandra Schieren: It's Just...
Alexandra Schieren: It's Just...
 
Simon Peter Schrijver: Exploratory Testing Live
Simon Peter Schrijver: Exploratory Testing LiveSimon Peter Schrijver: Exploratory Testing Live
Simon Peter Schrijver: Exploratory Testing Live
 
Simon Peter Schrjver: Pair Testing
Simon Peter Schrjver: Pair TestingSimon Peter Schrjver: Pair Testing
Simon Peter Schrjver: Pair Testing
 
Wing Wong: Quality Coaching
Wing Wong: Quality CoachingWing Wong: Quality Coaching
Wing Wong: Quality Coaching
 
Sumeet Mandloi: Robust Security Testing Framework
Sumeet Mandloi: Robust Security Testing FrameworkSumeet Mandloi: Robust Security Testing Framework
Sumeet Mandloi: Robust Security Testing Framework
 
Sumeet Mandloi: Artificial Intelligence Tools in QA Functions
Sumeet Mandloi: Artificial Intelligence Tools in QA FunctionsSumeet Mandloi: Artificial Intelligence Tools in QA Functions
Sumeet Mandloi: Artificial Intelligence Tools in QA Functions
 
Sara Tabor: Testing For Accessibility - ARIA Ready For It?
Sara Tabor: Testing For Accessibility - ARIA Ready For It?Sara Tabor: Testing For Accessibility - ARIA Ready For It?
Sara Tabor: Testing For Accessibility - ARIA Ready For It?
 

Recently uploaded

VIP Kolkata Call Girl Rajarhat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Rajarhat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Rajarhat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Rajarhat 👉 8250192130 Available With Roomdivyansh0kumar0
 
operational plan ppt.pptx nursing management
operational plan ppt.pptx nursing managementoperational plan ppt.pptx nursing management
operational plan ppt.pptx nursing managementTulsiDhidhi1
 
Day 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC BootcampDay 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC BootcampPLCLeadershipDevelop
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call Girladitipandeya
 
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual serviceanilsa9823
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girladitipandeya
 
Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...
Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...
Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...Pooja Nehwal
 
{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai
{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai
{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, MumbaiPooja Nehwal
 
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607dollysharma2066
 

Recently uploaded (20)

Imagine - HR; are handling the 'bad banter' - Stella Chandler.pdf
Imagine - HR; are handling the 'bad banter' - Stella Chandler.pdfImagine - HR; are handling the 'bad banter' - Stella Chandler.pdf
Imagine - HR; are handling the 'bad banter' - Stella Chandler.pdf
 
VIP Kolkata Call Girl Rajarhat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Rajarhat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Rajarhat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Rajarhat 👉 8250192130 Available With Room
 
operational plan ppt.pptx nursing management
operational plan ppt.pptx nursing managementoperational plan ppt.pptx nursing management
operational plan ppt.pptx nursing management
 
Day 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC BootcampDay 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC Bootcamp
 
Unlocking the Future - Dr Max Blumberg, Founder of Blumberg Partnership
Unlocking the Future - Dr Max Blumberg, Founder of Blumberg PartnershipUnlocking the Future - Dr Max Blumberg, Founder of Blumberg Partnership
Unlocking the Future - Dr Max Blumberg, Founder of Blumberg Partnership
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Kondapur high-profile Call Girl
 
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
 
Discover -CQ Master Class - Rikita Wadhwa.pdf
Discover -CQ Master Class - Rikita Wadhwa.pdfDiscover -CQ Master Class - Rikita Wadhwa.pdf
Discover -CQ Master Class - Rikita Wadhwa.pdf
 
Rohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Leadership in Crisis - Helio Vogas, Risk & Leadership Keynote Speaker
Leadership in Crisis - Helio Vogas, Risk & Leadership Keynote SpeakerLeadership in Crisis - Helio Vogas, Risk & Leadership Keynote Speaker
Leadership in Crisis - Helio Vogas, Risk & Leadership Keynote Speaker
 
LoveLocalGov - Chris Twigg, Inner Circle
LoveLocalGov - Chris Twigg, Inner CircleLoveLocalGov - Chris Twigg, Inner Circle
LoveLocalGov - Chris Twigg, Inner Circle
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
 
Call Girls Service Tilak Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SERVICE
Call Girls Service Tilak Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SERVICECall Girls Service Tilak Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SERVICE
Call Girls Service Tilak Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SERVICE
 
Empowering Local Government Frontline Services - Mo Baines.pdf
Empowering Local Government Frontline Services - Mo Baines.pdfEmpowering Local Government Frontline Services - Mo Baines.pdf
Empowering Local Government Frontline Services - Mo Baines.pdf
 
Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...
Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...
Call now : 9892124323 Nalasopara Beautiful Call Girls Vasai virar Best Call G...
 
Disrupt or be Disrupted - Kirk Vallis.pdf
Disrupt or be Disrupted - Kirk Vallis.pdfDisrupt or be Disrupted - Kirk Vallis.pdf
Disrupt or be Disrupted - Kirk Vallis.pdf
 
Imagine - Creating Healthy Workplaces - Anthony Montgomery.pdf
Imagine - Creating Healthy Workplaces - Anthony Montgomery.pdfImagine - Creating Healthy Workplaces - Anthony Montgomery.pdf
Imagine - Creating Healthy Workplaces - Anthony Montgomery.pdf
 
{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai
{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai
{ 9892124323 }} Call Girls & Escorts in Hotel JW Marriott juhu, Mumbai
 
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607
 
Becoming an Inclusive Leader - Bernadette Thompson
Becoming an Inclusive Leader - Bernadette ThompsonBecoming an Inclusive Leader - Bernadette Thompson
Becoming an Inclusive Leader - Bernadette Thompson
 

Tuhin Mitra: How I Automate My Negative Tests

  • 1.
  • 2. How I automate negative tests An anecdote of effective practices in actual project implementations
  • 4.
  • 5. • One of the market leaders in low code platforms • Help organizations to build and improve apps in lightening speed (months turn into weeks) • In-house cloud support (and support for major cloud vendors) • Based out of Rotterdam, Boston, and London Mendix
  • 6. Disclaimer “Quality is value to some person” 
 Gerald (Jerry) M. Weinberg “Testing is questioning a product in order to evaluate it”
 James Bach
  • 7. • What is negative testing? • The light-bulb moment • Why negative testing is needed? • How I write (better) negative tests: inspired by true events • Recap: helpful practices • Conclusion • Q&A Agenda
  • 8. “testing the system by giving invalid data” – an accepted answer in stackoverflow “Tests aimed at showing that a component or system does not work. Negative testing is related to the tester's attitude rather than a specific test approach or test design technique, e.g., testing with invalid input values or exceptions.” - ISTQB Glossary Some negative test scenarios for testing a pen – • Change medium to write-on • Replace the refill with an empty one • Put the pen in liquid and verify What is Negative testing?
  • 9. • It is different from positive testing • Fragile and not straightforward • Too improbable to some • Sometimes the term is used as a guide word heuristic • There is nothing negative in negative testing The light-bulb moment
  • 10. • Prevents application from crashing • Finds defects – improved quality • Increases testing coverage • More stable and reliable application • Ensures application handles both good and bad data well Why negative testing is needed? Good Input Process Good Output Bad Input Process Ok Output ☺ 😉
  • 11. How I write (better) negative tests: inspired by true events
  • 12. • Ask end user examples for negative scenarios • Makes application robust • Sparks productive discussions within the team • May result in new business rule(s) and/or recruitments • Also talk in terms of What the product should not do... Discuss negative acceptance criteria too
  • 13. Send email with repayment link Flow diagram of online donation system
  • 14. • Ask end user examples for negative scenarios • Makes application robust • Sparks productive discussions within the team • May result in new business rule(s) and/or recruitments • Also talk in terms of What the product should not do... Discuss negative acceptance criteria too
  • 15. Should not show exceptio n Flow diagram of online donation system
  • 16. • The classic question applies here • Depends on risk and frequency of use • If costly to maintain – consider ROI • Technically challenging – implement feature differently • Write test friendly code – less fragile tests What and what not to automate
  • 17. • Should have clear test objective • Should verify an user behavior • Group tests into functional slices – ➢Separate test to check routing to different banks ➢Seperate tests to check payment method decisioning • Group tests based on type – ➢granular functional tests ➢integration tests ➢E2E/chain tests Separate tests with clear test objective
  • 18. Flow diagram of online donation system
  • 19. • Should have clear test objective • Should verify an user behavior • Group tests into functional slices – ➢Separate test to check routing to different banks ➢Seperate tests to check payment method decisioning • Group tests based on type – ➢granular functional tests ➢integration tests ➢E2E/chain tests Separate tests with clear test objective
  • 20. Flow diagram of online donation system
  • 21. • Should have clear test objective • Should verify an user behavior • Group tests into functional slices – ➢Separate test to check routing to different banks ➢Seperate tests to check payment method decisioning • Group tests based on type – ➢granular functional tests ➢integration tests ➢E2E/chain tests Separate tests with clear test objective
  • 22. Flow diagram of online donation system
  • 23. Scenario: Check cancel payment functionality in an online donation application Set up: ➢Execute a head-less test automation script ➢Trigger a database script to populate the data Actual test: Test only the payment cancelling feature Test set up can be a hack Fill in donor details Choose mode of payment Cancel payment
  • 24. Negative testing exposes loose ends Positive scenario of successful payment for an online donation system: • Comments box is an optional field • So, often not filled Negative scenario of spamming the application: • The same comments box is a key component • The team may agree to change the behavior – only available to authenticated user
  • 25. Negative testing exposes loose ends Positive scenario of successful payment for an online donation system: • Comments box is an optional field • So, often not filled Negative scenario of spamming the application: • The same comments box is a key component • The team may agree to change the behavior – only available to authenticated user
  • 26. • Negative tests can result in false positives False positives Positive test like – auth_user.should have_comments(“. t-helper- textarea”) • Will pass if the comments section is available • Will fail if the comments section is removed/changed Negative test like – guest_user.should_not have_comments(“. t-helper- textarea”) • Will pass if the comments section is removed • Will pass even if class is renamed to t-helper-comments in DOM Positive Test Negative Test False positive
  • 27. • Balance with DRY (Don’t Repeat Yourself) opposite • Write adjacent helper methods Possible solutions to false positives
  • 28. Scenario: User is able to add and delete contribution cause Technical assertion Functionally un-automatable!
  • 29. Flow diagram of online donation system (new
  • 30. Scenario: User is able to add and delete contribution cause Technical assertion Functionally un-automatable!
  • 31. Scenario: User is able to add and delete donation cause Customized assertion Customized assertions
  • 32. Scenario: Check deletion of a particular object (split shapes) in a modeling tool Test should not test “Test Data” Say NO to these kind of tests Say YES to these kind of tests
  • 33. Scenario: Validate length of donor’s first name Implementation impacts negative test automation Explicit Tests No Tests
  • 34. • The examples are phrased out as what customers don’t want • Convert examples to positive behavior • A sample scenario can be – Given we’ve gone live with the front page
 When the president of USA resigns on the same day
 Then the site shouldn’t go down under the weight of people reading that ne • Negative scenarios are powerful - often related to interesting stories Negative non-functional scenarios in BDD
  • 35. • “Postive test bias” exists in TDD approach Negative testing in TDD Number of Test Cases 28.67% 71.33% Positive TCs Negative TCs Number of Defects Found 71.15% 28.85% Positive TCs Negative TCs Source: Title: Effects of Negative Testing on TDD: An Industrial Experiment Author: Adnan Causevic, Rakesh Shukla, Sasikumar Punnekkat
  • 36. Feature flag in negative testing Usage of feature flag: ✓Early access ✓Run A/B tests ✓Newbie vs Power user Example A Feature Flag (or Feature Toggle) is the ability to easily turn on/off features of an application.
  • 37. • A test to check the donor and donation details are available in different tabs only with feature flag • A test to check the donor and donation details are not available in tabbed view without feature flag • Separate test(s) for detailed checks of the tabbed views Feature flag is live
  • 38. • A test to check the donor and donation details are available in different tabs only with feature flag • A test to check the donor and donation details are not available in tabbed view without feature flag • Separate test(s) for detailed checks of the tabbed views Feature flag is removed
  • 39. ✓ Discuss both positive and negative A/C ✓ Write test friendly code - less fragile tests ✓ Separate tests with clear test objective ✓ Focus on test, set up can be hack ✓ Negative testing exposes loose ends ✓ DRY opposite and adjacent helper methods ✓ Customized assertions ✓ Test functionality not test data ✓ Implementation impacts ✓ Give positive twist to negative non-functional BDD scenarios ✓ Positive test bias in TDD ✓ Feature flags in negative testin Recap: helpful practices
  • 40. × Testing strategy is based on “positive” testing × Teams map tests to requirements × Customers face issues related to untested conditions × Customers used product in an unusual way ✓Testing a product against requirements is necessary but not enough ✓It’s more of a mindset change – everyone in team should be involved ✓More negative testing will lead to more positive outcomes Time to get positive about negative testing