SlideShare a Scribd company logo
1 of 22
A LEGO Exercise and an
Experience Report
David Kane
Solution Architect and Coach
General Dynamics Information Technology
Twitter: @ADavidKane
LinkedIn: david-kane-agile
George Paci
Senior DevOps Engineer
MAXIMUS Federal
Email:gpaci@tiac.net
Agile DC
October 15th, 2018
Approval Tests in Action
2 | https://www.agiledc.org
Exercise: Round 1
• Build a person using LEGO
pieces with the following
criteria
 Use at least 5 pieces
 Use no more than 10 pieces
 Have a distinct head
 Have two distinct arms
 Have two distinct legs
 Arms should look similar to
each other
 Legs should look similar to
each other
 Legs, Arms and Head should
look different
• Each person builds their own
figure
3 | https://www.agiledc.org
Exercise: Round 2
• Using other LEGO bricks,
write as many tests as you
can to validate that you have
satisfied the criteria laid out
in Round 1
 Use at least 5 pieces
 Use no more than 10 pieces
 Have a distinct head
 Have two distinct arms
 Have two distinct legs
 Arms should look similar to
each other
 Legs should look similar to
each other
 Legs, Arms and Head
should look different
4 | https://www.agiledc.org
Exercise: Round 3
• Make a copy of your solution
from Round 1
• Visually inspect your copy to
confirm that it satisfied the
Round 1 criteria
• Compare your Round 3 test
with your Round 1 solution to
verify that they are equivalent
5 | https://www.agiledc.org
Discussion
6 | https://www.agiledc.org
Approval Tests
Created By
Llewelyn Falco
7 | https://www.agiledc.org
• Write test code that interacts with
your system
• Capture the results as a String
 Inspect the string to verify it is
correct
 Save it as a reference
• Subsequent tests compare new
results against the reference string
 Match: Passes
 Difference: Fails
• Diff Tools highlight changes when
a test fails
• Inspect failures
 Change the application code?
 Use the new result file as the
approval reference
Approval Extend Unit Test Frameworks
Available for many languages
including:
Java, .Net, PHP, Python,
JavaScript, C++
Characterization Tests
Test by Example
8 | https://www.agiledc.org
Example -- Starting
Approved
Received
9 | https://www.agiledc.org
Example – Accept at Approved
Approved
Received
10 | https://www.agiledc.org
Example – Test Passes, No Display Needed
11 | https://www.agiledc.org
Example – Approval Test Detects a Bug
Differences Detected
12 | https://www.agiledc.org
Example – This One is a New Feature
Difference DetectedDifferences Detected
13 | https://www.agiledc.org
Approval Test Code Example
Very Little Test Code
Expected Outcome in Approval File
14 | https://www.agiledc.org
Typical Unit Test Code
More Verbose
Harder to Read
15 | https://www.agiledc.org
• Tests that are easier to understand
• Write tests for code that is not easily testable
Approval Test Benefits
16 | https://www.agiledc.org
• New Projects
 Use approvals to externalize your expected test
behavior
 You can reduce your test code footprint, and improve
the readability of your expected results
• Legacy Projects
 Look for interfaces can you access programmatically
with no or minimal system changes?
 Identify how you can you most easily express your
systems output as a string?
 Use these answers to boostrap your automated testing
with approvals
Approval Test Applicability
17 | https://www.agiledc.org
• Legacy code base had
limited automated testing
• Introducing strong unit
tests required refactoring
the code
• Did not want to refactor
without automated tests
• Approval Tests provided
a path out of this
conundrum
Recently Used Approval Tests Bootstrap
Automated Testing
18 | https://www.agiledc.org
• We had many existing interfaces in our system that could used
without application modifications that could fit into the approval
framework
 JSON
 Excel
• We don’t need pages of test code filled with “AssertEquals”
statements
• Our tests have become much more sensitive to application code
changes
• We have gone from 6% test coverage to 46% test coverage in a
few months. Our key areas of focus have coverage over 75%
 We have sufficient coverage that we can now refactor safely
 We are now able to start writing code and tests with better
isolation
Approval Tests Results
19 | https://www.agiledc.org
• Our Approval Tests lack isolation
 Because many tests execute some of the same code, a
