SlideShare a Scribd company logo
5/13/16
1
© 2016 LogiGear Corporation. All Rights Reserved
STAREAST 2016, Track Session W3
Orlando, Florida
Wednesday, May 4th, 2016
11.30 AM – 12.30 PM
"Anti-Patterns" for
Automated Testing
Mr. Playback
Hans Buwalda
LogiGear
hans@logigear.com
@hansbuwalda
www.happytester.com
© 2016 LogiGear
Domain Language Approaches: Keywords
4 actions, each
with an action
keyword and
arguments
read from top
to bottom
fragment from a test with actions
acc nr first last
open account 123123 John Doe
acc nr amount
deposit 123123 10.11
deposit 123123 20.22
acc nr expected
check balance 123123 30.33
•  The test developer creates tests using "actions" with keywords and
arguments
•  Checks are, as much as possible, explicit (specified expected values)
•  The automation task focuses on automating the keywords, each keyword
is automated only once
•  This technique can be very scalable. A similar approach is behavior
based testing, which also works with human readable tests, but is more
verbose
5/13/16
2
© 2016 LogiGear
High Level Test Design - Test Development Plan
Objectives
Test Module 1
Test Cases
Test Module 2 Test Module N
Actions
. . .
AUTOMATION
Objectives Objectives
interaction test business test
Overview Action Based Testing
define the "chapters"
create the "chapters"
create the "words"
make the words work
Test Cases Test Cases
window control value
enter log in user name jdoe
enter log in password car guy
window control property expected
check property log in ok button enabled true
user password
log in jdoe car guy
first last brand model
enter rental Mary Renter Ford Escape
last total
check bill Renter 140.42
© 2016 LogiGear
§  Business objects and business flows
-  objects are like cars, invoices, locations, etc
-  flows are like create, fulfill, pay and close an order
§  Other tests
-  functions and features, like premium calculation or PDF output
-  administration, users, security, authorizations
-  graphics
-  technologies, protocols, ...
-  customization, extensibility
-  interoperability
-  . . .
§  Business versus interaction
-  differentiate within business objects and all other categories
-  interaction can be further differentiated into: values, UI, keyboard, etc
-  also, for every category, look at negative tests, flows, aggressive
tests, etc
Examples of considerations
5/13/16
3
© 2016 LogiGear
Example Top Level Structure
Project
create, retrieve, update, delete / deactivate ("CRUD")
copy, move
categorize, enumerate, identify
convert, serialize, export/import, ...
UI, dialogs, forms, pages
input (validation, defaulting, dependencies)
flows (primary paths, alternate paths)
keyboard shortcuts, keyboard controls, ...
. . .
<business object 1>
Lifecycles, data operations
Interaction
Functions and Features
Technologies, protocols, controls
Data (handling, quality, ETL, ...)
Security, authorization, admin
Graphics, multi-media, charts, ...
Load, performance
Interoperability
Customizing, extensibility
Business Flows
Concurrency, race conditions, ...
Business Objects
processes, transactions, end-to-end, day in the life,
combinations of flows, ...
calculations, analyses, PDF output, ...
© 2016 LogiGear
Eye on the ball, Scope
§  Always know the scope of a test module
§  The scope should be unambiguous
§  The scope determines many things:
-  what the test objectives are
-  which test cases to expect
-  what level of actions to use
-  what the checks are about and which events should
generate a warning or error (if a “lower” functionality
is wrong)
5/13/16
4
© 2016 LogiGear
Example of a Test
Step Description Expected
	
   	
   	
  
step	
  16 Open	
  http://www.bigstore.com The	
  "BIG	
  Store"	
  main	
  page	
  is	
  displayed,	
  with	
  a	
  "sign	
  in"	
  link
step	
  17 Click	
  on	
  "Sign	
  In",	
  upper	
  right	
  corner A	
  sign	
  in	
  dialog	
  shows,	
  the	
  "Sign	
  in"	
  button	
  is	
  disabled
step	
  18 Enter	
  "johnd"	
  in	
  the	
  user	
  name	
  field The	
  "Sign	
  In"	
  button	
  is	
  still	
  disabled
step	
  19 Enter	
  "bigtester"	
  in	
  the	
  password	
  field Now	
  the	
  "Sign	
  In"	
  button	
  is	
  enabled
step	
  20 Click	
  on	
  the	
  "Sign	
  in"	
  button The	
  page	
  now	
  shows	
  "Hello	
  John"	
  in	
  the	
  upper	
  right	
  corner
