際際滷

際際滷Share a Scribd company logo
Writing maintainable
Tests
Yes,writing manageable code is important!
Design Principles
S
SRP
Single
Responsibility
Principle
O
OCP
Open/Close
Principle
L
LSP
Liskovs Substitution
Principle
I
ISP
Interface
Segregation
Principle
D
DIP
Dependency
Inversion
Principle
YAGNI
You Arent Going to
need it
DRY
Dont Repeat
yourself
KISS
Keep it simple and
stupid
The Active Admin app
The recommended approach - SeleniumHQ
YAGNI
Home Page Refactored
Everything in its right place?
Breaking Page objects to
smaller page objects still
violates SRP
This is generally a huge class.
Has many reasons to change -
Violating SRP.
Yes, It DRY important. But, are
we using the right abstraction!
Use the right abstractions!
Group by intent not page(s)
Responding to change
Violates Open
close Principle
Examples
The following examples use Gauge. This blog talks about
the top 5 reasons why I use Gauge.
Keeping it simple - Loosely coupled steps
Method chaining
Less is better
Not using page objects in our tests reduced source code by 40%.
Links
- The blog
- 2 test suites with the same set of test cases with and without Page
Objects for the Active admin store web application.
Test pyramid
Is it just the numbers that matter?
- finding the root cause of a failure
- setting-up, replicating and
validating an issue
- Wondering why the Return on
Investment (ROI) tests are low
The first thing to consider is if ests in
your projects are written in the right
layer(s).
With few UI automation tests and fewer manual tests
Confidence in tests
The benefit is when a
bug is fixed and not
when a bug is found -
by Mike Wacker
Know your tests Where does it belong?
User flow tests should fail only when the
user cannot complete the flow.
Subcutaneous tests
Thank you

More Related Content

Writing Maintainable Tests