single problem in shared code can cause many test to
fail
 Many existing interfaces had call stacks that extended
into our database
o Relatively slow
o Meant we had to deal with database management
challenges
 This is not a problem of the approval framework per se,
but of the fact we are using broad-based interfaces
against which to execute the tests
• Not suitable for Test-Driven Development (TDD)
Approval Tests Weaknesses
20 | https://www.agiledc.org
Questions?
More Information
http://approvaltests.com/
https://github.com/approvals
22 | https://www.agiledc.org
Session Feedback
• How was today’s session?
• Green: Great session, I am glad I
came
• Yellow: Meh
• Red: I wished I had spent my time
doing something else
• Do you have any suggestions,
comments, or concerns for the
speakers or the organizers?

More Related Content

What's hot

Getting Started With Selenium
Getting Started With SeleniumGetting Started With Selenium
Getting Started With SeleniumSmartBear
 
Aistė Stikliutė - Testing in continuous delivery
Aistė Stikliutė - Testing in continuous deliveryAistė Stikliutė - Testing in continuous delivery
Aistė Stikliutė - Testing in continuous deliveryAgile Lietuva
 
Automated Testing With Jasmine, PhantomJS and Jenkins
Automated Testing With Jasmine, PhantomJS and JenkinsAutomated Testing With Jasmine, PhantomJS and Jenkins
Automated Testing With Jasmine, PhantomJS and JenkinsWork at Play
 
Selenium Users Anonymous
Selenium Users AnonymousSelenium Users Anonymous
Selenium Users AnonymousDave Haeffner
 
Continuous everything
Continuous everythingContinuous everything
Continuous everythingTEST Huddle
 
Avoiding test hell
Avoiding test hellAvoiding test hell
Avoiding test hellYun Ki Lee
 
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
 
ATAGTR2017 Performance Testing of Big Data Application
ATAGTR2017 Performance Testing of Big Data ApplicationATAGTR2017 Performance Testing of Big Data Application
ATAGTR2017 Performance Testing of Big Data ApplicationAgile Testing Alliance
 
Sustainable Automation Frameworks by Kelsey Shannahan
Sustainable Automation Frameworks by Kelsey ShannahanSustainable Automation Frameworks by Kelsey Shannahan
Sustainable Automation Frameworks by Kelsey ShannahanQA or the Highway
 
Agile Testing in Enterprise: Way to transform - SQA Days 2014
Agile Testing in Enterprise: Way to transform - SQA Days 2014Agile Testing in Enterprise: Way to transform - SQA Days 2014
Agile Testing in Enterprise: Way to transform - SQA Days 2014Andrey Rebrov
 
Test Automation Canvas
Test Automation CanvasTest Automation Canvas
Test Automation CanvasAndrey Rebrov
 
Strategies in continuous delivery
Strategies in continuous deliveryStrategies in continuous delivery
Strategies in continuous deliveryAviran Mordo
 
Spec By Example or How to teach people talk to each other
Spec By Example or How to teach people talk to each otherSpec By Example or How to teach people talk to each other
Spec By Example or How to teach people talk to each otherAndrey Rebrov
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
How engineering practices help business
How engineering practices help businessHow engineering practices help business
How engineering practices help businessAndrey Rebrov
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?Vincent Biret
 
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and InterfacesEpisode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and InterfacesJitendra Zaa
 

What's hot (20)

Getting Started With Selenium
Getting Started With SeleniumGetting Started With Selenium
Getting Started With Selenium
 
Aistė Stikliutė - Testing in continuous delivery
Aistė Stikliutė - Testing in continuous deliveryAistė Stikliutė - Testing in continuous delivery
Aistė Stikliutė - Testing in continuous delivery
 
Automated Testing With Jasmine, PhantomJS and Jenkins
Automated Testing With Jasmine, PhantomJS and JenkinsAutomated Testing With Jasmine, PhantomJS and Jenkins
Automated Testing With Jasmine, PhantomJS and Jenkins
 
Selenium Users Anonymous
Selenium Users AnonymousSelenium Users Anonymous
Selenium Users Anonymous
 
Continuous everything
Continuous everythingContinuous everything
Continuous everything
 
