Test Automation
By Tomas Riha
Tomas Riha
Delivery Engine Architect @ VGT/WirelessCar
Continuous Delivery as a Service
10 years+ Automating Everything
What is Test Automation
Automatically executed code that verifies an application in a
reliable, resilient, repeatable and fully automated way.
Reliable Test Automation
Always the same result.
Resilient Test Automation
Refactoring the Application does not break the Tests.
Repeatable Test Automation
The Test Automation can execute any number of times.
Automatically Executed Test Automation
No human interaction to prepare and start the Test Automation
Test Automation is Code
Any Automation is Code.
Test Automation is Verification
Test Automation verifies requirements or predefined behaviours.
Test Automation does not ensure that the requirements improve
the application.
What is Test Automation
Automatically executed code that verifies an application in a
reliable, resilient and repeatable way without any human
intervention.
How we used to Verify Systems
SYSTEM
Database
GUI/API
1. Do this
2. Verify GUI
3. Verify using
hook
4. Verify data
1 2
3
4
How many Test Automations go wrong
SYSTEM
Database
GUI/API
1. Do this
2. Verify GUI
3. Verify using
hook
4. Verify data
1 2
3
4
????????????????
????????????????
?????????????
Build Testable Systems
Internal
Service
GUI
Internal
Service
Internal
Service
API API API
System API
Build Testable Systems
Internal
Service
Internal
Service
Internal
Service
API API API
Service Test Automation
Internal
Service
Internal
Service
Internal
Service
API
API
API
API
Mock
API
Mock
System Integration Test Automation
Internal
Service
Internal
Service
Internal
Service
API API API
System API
GUI Test Automation
GUI
System API Mock
Test Pyramid
Service & GUI Tests
System Integration Tests
Unit Tests
Monitoring
Re-architect Legacy
SYSTEM
Database
GUI/API
Internal
Service
API
Test Automation Architecture
Internal
Service
API
API
Mock
API
Mock
DSL
Glue Code
Specification
Test Automation Implementation
API
DSL
Glue Code
Specification
Internal
Service
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
//Given glue code
Fleet fleet = Create.fleet();
Vehicle vehicle = Create.vehicle().withFleet(fleet);
for (int i = 0; i < 10; i++){
Create.trip().withDate(today).withVehicle(vehicle);
}
class Create {
public Trip trip() {
Trip trip;
//Implementation of REST call to internal service
return trip;
}
}
Setup Test Data
API
DSL
Glue Code
Specification
Internal
Service
Setup DSL
Service DSL
Teardown DSL
Generate Test Data with unique ids
on each execution through Setup
DSL and Service API.
Repeatable
API
DSL
Glue Code
Specification
Internal
Service
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
With Unique Generated Test Data any
number of tests can be executed in parallel.
Resilient
API
DSL
Glue Code
Specification
Internal
Service
Oracle
Given a vehicle with 10 trips that belongs to a fleet
When fleet manager requests trips.
Then 10 trips are returned
//Given glue code
Fleet fleet = Create.fleet();
Vehicle vehicle = Create.vehicle().withFleet(fleet);
for (int i = 0; i < 10; i++){
Create.trip().withDate(today).withVehicle(vehicle);
}
class Create {
public Trip trip() {
Trip trip;
//Implementation of REST call to internal service
return trip;
}
}
DynamoDB
Test Automation Architecture
Internal
Service
API
API
Mock
API
Mock
DSL
Glue Code
Specification
Executor
Trigger
Tools?
All Test Automation tools are bad some worse than others.
Test Automation is Code, code is best written in a IDE.
Test Suite Management
Refactor your tests often.
Optimize your Test Suites.
The Test Suite is either evolving or regressing.
Test Automation Everyone Does it or Don't do it!.
Architecture
Testability of System
Test Automation Everyone Does it or Don't do it!.
Test Architecture
Test Automation Application First Class Citizen
Test Automation Everyone Does it or Don't do it!.
Test Implementation
Is Code!
Test Automation Everyone Does it or Don't do it!.
Everyone Tests!
No more separation of duties!
The Team and the Individuals
Engineer in Test - Test Spec, Glue Code, DSL, Bug fixes, Backend Code
Engineer in Backend - Backend Code, Bug Fixes, Glue Code, DSL, Test Spec
Engineer in GUI Test - Test Spec, Glue Code, DSL, Bug fixes, GUI Code
Engineer in Frontend - GUI Code, Bug Fixes, Glue Code, DSL, Test Spec
Engineer in Infrastructure - Infrastructure Code, Bug Fixes, Glue Code, DSL, Test
Spec
Questions?
Just one more slide then please ask questions.
The Team and the Individuals
The Team delivers and maintains a high quality system that
fulfills the customer's requirements in a cost efficient and
responsible manner.
Questions?
Now please ask away!

Test Automation

Editor's Notes

  • #5 Execute 10 times 10 times same result. Environment Test Data
  • #6 Only Change to Behaviour of Application Breaks the Tests
  • #11 So how do we accomplish it?
  • #12 Manual testing First steps to Test Automaion click next
  • #13 Just translating the manual script does not work. Slow, Fragile, Data problems Build Quality in! This is not a testable system
  • #14 Build Quality in! This is not a testable system
  • #15 Build Quality in! This is not a testable system Isolate Services over Sharing Code Minimize Dependencies over Sharing Code
  • #16 Verify the services first! Lot of tests high detail.
  • #17 Few tests to ensure integration NOT detail This is lower prio then Service Tests Could even be totally omitted and replaced by Simulators and Monitoring.
  • #18 Test Gui as a Service/Componet Test with mocked APIs. Tradeoff that is done due to expensiveness in driving tests through full stack with gui
  • #19 Should actually move towards replacing integration testing with simulation and monitoring. Because monitoring is what we use in production.
  • #20 Do not strap Test Automation on a old monolith. Rearchitect it and refactor it and add Test Automation on the new parts. Make a roadmap!
  • #21 Taked about building testable systems now look at Test Architecture. DSL can speak to API Mocks Blackbox the service!
  • #22 Specification should be the Requirement verification and all requirements should be verifiable DSL can speak to API Mocks
  • #23 Test Data is Setup through test case with generated data. No touching DB. ALL goes through APIs
  • #24 We can run this test as many times as we want and run multiple tests in parallel
  • #25 We can change database engine without touching our tests Or splitting our Internal service into three as long as the API is the same.
  • #26 Test Automation is not Automation if it doesnt trigger automatically!
  • #27 Should allow for separation of Spec, Glue and DSL. Should support code completion and code assist. Should be possible to write semantic code and comments. Soap UI very bad! Cucumber not so bad, Java/JUnit actually very good option.
  • #28 REFACTOR!! A test should not have to exist. The full suite should have full coverage of our requiremnts.
  • #29 Test Automation Starts with System Architecture. Architects have to architect for test
  • #35 Only way to buid quality in is to work togehter!