step	
  21 Enter	
  "acme	
  watch"	
  in	
  the	
  search	
  field The	
  "Search"	
  button	
  is	
  enabled
step	
  22 Click	
  on	
  the	
  "Search"	
  button 5	
  watches	
  of	
  Acme	
  Corporation	
  are	
  displayed
step	
  23 Double	
  click	
  on	
  "Acme	
  Super	
  Watch	
  2" The	
  details	
  page	
  of	
  the	
  Acme	
  Super	
  Watch	
  2	
  is	
  displayed
step	
  24 Verify	
  the	
  picture	
  of	
  the	
  watch The	
  picture	
  should	
  show	
  a	
  black	
  Acme	
  Super	
  Watch	
  2
step	
  25 Select	
  "red"	
  in	
  the	
  "Color"	
  dropdown	
  list The	
  picture	
  now	
  shows	
  a	
  black	
  Acme	
  Super	
  Watch	
  2
step	
  26 Type	
  2	
  in	
  the	
  "Order	
  quantity"	
  textbox The	
  price	
  in	
  the	
  right	
  shows	
  "$79.00	
  	
  +	
  Free	
  Shipping"
step	
  27 Click	
  on	
  "Add	
  to	
  cart" The	
  status	
  panel	
  shows	
  "Acme	
  Super	
  Watch	
  2"	
  added
step	
  28 Click	
  on	
  "Check	
  out" The	
  Cart	
  Check	
  Out	
  open,	
  with	
  the	
  2	
  Acme	
  Super	
  Watches
	
   	
   	
  
