SlideShare a Scribd company logo
WRITING MAINTAINABLE
TEST AUTOMATION
AVOIDING COMMON AUTOMATION PITFALLS
IS TEST AUTOMATION CODE REAL CODE?
SHOULD AUTOMATION CODE BE WRITTEN FOLLOWING THE SAME CONVENTIONS
AS PRODUCTION DEVELOPERS WRITING PRODUCTION CODE?
CERTAINLY NOT?
DOES THAT MEAN WE SHOULD IGNORE
ALL CLEAN CODING PRACTICES?
OF COURSE NOT
WHY SHOULD WE BOTHER?
BUT REFACTORING HAS A COST, TOO
THE HAPPY MEDIUM
• NO NEED TO GET INTO DEEP, TECHNICAL, PROGRAMMING CONCEPTS
• ALSO WE DO NOT WANT TO END UP WITH A PROJECT THAT COSTS MORE TO
MAINTAIN THAN IT IS WORTH TO EXECUTE
• TESTERS CAN START WITH SOME SMALL PRACTICES THAT WORK TOWARD
CLEAN, MAINTAINABLE, CODE
MAKE CODE HUMAN READABLE
• CODE IS READ BY HUMANS, NOT
COMPUTERS
• CODE SHOULD CONVEY INTENT
• NAMES SHOULD BE MEANINGFUL
• NAMES SHOULD NOT BE ABBREVIATED
HOW COULD WE MODIFY THIS?
MAYBE LIKE THIS?
DRY: DON’T REPEAT YOURSELF
• IF YOU FIND THAT YOU DO IT MORE THAN ONCE, PULL IT OUT INTO A SEPARATE
METHOD
• IF YOU FIND THAT YOU ARE COPYING AND PASTING CODE, CONSIDER WHETHER
YOU ARE REPEATING YOURSELF
WHAT HAPPENS THE NEXT TIME WE WANT TO
OPEN THAT EXCEL SPREADSHEET?
WHAT ABOUT WHEN ANOTHER USER
NEEDS TO PUT THEIR OWN PATH IN?
WHAT ABOUT WHEN WE NEED TO INSERT
A SHEET AS SHEET 1 IN THESE EXCEL
FILES?
EVEN BETTER …
LET’S START THERE
• NAME ALL VALUES WITH MEANINGFUL, RELEVANT, HUMAN-READABLE NAMES
• DON’T REPEAT YOURSELF
FOR FURTHER READING
• WRITING MAINTAINABLE AUTOMATED TESTS, BY DALE EMERY
FOR EVEN FURTHER READING

More Related Content

Similar to Writing Maintainable Test Automation

Software Craftsmanship @ Ntnu
Software Craftsmanship @ NtnuSoftware Craftsmanship @ Ntnu
Software Craftsmanship @ Ntnu
goeran
 
Adopting Agile
Adopting AgileAdopting Agile
Adopting Agile
Coverity
 
Refactoring Big Design Smells : Presented by Sanjay Kumar
Refactoring Big Design Smells : Presented by Sanjay KumarRefactoring Big Design Smells : Presented by Sanjay Kumar
Refactoring Big Design Smells : Presented by Sanjay Kumar
oGuild .
 
Clean and Green Code
Clean and Green CodeClean and Green Code
Clean and Green Code
Lalatendu Rath
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Jason Tice
 
The perfect PR
The perfect PR  The perfect PR
The perfect PR
Patricia Gao
 
Why Is Manufacturing Difficult?
Why Is Manufacturing Difficult? Why Is Manufacturing Difficult?
Why Is Manufacturing Difficult?
Beth Cosimi Macdonald
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with Laravel
Tyler Johnston
 
Removing-the-cost-coding-errors-in-building-materials
 Removing-the-cost-coding-errors-in-building-materials Removing-the-cost-coding-errors-in-building-materials
Removing-the-cost-coding-errors-in-building-materials
Benjamin Kyalo
 
Agile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce ApproachAgile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce Approach
Ampersand
 