Avoiding test hell
Avoiding test hellAvoiding test hell
Avoiding test hell
 
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?
 
ATAGTR2017 Performance Testing of Big Data Application
ATAGTR2017 Performance Testing of Big Data ApplicationATAGTR2017 Performance Testing of Big Data Application
ATAGTR2017 Performance Testing of Big Data Application
 
Sustainable Automation Frameworks by Kelsey Shannahan
Sustainable Automation Frameworks by Kelsey ShannahanSustainable Automation Frameworks by Kelsey Shannahan
Sustainable Automation Frameworks by Kelsey Shannahan
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
Agile Testing in Enterprise: Way to transform - SQA Days 2014
Agile Testing in Enterprise: Way to transform - SQA Days 2014Agile Testing in Enterprise: Way to transform - SQA Days 2014
Agile Testing in Enterprise: Way to transform - SQA Days 2014
 
Test Automation Canvas
Test Automation CanvasTest Automation Canvas
Test Automation Canvas
 
Strategies in continuous delivery
Strategies in continuous deliveryStrategies in continuous delivery
Strategies in continuous delivery
 
Just startcoding
Just startcodingJust startcoding
Just startcoding
 
Developer Testing
Developer TestingDeveloper Testing
Developer Testing
 
Spec By Example or How to teach people talk to each other
Spec By Example or How to teach people talk to each otherSpec By Example or How to teach people talk to each other
Spec By Example or How to teach people talk to each other
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
How engineering practices help business
How engineering practices help businessHow engineering practices help business
How engineering practices help business
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
 
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and InterfacesEpisode 3 – Classes, Inheritance, Abstract Class, and Interfaces
Episode 3 – Classes, Inheritance, Abstract Class, and Interfaces
 

Similar to LEGO Exercise Shows How Approval Tests Validate Code

Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Applitools
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.Matt Eland
 
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Dinis Cruz
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupDave Haeffner
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium SuccessfullyDave Haeffner
 
Introduction to Testing and TDD
Introduction to Testing and TDDIntroduction to Testing and TDD
Introduction to Testing and TDDSarah Dutkiewicz
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentZendCon
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Sauce Labs
 
May 2021 Spark Testing ... or how to farm reputation on StackOverflow
May 2021 Spark Testing ... or how to farm reputation on StackOverflowMay 2021 Spark Testing ... or how to farm reputation on StackOverflow
May 2021 Spark Testing ... or how to farm reputation on StackOverflowAdam Doyle
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayBizTalk360
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...SmartBear
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing SoftwareSteven Smith
 
Trends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa CrispinTrends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa CrispinDirecti Group
 
VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentRaj Indugula
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choicetoddbr
 
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
 

Similar to LEGO Exercise Shows How Approval Tests Validate Code (20)

Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.How do you tame a big ball of mud? One test at a time.
How do you tame a big ball of mud? One test at a time.
 
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
 
Introduction to Testing and TDD
Introduction to Testing and TDDIntroduction to Testing and TDD
Introduction to Testing and TDD
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
May 2021 Spark Testing ... or how to farm reputation on StackOverflow
May 2021 Spark Testing ... or how to farm reputation on StackOverflowMay 2021 Spark Testing ... or how to farm reputation on StackOverflow
May 2021 Spark Testing ... or how to farm reputation on StackOverflow
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration Monday
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing Software
 
Trends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa CrispinTrends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa Crispin
 
VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile Environment
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
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
 

More from houseofyin

Hang Out with the Devops Folks
Hang Out with the Devops FolksHang Out with the Devops Folks
Hang Out with the Devops Folkshouseofyin
 
Biological Metaphors for Agile Organizations
Biological Metaphors for Agile OrganizationsBiological Metaphors for Agile Organizations
Biological Metaphors for Agile Organizationshouseofyin
 
GLASScon Evolving and Agile Organization: Inspiration from Biology
GLASScon Evolving and Agile Organization: Inspiration from BiologyGLASScon Evolving and Agile Organization: Inspiration from Biology
GLASScon Evolving and Agile Organization: Inspiration from Biologyhouseofyin
 