© 2016 LogiGear
GWT scenario
Scenario: Applicant is at Stop Test alert and chooses to Stop Test
Given User turns off Password required option for Drive Test
And User has logged in by Traffic Applicant account
And User is at the Assessments Take a Test page
And User clicks the Traffic Test link
And User clicks the Next button
And User clicks the Sheet radio button in Mode page if displayed
And User clicks the Start button
And User waits for test start
And User clicks the Stop Test button
When User clicks the Confirm Stop Test button
And User enters the correct applicant password
And User clicks the Confirm Stop Test button
Then The Test is Over should be displayed in the Message label
Then Value of the Message label should be The test is over.
And The Welcome to Traffic Testing page should be displayed
5/13/16
5
© 2016 LogiGear
What is an "anti-pattern"
§  A practice considered harmful
-  opposite of a "pattern"
§  Has an easy to remember name
§  Can be helpful to spot or describe risks
§  In the case of automated tests, the risks you usually
try to avoid are in areas like:
-  effectiveness
-  efficiency
-  readability
-  manageability
-  maintainability
-  etc
© 2016 LogiGear
Using the anti-patterns in this presentation
§  Experimental, input welcome
§  There are overlaps
-  in not-so-great test designs multiple patterns tend to apply
simultaneously
§  Input for design decisions, not absolute truths
-  "decisions have consequences", but those can be acceptable in
sometimes
-  not everything applies to all situations, not every anti-pattern
occurrence is a bad thing
-  see them more as a starting point of a discussion
§  See anti-patterns as symptoms
-  lack of an overall high level test design
-  lack of experience of the test developer
5/13/16
6
© 2016 LogiGear
"Anti-patterns" (informal)
§  Interaction Heavy – Not having many business tests
§  Lame – No depth or variety, no testing techniques used
§  Enter Enter Click Click – Test steps are too detailed
§  No Life – Missing life cycle steps of business objects
§  Clueless – No clear scope for the tests
§  Cocktail – Interaction tests mixed with business tests
§  Over-Checking – Checks not relevant for the scope
§  Sneaky Checking – Checks hidden in actions
§  Action Explosion – Many actions, hardly different
§  Mystery Actions – Cryptic actions, unclear what they do
§  Techno – Actions and tests that look like code
§  Passive Timing – Hard-coded "sleeps" for timing issues
© 2016 LogiGear
Interaction Heavy
§  Not having many business tests
§  What to look for:
-  seeing only test cases like these:
•  can I successfully create a new customer
•  can I successfully update an order
•  ...
-  seeing the test tree follow the UI organization
§  The UI is the most visible part of an application. It is not
uncommon to have a "what you see is what you test"
tendency
§  What is missing is a clear understanding and verification if
the application is fit for business
5/13/16
7
© 2016 LogiGear
Lame
§  No depth or variety, no testing techniques used
§  What to look for:
-  boredom
-  no suprises
-  no techniques used
-  not many, and trivial, bugs
§  Consider exploratory approaches, not just for
manual testing via the UI, but also for test case
design
-  in other words: make it more fun
-  involve domain experts
© 2016 LogiGear
Enter Enter Click Click
§  Test steps are too detailed
§  What to look for:
-  long sequences with only built-in low level actions like
"enter", "click", "select menu", etc
-  high sensitivity to UI changes
-  not able to understand the goal of the tests easily
§  Example:
-  an application in the oil industry
-  over 6000 test cases with a length of 2000 test lines or
more
§  Rather than trying to optimize, create a high-level
test design first ("from scratch")
5/13/16
8
© 2016 LogiGear
No Life
§  Missing life cycle steps of business objects
-  like CRUD: Create-Read-Update-Delete
§  What to look for:
-  is it clear what the business objects are?
-  do they show in the hierarchy
-  in particular are there modifications ("update") and
removal/closure ("delete") tests?
-  is there variation in such tests
§  Life-cycle tests are usually not difficult for define
§  I usually prefer to design life-cycle tests as
business tests, not as interaction tests
© 2016 LogiGear
Clueless
§  No clear scope for the tests
§  What to look for:
-  look through the test lines. Assuming you know the
domain, is it clear to you what the purpose of the test
is?
-  is the scope mixed. For example a customer is
created, and tested, and a order is placed by that
customer in the same test
§  Having clear scopes for tests (in particular test
modules) helps organize and maintain them
§  It also helps follow up
-  for example: "Credit Card Payments" has fails
5/13/16
9
© 2016 LogiGear
Cocktail
§  Interaction tests mixed with business tests
§  This is quite common
§  What to look for
-  a test is testing business rules and processes, like
calculation of a home loan premiums in various situations
-  and at the same time is doing UI checks
§  This anti-pattern is usually a symptom of other
anti-patterns (like "clueless")
© 2016 LogiGear
Over-Checking
§  Checks not relevant for the scope
§  Testers, and their management, often believe everything
a test script goes through needs to be tested
§  Automation engineers want to make sure the navigation is
still ok (consider using an "assert" action instead)
§  The result can be less clarity and harder maintenance
§  In a clear test design over-checking can quite easily be
avoided
5/13/16
10
© 2016 LogiGear
Example of a Test Module
TEST MODULE Order processing
start system
TEST CASE TC 01 Order for tablets
user password
login jdoe doedoe
window
check window exists welcome
order id cust id article price quantity
create order AB123 W3454X tablet 198.95 5
order id total
check order total AB123 994.75
. . .
© 2016 LogiGear
Sneaky Checking
§  Checks hidden in actions
§  What to look for:
-  in action definitions or scripts there are checks that are
not visible in the test module
-  it are often interaction checks, like "does this window
exist", after a click
§  Such checks may influence your statistics, and
increase maintenance sensitivity
§  If it is "just to make sure", use an "assert" action:
-  producing a warning or an error if the condition isn't met
-  in most cases this is not needed, the tool will complain
5/13/16
11
© 2016 LogiGear
Action Explosion
§  Many actions, hardly different
§  What to look for:
-  every step and variation of a step has its own action
-  many actions are used only once or twice
-  there are about as many actions as tests
§  It is the opposite of the "enter enter click click"
-  the challenge is to find a balance between not-enough-
actions and too-many-actions
§  Example:
open financials
open financials - payments tab
open financials - payments tab - approval sub tab
open financials - payments tab - approval sub tab - approved changes panel
© 2016 LogiGear
Consider using "mid-level" actions
§  "Low level": detailed interaction with the UI (or API)
-  generic, do not show any functional or business logic
-  examples: "click", "expand tree node", "select menu"
§  "High level": a business domain operation or check on the
application under test
-  hide the interaction
-  examples: "enter customer", "rent car", "check balance"
§  "Mid level": common sequences at a more detailed
application level
-  usually to wrap a form or dialog
-  for use in high level actions
-  greatly enhance maintainability
-  example: "enter address fields"
enter customer
enter address fields
enter select set . . .. . .
5/13/16
12
© 2016 LogiGear
Mystery Actions
§  Cryptic actions, unclear what they do
§  What to look for:
-  action or arguments that are not clear to those who know
the domain
-  generic actions like "check invoice"
-  are not business related or UI related
§  Unclear actions:
-  might be used a wrongly
-  might not be found, delimiting their re-use
-  hinder impact analysis and follow up
© 2016 LogiGear
Techno
§  Actions and tests that look like code
-  "preferably" C++ code
-  work well to impress people, but not for much else
§  What to look for:
-  not English or another natural language
-  all kinds of special characters
-  lack of spacing
-  in general names that are _NOts0EasY_2REad
§  Often a result of developers at the helm of the
test design
5/13/16
13
© 2016 LogiGear
§  Hard-coded "sleeps" for timing issues
§  What to look for
-  "sleep" or "wait" actions
-  sometimes hidden in other actions
-  arguments are sometimes variables, this is not much of an improvement
§  Passive timing
-  big nono, the number one archenemy of automation J
-  at best slows down your tests
-  but if not long enough make the test unstable
-  in VM's the problem is even worse than in physical machines
-  if used, the team should clearly escalate it, define it as a risk
§  Better approach: Active timing
-  wait for a measurable event
-  usually the wait is up to a, generous, maximum time
-  for UI many such waits are built into the automation tool
-  consider involving developers to help you (see my slides of my "BIG Testing" tutorial for
more suggestions)
Passive Timing
© 2016 LogiGear
Be careful in communication!
§  Avoid even the hint of attack
§  Make sure all people involved understand, and
appreciate, that anti-patterns are applied
§  In particular watch your writing, like emails and
reports
-  good fuel for "flaming"
-  avoid writing something like: these tests are "lame"
-  talk about test design
-  teamwork rules suppreme
5/13/16
14
© 2016 LogiGear
Summary
§  Automation success depends on design decisions, most of
which are test design decisions
§  Anti-patterns can help identify risks, and start discussions
§  Anti-patterns are not (meant to be) absolute rules
§  Test design and automation are team work, part of a larger
route to success