Code with Honor – on the importance and beauty of software programming - RMOU...
Code with Honor – on the importance and beauty of software programming - RMOU...Code with Honor – on the importance and beauty of software programming - RMOU...
Code with Honor – on the importance and beauty of software programming - RMOU...
Lucas Jellema
 
To test or not to test? this is the prblem
To test or not to test? this is the prblemTo test or not to test? this is the prblem
To test or not to test? this is the prblem
Matteo Papadopoulos
 
Test Driven Development by Sameer Arora
Test Driven Development by Sameer AroraTest Driven Development by Sameer Arora
Test Driven Development by Sameer Arora
Xebia IT Architects
 
Going Independent - making it as a freelance web professional
Going Independent - making it as a freelance web professionalGoing Independent - making it as a freelance web professional
Going Independent - making it as a freelance web professional
Michael Kimsal
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
Mahesh Salaria
 
How to successfully grow a code review culture
How to successfully grow a code review cultureHow to successfully grow a code review culture
How to successfully grow a code review culture
Nina Zakharenko
 
Custom built software and blts are not the same
Custom built software and blts are not the sameCustom built software and blts are not the same
Custom built software and blts are not the same
Reda Hmeid MBCS
 
Shift Up
Shift Up Shift Up
Shift Up
Eggplant
 
Agile testingandautomation
Agile testingandautomationAgile testingandautomation
Agile testingandautomation
jeisner
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucks
Peter Gfader
 

Similar to Writing Maintainable Test Automation (20)

Software Craftsmanship @ Ntnu
Software Craftsmanship @ NtnuSoftware Craftsmanship @ Ntnu
Software Craftsmanship @ Ntnu
 
Adopting Agile
Adopting AgileAdopting Agile
Adopting Agile
 
Refactoring Big Design Smells : Presented by Sanjay Kumar
Refactoring Big Design Smells : Presented by Sanjay KumarRefactoring Big Design Smells : Presented by Sanjay Kumar
Refactoring Big Design Smells : Presented by Sanjay Kumar
 
Clean and Green Code
Clean and Green CodeClean and Green Code
Clean and Green Code
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 
The perfect PR
The perfect PR  The perfect PR
The perfect PR
 
Why Is Manufacturing Difficult?
Why Is Manufacturing Difficult? Why Is Manufacturing Difficult?
Why Is Manufacturing Difficult?
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with Laravel
 
Removing-the-cost-coding-errors-in-building-materials
 Removing-the-cost-coding-errors-in-building-materials Removing-the-cost-coding-errors-in-building-materials
Removing-the-cost-coding-errors-in-building-materials
 
Agile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce ApproachAgile & Test Driven Development: The Ampersand Commerce Approach
Agile & Test Driven Development: The Ampersand Commerce Approach
 
Code with Honor – on the importance and beauty of software programming - RMOU...
Code with Honor – on the importance and beauty of software programming - RMOU...Code with Honor – on the importance and beauty of software programming - RMOU...
Code with Honor – on the importance and beauty of software programming - RMOU...
 
To test or not to test? this is the prblem
To test or not to test? this is the prblemTo test or not to test? this is the prblem
To test or not to test? this is the prblem
 
Test Driven Development by Sameer Arora
Test Driven Development by Sameer AroraTest Driven Development by Sameer Arora
Test Driven Development by Sameer Arora
 
Going Independent - making it as a freelance web professional
Going Independent - making it as a freelance web professionalGoing Independent - making it as a freelance web professional
Going Independent - making it as a freelance web professional
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
How to successfully grow a code review culture
How to successfully grow a code review cultureHow to successfully grow a code review culture
How to successfully grow a code review culture
 
Custom built software and blts are not the same
Custom built software and blts are not the sameCustom built software and blts are not the same
Custom built software and blts are not the same
 
Shift Up
Shift Up Shift Up
Shift Up
 
Agile testingandautomation
Agile testingandautomationAgile testingandautomation
Agile testingandautomation
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucks
 

More from Dawn Code