A Partner is Good to Have, but Difficult to Be
A Partner is Good to Have, but Difficult to BeA Partner is Good to Have, but Difficult to Be
A Partner is Good to Have, but Difficult to Behouseofyin
 
Keeping the Beat: Rhythm and Trust in Architecture
Keeping the Beat: Rhythm and Trust in ArchitectureKeeping the Beat: Rhythm and Trust in Architecture
Keeping the Beat: Rhythm and Trust in Architecturehouseofyin
 
Challenges in implementing Agile philosophies and methodologies in an SDLC wo...
Challenges in implementing Agile philosophies and methodologies in an SDLC wo...Challenges in implementing Agile philosophies and methodologies in an SDLC wo...
Challenges in implementing Agile philosophies and methodologies in an SDLC wo...houseofyin
 
GLASSCon 2.5 Dev Ops Sparkler
GLASSCon 2.5 Dev Ops SparklerGLASSCon 2.5 Dev Ops Sparkler
GLASSCon 2.5 Dev Ops Sparklerhouseofyin
 

More from houseofyin (7)

Hang Out with the Devops Folks
Hang Out with the Devops FolksHang Out with the Devops Folks
Hang Out with the Devops Folks
 
Biological Metaphors for Agile Organizations
Biological Metaphors for Agile OrganizationsBiological Metaphors for Agile Organizations
Biological Metaphors for Agile Organizations
 
GLASScon Evolving and Agile Organization: Inspiration from Biology
GLASScon Evolving and Agile Organization: Inspiration from BiologyGLASScon Evolving and Agile Organization: Inspiration from Biology
GLASScon Evolving and Agile Organization: Inspiration from Biology
 
A Partner is Good to Have, but Difficult to Be
A Partner is Good to Have, but Difficult to BeA Partner is Good to Have, but Difficult to Be
A Partner is Good to Have, but Difficult to Be
 
Keeping the Beat: Rhythm and Trust in Architecture
Keeping the Beat: Rhythm and Trust in ArchitectureKeeping the Beat: Rhythm and Trust in Architecture
Keeping the Beat: Rhythm and Trust in Architecture
 
Challenges in implementing Agile philosophies and methodologies in an SDLC wo...
Challenges in implementing Agile philosophies and methodologies in an SDLC wo...Challenges in implementing Agile philosophies and methodologies in an SDLC wo...
Challenges in implementing Agile philosophies and methodologies in an SDLC wo...
 
GLASSCon 2.5 Dev Ops Sparkler
GLASSCon 2.5 Dev Ops SparklerGLASSCon 2.5 Dev Ops Sparkler
GLASSCon 2.5 Dev Ops Sparkler
 

Recently uploaded

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