More Related Content

Viewers also liked (10)

PDF
Build a Quality Engineering and Automation Framework
Josiah Renaudin
 
PDF
IoT Integrity: A Guide to Robust Endpoint Testing
Josiah Renaudin
 
PDF
Innovations in Mobile Testing: Expanding Your Test Plan
Josiah Renaudin
 
PDF
Analyze, Diagnose, and Prevent Test Flakiness
Josiah Renaudin
 
PDF
Better Together: Group Exploratory Testing
TechWell
 
PDF
Mindmaps: Agile and Lightweight Documentation for Testing
TechWell
 
PDF
How to Build a Fully Open Source Test Automation Framework
TechWell
 
PDF
Acceptance- and Behavior-Driven Development with Cucumber: Three Case Studies
Josiah Renaudin
 
PDF
Accessibility Standards and Testing Techniques: Be Inclusive or Be Left Behind
TechWell
 
PDF
Budgeting, Estimation, Planning, and #NoEstimates: They All Make Sense for Ag...
Josiah Renaudin
 
Build a Quality Engineering and Automation Framework
Josiah Renaudin
 
IoT Integrity: A Guide to Robust Endpoint Testing
Josiah Renaudin
 
Innovations in Mobile Testing: Expanding Your Test Plan
Josiah Renaudin
 
Analyze, Diagnose, and Prevent Test Flakiness
Josiah Renaudin
 
Better Together: Group Exploratory Testing
TechWell
 
Mindmaps: Agile and Lightweight Documentation for Testing
TechWell
 
How to Build a Fully Open Source Test Automation Framework
TechWell
 
Acceptance- and Behavior-Driven Development with Cucumber: Three Case Studies
Josiah Renaudin
 
Accessibility Standards and Testing Techniques: Be Inclusive or Be Left Behind
TechWell
 
Budgeting, Estimation, Planning, and #NoEstimates: They All Make Sense for Ag...
Josiah Renaudin
 

Similar to Anti-Patterns for Automated Testing (20)

PDF
Test Design Essentials for Great Test Automation - Hans
Sauce Labs
 
PPTX
Integration Testing with Selenium
All Things Open
 
PPTX
You have Selenium... Now what?
Great Wide Open
 
PPTX
'BIG Testing' with Hans Buwalda
TEST Huddle
 
PDF
Better Test Designs to Drive Test Automation Excellence
TechWell
 
PPTX
How to get Automated Testing "Done"
TEST Huddle
 
PDF
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
PDF
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
PDF
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Ho Chi Minh City Software Testing Club
 
PPTX
Augmenting Coded UI
travisk
 
PDF
Introducing Keyword-driven Test Automation
TechWell
 
PDF
When Testers Feel Left Out in the Cold
TechWell
 
PDF
Introducing Keyword-Driven Test Automation
TechWell
 
PDF
Introducing Keyword-driven Test Automation
TechWell
 
PDF
Build the Right Regression Suite with Behavior-Driven Testing
TechWell
 
PDF
Model-Based Testing with Keywords
TechWell
 
PDF
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
PDF
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
PDF
Introducing Keyword-driven Test Automation
TechWell
 