Executable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and SeleniumExecutable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and Selenium
Dawn Code
 
Executable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and SeleniumExecutable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and Selenium
Dawn Code
 
A Sampling of Tools
A Sampling of ToolsA Sampling of Tools
A Sampling of Tools
Dawn Code
 
Testing in the Wild
Testing in the WildTesting in the Wild
Testing in the Wild
Dawn Code
 
Fitting Organizational Structure
Fitting Organizational StructureFitting Organizational Structure
Fitting Organizational Structure
Dawn Code
 
Pair development
Pair developmentPair development
Pair development
Dawn Code
 
Remote Dev/Test Pairing
Remote Dev/Test PairingRemote Dev/Test Pairing
Remote Dev/Test Pairing
Dawn Code
 
Crowdsource Your Career
Crowdsource Your CareerCrowdsource Your Career
Crowdsource Your Career
Dawn Code
 
How Low Can Your Tests Go
How Low Can Your Tests GoHow Low Can Your Tests Go
How Low Can Your Tests Go
Dawn Code
 
Exploratory testing part 2
Exploratory testing part 2Exploratory testing part 2
Exploratory testing part 2
Dawn Code
 
Exploratory testing part 1
Exploratory testing part 1Exploratory testing part 1
Exploratory testing part 1
Dawn Code
 
Exploratory testing part 3
Exploratory testing part 3Exploratory testing part 3
Exploratory testing part 3
Dawn Code
 
Agile and Exploratory Testing Jeopardy
Agile and Exploratory Testing JeopardyAgile and Exploratory Testing Jeopardy
Agile and Exploratory Testing Jeopardy
Dawn Code
 
Pair Development from the Trenches
Pair Development from the TrenchesPair Development from the Trenches
Pair Development from the Trenches
Dawn Code
 
Testing Legacy Apps Mindmap
Testing Legacy Apps MindmapTesting Legacy Apps Mindmap
Testing Legacy Apps Mindmap
Dawn Code
 
Testing Legacy Apps
Testing Legacy AppsTesting Legacy Apps
Testing Legacy Apps
Dawn Code
 

More from Dawn Code (16)

Executable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and SeleniumExecutable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and Selenium
 
Executable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and SeleniumExecutable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and Selenium
 
A Sampling of Tools
A Sampling of ToolsA Sampling of Tools
A Sampling of Tools
 
Testing in the Wild
Testing in the WildTesting in the Wild
Testing in the Wild
 
Fitting Organizational Structure
Fitting Organizational StructureFitting Organizational Structure
Fitting Organizational Structure
 
Pair development
Pair developmentPair development
Pair development
 
Remote Dev/Test Pairing
Remote Dev/Test PairingRemote Dev/Test Pairing
Remote Dev/Test Pairing
 
Crowdsource Your Career
Crowdsource Your CareerCrowdsource Your Career
Crowdsource Your Career
 
How Low Can Your Tests Go
How Low Can Your Tests GoHow Low Can Your Tests Go
How Low Can Your Tests Go
 
Exploratory testing part 2
Exploratory testing part 2Exploratory testing part 2
Exploratory testing part 2
 
Exploratory testing part 1
Exploratory testing part 1Exploratory testing part 1
Exploratory testing part 1
 
Exploratory testing part 3
Exploratory testing part 3Exploratory testing part 3
Exploratory testing part 3
 
Agile and Exploratory Testing Jeopardy
Agile and Exploratory Testing JeopardyAgile and Exploratory Testing Jeopardy
Agile and Exploratory Testing Jeopardy
 
Pair Development from the Trenches
Pair Development from the TrenchesPair Development from the Trenches
Pair Development from the Trenches
 
Testing Legacy Apps Mindmap
Testing Legacy Apps MindmapTesting Legacy Apps Mindmap
Testing Legacy Apps Mindmap
 
Testing Legacy Apps
Testing Legacy AppsTesting Legacy Apps
Testing Legacy Apps
 

Recently uploaded

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 

Recently uploaded (20)

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 

Writing Maintainable Test Automation