LEGO Exercise Shows How Approval Tests Validate Code

  • 1. A LEGO Exercise and an Experience Report David Kane Solution Architect and Coach General Dynamics Information Technology Twitter: @ADavidKane LinkedIn: david-kane-agile George Paci Senior DevOps Engineer MAXIMUS Federal Email:gpaci@tiac.net Agile DC October 15th, 2018 Approval Tests in Action
  • 2. 2 | https://www.agiledc.org Exercise: Round 1 • Build a person using LEGO pieces with the following criteria  Use at least 5 pieces  Use no more than 10 pieces  Have a distinct head  Have two distinct arms  Have two distinct legs  Arms should look similar to each other  Legs should look similar to each other  Legs, Arms and Head should look different • Each person builds their own figure
  • 3. 3 | https://www.agiledc.org Exercise: Round 2 • Using other LEGO bricks, write as many tests as you can to validate that you have satisfied the criteria laid out in Round 1  Use at least 5 pieces  Use no more than 10 pieces  Have a distinct head  Have two distinct arms  Have two distinct legs  Arms should look similar to each other  Legs should look similar to each other  Legs, Arms and Head should look different
  • 4. 4 | https://www.agiledc.org Exercise: Round 3 • Make a copy of your solution from Round 1 • Visually inspect your copy to confirm that it satisfied the Round 1 criteria • Compare your Round 3 test with your Round 1 solution to verify that they are equivalent
  • 6. 6 | https://www.agiledc.org Approval Tests Created By Llewelyn Falco
  • 7. 7 | https://www.agiledc.org • Write test code that interacts with your system • Capture the results as a String  Inspect the string to verify it is correct  Save it as a reference • Subsequent tests compare new results against the reference string  Match: Passes  Difference: Fails • Diff Tools highlight changes when a test fails • Inspect failures  Change the application code?  Use the new result file as the approval reference Approval Extend Unit Test Frameworks Available for many languages including: Java, .Net, PHP, Python, JavaScript, C++ Characterization Tests Test by Example
  • 8. 8 | https://www.agiledc.org Example -- Starting Approved Received
  • 9. 9 | https://www.agiledc.org Example – Accept at Approved Approved Received
  • 10. 10 | https://www.agiledc.org Example – Test Passes, No Display Needed
  • 11. 11 | https://www.agiledc.org Example – Approval Test Detects a Bug Differences Detected
  • 12. 12 | https://www.agiledc.org Example – This One is a New Feature Difference DetectedDifferences Detected
  • 13. 13 | https://www.agiledc.org Approval Test Code Example Very Little Test Code Expected Outcome in Approval File
  • 14. 14 | https://www.agiledc.org Typical Unit Test Code More Verbose Harder to Read
  • 15. 15 | https://www.agiledc.org • Tests that are easier to understand • Write tests for code that is not easily testable Approval Test Benefits
  • 16. 16 | https://www.agiledc.org • New Projects  Use approvals to externalize your expected test behavior  You can reduce your test code footprint, and improve the readability of your expected results • Legacy Projects  Look for interfaces can you access programmatically with no or minimal system changes?  Identify how you can you most easily express your systems output as a string?  Use these answers to boostrap your automated testing with approvals Approval Test Applicability
  • 17. 17 | https://www.agiledc.org • Legacy code base had limited automated testing • Introducing strong unit tests required refactoring the code • Did not want to refactor without automated tests • Approval Tests provided a path out of this conundrum Recently Used Approval Tests Bootstrap Automated Testing
  • 18. 18 | https://www.agiledc.org • We had many existing interfaces in our system that could used without application modifications that could fit into the approval framework  JSON  Excel • We don’t need pages of test code filled with “AssertEquals” statements • Our tests have become much more sensitive to application code changes • We have gone from 6% test coverage to 46% test coverage in a few months. Our key areas of focus have coverage over 75%  We have sufficient coverage that we can now refactor safely  We are now able to start writing code and tests with better isolation Approval Tests Results
  • 19. 19 | https://www.agiledc.org • Our Approval Tests lack isolation  Because many tests execute some of the same code, a single problem in shared code can cause many test to fail  Many existing interfaces had call stacks that extended into our database o Relatively slow o Meant we had to deal with database management challenges  This is not a problem of the approval framework per se, but of the fact we are using broad-based interfaces against which to execute the tests • Not suitable for Test-Driven Development (TDD) Approval Tests Weaknesses
  • 22. 22 | https://www.agiledc.org Session Feedback • How was today’s session? • Green: Great session, I am glad I came • Yellow: Meh • Red: I wished I had spent my time doing something else • Do you have any suggestions, comments, or concerns for the speakers or the organizers?

Editor's Notes

  1. 5 minutes
  2. 5 minutes Questions for discussion Were you able to test all of the properties? – Typically no. If the original was designed with testing in mind, it might be easier. (e.g. if you standardized bricks you could probably come up with attest to validate the piece limits) If you look at the tests in isolation, do they give you an understanding about what the original model looks like? Typically no. Many of the test, while clever can be obtuse. Were the tests easy to make? – Some more so than others
  3. 5 minutes Questions for discussion Are you able to validate all of the criteria? -- Typically yes. Sometimes folks have difficulty matching the pieces exactly. This can happen in practice. (e.g. code that generates a time stamp might look a little different from run to run) Do these “tests” provide mode clarify about what the target is support to be? – Yes. They look the same Were these tests easier to make – Unless someone had to hunt for weird pieces, yes this test was easier.
  4. Do these kinds of challenges echo what you see in testing software? This Lego exercise is a metaphor for testing software. The second round represents how we typically approach unit testing. The third round represents an approval tests –style approach to testing software.