PDF
IBM Rational Software Conference 2009: Quality Management Track Keynote
Kathy (Kat) Mandelstein
 
Test Design Essentials for Great Test Automation - Hans
Sauce Labs
 
Integration Testing with Selenium
All Things Open
 
You have Selenium... Now what?
Great Wide Open
 
'BIG Testing' with Hans Buwalda
TEST Huddle
 
Better Test Designs to Drive Test Automation Excellence
TechWell
 
How to get Automated Testing "Done"
TEST Huddle
 
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Ho Chi Minh City Software Testing Club
 
Augmenting Coded UI
travisk
 
Introducing Keyword-driven Test Automation
TechWell
 
When Testers Feel Left Out in the Cold
TechWell
 
Introducing Keyword-Driven Test Automation
TechWell
 
Introducing Keyword-driven Test Automation
TechWell
 
Build the Right Regression Suite with Behavior-Driven Testing
TechWell
 
Model-Based Testing with Keywords
TechWell
 
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
The Challenges of BIG Testing: Automation, Virtualization, Outsourcing, and More
TechWell
 
Introducing Keyword-driven Test Automation
TechWell
 
IBM Rational Software Conference 2009: Quality Management Track Keynote
Kathy (Kat) Mandelstein
 
Ad

More from Josiah Renaudin (20)

PDF
Solve Everyday IT Problems with DevOps
Josiah Renaudin
 
PDF
End-to-End Quality Approach: 14 Levels of Testing
Josiah Renaudin
 
PDF
Product Management: The Innovation Glue for the Lean Enterprise
Josiah Renaudin
 
PDF
Slay the Dragons of Agile Measurement
Josiah Renaudin
 
PDF
Blending Product Discovery and Product Delivery
Josiah Renaudin
 
PDF
Determining Business Value in Agile Development
Josiah Renaudin
 
PDF
Three Things You MUST Know to Transform into an Agile Enterprise
Josiah Renaudin
 
PDF
Internet of Things and the Wisdom of Mobile
Josiah Renaudin
 
PDF
How to Do Kick-Ass Software Development
Josiah Renaudin
 
PDF
The Power of an Agile Mindset
Josiah Renaudin
 
PDF
DevOps and the Culture of High-Performing Software Organizations
Josiah Renaudin
 
PDF
Uncover Untold Stories in Your Data: A Deep Dive on Data Profiling
Josiah Renaudin
 
PDF
Don’t Be Another Statistic! Develop a Long-Term Test Automation Strategy
Josiah Renaudin
 
PDF
Testing Lessons from the Land of Make Believe
Josiah Renaudin
 
PDF
Finding Success with Test Process Improvement
Josiah Renaudin
 
PDF
Git and GitHub for Testers
Josiah Renaudin
 
PDF
Stay Ahead of the Mobile and Web Testing Maturity Curve
Josiah Renaudin
 
PDF
The Selenium Grid: Run Multiple Automated Tests in Parallel
Josiah Renaudin
 
PDF
Testing at Startup Companies: What, When, Where, and How
Josiah Renaudin
 
PDF
Defect Metrics for Organization and Project Health
Josiah Renaudin
 
Solve Everyday IT Problems with DevOps
Josiah Renaudin
 
End-to-End Quality Approach: 14 Levels of Testing
Josiah Renaudin
 
Product Management: The Innovation Glue for the Lean Enterprise
Josiah Renaudin
 
Slay the Dragons of Agile Measurement
Josiah Renaudin
 
Blending Product Discovery and Product Delivery
Josiah Renaudin
 
Determining Business Value in Agile Development
Josiah Renaudin
 
Three Things You MUST Know to Transform into an Agile Enterprise
Josiah Renaudin
 
Internet of Things and the Wisdom of Mobile
Josiah Renaudin
 
How to Do Kick-Ass Software Development
Josiah Renaudin
 
The Power of an Agile Mindset
Josiah Renaudin
 
DevOps and the Culture of High-Performing Software Organizations
Josiah Renaudin
 
Uncover Untold Stories in Your Data: A Deep Dive on Data Profiling
Josiah Renaudin
 
Don’t Be Another Statistic! Develop a Long-Term Test Automation Strategy
Josiah Renaudin
 
Testing Lessons from the Land of Make Believe
Josiah Renaudin
 
Finding Success with Test Process Improvement
Josiah Renaudin
 
Git and GitHub for Testers
Josiah Renaudin
 
Stay Ahead of the Mobile and Web Testing Maturity Curve
Josiah Renaudin
 
The Selenium Grid: Run Multiple Automated Tests in Parallel
Josiah Renaudin
 
Testing at Startup Companies: What, When, Where, and How
Josiah Renaudin
 
Defect Metrics for Organization and Project Health
Josiah Renaudin
 
Ad

Recently uploaded (20)

PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 

Anti-Patterns for Automated Testing

  • 1. 5/13/16 1 © 2016 LogiGear Corporation. All Rights Reserved STAREAST 2016, Track Session W3 Orlando, Florida Wednesday, May 4th, 2016 11.30 AM – 12.30 PM "Anti-Patterns" for Automated Testing Mr. Playback Hans Buwalda LogiGear [email protected] @hansbuwalda www.happytester.com © 2016 LogiGear Domain Language Approaches: Keywords 4 actions, each with an action keyword and arguments read from top to bottom fragment from a test with actions acc nr first last open account 123123 John Doe acc nr amount deposit 123123 10.11 deposit 123123 20.22 acc nr expected check balance 123123 30.33 •  The test developer creates tests using "actions" with keywords and arguments •  Checks are, as much as possible, explicit (specified expected values) •  The automation task focuses on automating the keywords, each keyword is automated only once •  This technique can be very scalable. A similar approach is behavior based testing, which also works with human readable tests, but is more verbose
  • 2. 5/13/16 2 © 2016 LogiGear High Level Test Design - Test Development Plan Objectives Test Module 1 Test Cases Test Module 2 Test Module N Actions . . . AUTOMATION Objectives Objectives interaction test business test Overview Action Based Testing define the "chapters" create the "chapters" create the "words" make the words work Test Cases Test Cases window control value enter log in user name jdoe enter log in password car guy window control property expected check property log in ok button enabled true user password log in jdoe car guy first last brand model enter rental Mary Renter Ford Escape last total check bill Renter 140.42 © 2016 LogiGear §  Business objects and business flows -  objects are like cars, invoices, locations, etc -  flows are like create, fulfill, pay and close an order §  Other tests -  functions and features, like premium calculation or PDF output -  administration, users, security, authorizations -  graphics -  technologies, protocols, ... -  customization, extensibility -  interoperability -  . . . §  Business versus interaction -  differentiate within business objects and all other categories -  interaction can be further differentiated into: values, UI, keyboard, etc -  also, for every category, look at negative tests, flows, aggressive tests, etc Examples of considerations
  • 3. 5/13/16 3 © 2016 LogiGear Example Top Level Structure Project create, retrieve, update, delete / deactivate ("CRUD") copy, move categorize, enumerate, identify convert, serialize, export/import, ... UI, dialogs, forms, pages input (validation, defaulting, dependencies) flows (primary paths, alternate paths) keyboard shortcuts, keyboard controls, ... . . . <business object 1> Lifecycles, data operations Interaction Functions and Features Technologies, protocols, controls Data (handling, quality, ETL, ...) Security, authorization, admin Graphics, multi-media, charts, ... Load, performance Interoperability Customizing, extensibility Business Flows Concurrency, race conditions, ... Business Objects processes, transactions, end-to-end, day in the life, combinations of flows, ... calculations, analyses, PDF output, ... © 2016 LogiGear Eye on the ball, Scope §  Always know the scope of a test module §  The scope should be unambiguous §  The scope determines many things: -  what the test objectives are -  which test cases to expect -  what level of actions to use -  what the checks are about and which events should generate a warning or error (if a “lower” functionality is wrong)
  • 4. 5/13/16 4 © 2016 LogiGear Example of a Test Step Description Expected       step  16 Open  http://www.bigstore.com The  "BIG  Store"  main  page  is  displayed,  with  a  "sign  in"  link step  17 Click  on  "Sign  In",  upper  right  corner A  sign  in  dialog  shows,  the  "Sign  in"  button  is  disabled step  18 Enter  "johnd"  in  the  user  name  field The  "Sign  In"  button  is  still  disabled step  19 Enter  "bigtester"  in  the  password  field Now  the  "Sign  In"  button  is  enabled step  20 Click  on  the  "Sign  in"  button The  page  now  shows  "Hello  John"  in  the  upper  right  corner step  21 Enter  "acme  watch"  in  the  search  field The  "Search"  button  is  enabled step  22 Click  on  the  "Search"  button 5  watches  of  Acme  Corporation  are  displayed step  23 Double  click  on  "Acme  Super  Watch  2" The  details  page  of  the  Acme  Super  Watch  2  is  displayed step  24 Verify  the  picture  of  the  watch The  picture  should  show  a  black  Acme  Super  Watch  2 step  25 Select  "red"  in  the  "Color"  dropdown  list The  picture  now  shows  a  black  Acme  Super  Watch  2 step  26 Type  2  in  the  "Order  quantity"  textbox The  price  in  the  right  shows  "$79.00    +  Free  Shipping" step  27 Click  on  "Add  to  cart" The  status  panel  shows  "Acme  Super  Watch  2"  added step  28 Click  on  "Check  out" The  Cart  Check  Out  open,  with  the  2  Acme  Super  Watches       © 2016 LogiGear GWT scenario Scenario: Applicant is at Stop Test alert and chooses to Stop Test Given User turns off Password required option for Drive Test And User has logged in by Traffic Applicant account And User is at the Assessments Take a Test page And User clicks the Traffic Test link And User clicks the Next button And User clicks the Sheet radio button in Mode page if displayed And User clicks the Start button And User waits for test start And User clicks the Stop Test button When User clicks the Confirm Stop Test button And User enters the correct applicant password And User clicks the Confirm Stop Test button Then The Test is Over should be displayed in the Message label Then Value of the Message label should be The test is over. And The Welcome to Traffic Testing page should be displayed
  • 5. 5/13/16 5 © 2016 LogiGear What is an "anti-pattern" §  A practice considered harmful -  opposite of a "pattern" §  Has an easy to remember name §  Can be helpful to spot or describe risks §  In the case of automated tests, the risks you usually try to avoid are in areas like: -  effectiveness -  efficiency -  readability -  manageability -  maintainability -  etc © 2016 LogiGear Using the anti-patterns in this presentation §  Experimental, input welcome §  There are overlaps -  in not-so-great test designs multiple patterns tend to apply simultaneously §  Input for design decisions, not absolute truths -  "decisions have consequences", but those can be acceptable in sometimes -  not everything applies to all situations, not every anti-pattern occurrence is a bad thing -  see them more as a starting point of a discussion §  See anti-patterns as symptoms -  lack of an overall high level test design -  lack of experience of the test developer
  • 6. 5/13/16 6 © 2016 LogiGear "Anti-patterns" (informal) §  Interaction Heavy – Not having many business tests §  Lame – No depth or variety, no testing techniques used §  Enter Enter Click Click – Test steps are too detailed §  No Life – Missing life cycle steps of business objects §  Clueless – No clear scope for the tests §  Cocktail – Interaction tests mixed with business tests §  Over-Checking – Checks not relevant for the scope §  Sneaky Checking – Checks hidden in actions §  Action Explosion – Many actions, hardly different §  Mystery Actions – Cryptic actions, unclear what they do §  Techno – Actions and tests that look like code §  Passive Timing – Hard-coded "sleeps" for timing issues © 2016 LogiGear Interaction Heavy §  Not having many business tests §  What to look for: -  seeing only test cases like these: •  can I successfully create a new customer •  can I successfully update an order •  ... -  seeing the test tree follow the UI organization §  The UI is the most visible part of an application. It is not uncommon to have a "what you see is what you test" tendency §  What is missing is a clear understanding and verification if the application is fit for business
  • 7. 5/13/16 7 © 2016 LogiGear Lame §  No depth or variety, no testing techniques used §  What to look for: -  boredom -  no suprises -  no techniques used -  not many, and trivial, bugs §  Consider exploratory approaches, not just for manual testing via the UI, but also for test case design -  in other words: make it more fun -  involve domain experts © 2016 LogiGear Enter Enter Click Click §  Test steps are too detailed §  What to look for: -  long sequences with only built-in low level actions like "enter", "click", "select menu", etc -  high sensitivity to UI changes -  not able to understand the goal of the tests easily §  Example: -  an application in the oil industry -  over 6000 test cases with a length of 2000 test lines or more §  Rather than trying to optimize, create a high-level test design first ("from scratch")
  • 8. 5/13/16 8 © 2016 LogiGear No Life §  Missing life cycle steps of business objects -  like CRUD: Create-Read-Update-Delete §  What to look for: -  is it clear what the business objects are? -  do they show in the hierarchy -  in particular are there modifications ("update") and removal/closure ("delete") tests? -  is there variation in such tests §  Life-cycle tests are usually not difficult for define §  I usually prefer to design life-cycle tests as business tests, not as interaction tests © 2016 LogiGear Clueless §  No clear scope for the tests §  What to look for: -  look through the test lines. Assuming you know the domain, is it clear to you what the purpose of the test is? -  is the scope mixed. For example a customer is created, and tested, and a order is placed by that customer in the same test §  Having clear scopes for tests (in particular test modules) helps organize and maintain them §  It also helps follow up -  for example: "Credit Card Payments" has fails
  • 9. 5/13/16 9 © 2016 LogiGear Cocktail §  Interaction tests mixed with business tests §  This is quite common §  What to look for -  a test is testing business rules and processes, like calculation of a home loan premiums in various situations -  and at the same time is doing UI checks §  This anti-pattern is usually a symptom of other anti-patterns (like "clueless") © 2016 LogiGear Over-Checking §  Checks not relevant for the scope §  Testers, and their management, often believe everything a test script goes through needs to be tested §  Automation engineers want to make sure the navigation is still ok (consider using an "assert" action instead) §  The result can be less clarity and harder maintenance §  In a clear test design over-checking can quite easily be avoided
  • 10. 5/13/16 10 © 2016 LogiGear Example of a Test Module TEST MODULE Order processing start system TEST CASE TC 01 Order for tablets user password login jdoe doedoe window check window exists welcome order id cust id article price quantity create order AB123 W3454X tablet 198.95 5 order id total check order total AB123 994.75 . . . © 2016 LogiGear Sneaky Checking §  Checks hidden in actions §  What to look for: -  in action definitions or scripts there are checks that are not visible in the test module -  it are often interaction checks, like "does this window exist", after a click §  Such checks may influence your statistics, and increase maintenance sensitivity §  If it is "just to make sure", use an "assert" action: -  producing a warning or an error if the condition isn't met -  in most cases this is not needed, the tool will complain
  • 11. 5/13/16 11 © 2016 LogiGear Action Explosion §  Many actions, hardly different §  What to look for: -  every step and variation of a step has its own action -  many actions are used only once or twice -  there are about as many actions as tests §  It is the opposite of the "enter enter click click" -  the challenge is to find a balance between not-enough- actions and too-many-actions §  Example: open financials open financials - payments tab open financials - payments tab - approval sub tab open financials - payments tab - approval sub tab - approved changes panel © 2016 LogiGear Consider using "mid-level" actions §  "Low level": detailed interaction with the UI (or API) -  generic, do not show any functional or business logic -  examples: "click", "expand tree node", "select menu" §  "High level": a business domain operation or check on the application under test -  hide the interaction -  examples: "enter customer", "rent car", "check balance" §  "Mid level": common sequences at a more detailed application level -  usually to wrap a form or dialog -  for use in high level actions -  greatly enhance maintainability -  example: "enter address fields" enter customer enter address fields enter select set . . .. . .
  • 12. 5/13/16 12 © 2016 LogiGear Mystery Actions §  Cryptic actions, unclear what they do §  What to look for: -  action or arguments that are not clear to those who know the domain -  generic actions like "check invoice" -  are not business related or UI related §  Unclear actions: -  might be used a wrongly -  might not be found, delimiting their re-use -  hinder impact analysis and follow up © 2016 LogiGear Techno §  Actions and tests that look like code -  "preferably" C++ code -  work well to impress people, but not for much else §  What to look for: -  not English or another natural language -  all kinds of special characters -  lack of spacing -  in general names that are _NOts0EasY_2REad §  Often a result of developers at the helm of the test design
  • 13. 5/13/16 13 © 2016 LogiGear §  Hard-coded "sleeps" for timing issues §  What to look for -  "sleep" or "wait" actions -  sometimes hidden in other actions -  arguments are sometimes variables, this is not much of an improvement §  Passive timing -  big nono, the number one archenemy of automation J -  at best slows down your tests -  but if not long enough make the test unstable -  in VM's the problem is even worse than in physical machines -  if used, the team should clearly escalate it, define it as a risk §  Better approach: Active timing -  wait for a measurable event -  usually the wait is up to a, generous, maximum time -  for UI many such waits are built into the automation tool -  consider involving developers to help you (see my slides of my "BIG Testing" tutorial for more suggestions) Passive Timing © 2016 LogiGear Be careful in communication! §  Avoid even the hint of attack §  Make sure all people involved understand, and appreciate, that anti-patterns are applied §  In particular watch your writing, like emails and reports -  good fuel for "flaming" -  avoid writing something like: these tests are "lame" -  talk about test design -  teamwork rules suppreme
  • 14. 5/13/16 14 © 2016 LogiGear Summary §  Automation success depends on design decisions, most of which are test design decisions §  Anti-patterns can help identify risks, and start discussions §  Anti-patterns are not (meant to be) absolute rules §  Test design and automation are team work, part of a larger route to success