SlideShare a Scribd company logo
Testing Microservices-a real example
May 24
2
iLottery PLatform
● iLottery Platform built in a microservices architecture
● Java, Spring framework, Cassandra
● Kubernetes, Docker
2
3
Test Pyramid
3
● Stage 1: Automated Unit Tests
● Stage 2: Functional Component tests-
Automated tests against a service with ALL its
dependent services (Platform AND 3rd-party
mocked)
● Stage 3: Platform Integration Tests -
Automated Tests run against the platform
(without web app or admin portal) and 3rd-
party ONLY mocked
● Stage 4: System integration tests - Automated
tests of our platform with web app and admin
but 3rd-parties are mocked.
4
Unit tests
● Technology facing tests
● These are tests against Java classes.
● The boundary is the class
● No build can be done if line, branch, complexity coverage is
less than 80%
4
● Functional component tests-
Automated tests against a service
with ALL its dependent services
(Platform AND 3rd-party mocked)
● Web app, Admin Portal and
backend services are tested in
isolation
● They are triggered with every
merge to master
● If these tests fail then no version
is created, so service is not
deployed
5
Functional Component Tests
5
● Platform Integration Tests -
Automated Tests run against the
platform (without web app or
admin portal) and 3rd-party
ONLY mocked
● Tests that check the integration of
platform services
● They run every 3 hours from 8:00
till 20:00 UK time
● They run against latest stable
versions of services (i.e. services
where functional component tests
are passed)
6
Platform Integration Tests
6
● These are E2E tests
● Automated Tests run against the
platform (with webapp or admin
portal) and 3rd-party ONLY
mocked
● They run every 3 hours from 8:00
till 20:00 UK time
● They run against latest stable
versions of services (i.e. services
where functional component tests
are passed)
7
System Integration Tests
7
● These are tests that check how
the platform behaves in case of
errors in http calls
● Wiremock was used with its proxy
ability
● Failure injection of wiremock was
used
● They run against latest stable
versions of services (i.e. services
where functional component tests
are passed)
8
Reconciliation tests
8
{
"request" : {
"urlPath" : "/api/play",
"method" : "POST"
},
"response" : {
"status" : 504
}
}
9
Reconciliation tests
9
10
Tools used
● For UI tests
Geb(http://www.gebish.org/),
Spock test framework were
used
● Web app and admin
functional component tests
● System Integration Tests
10
● For API testing Spock test
framework, groovy REST
client and a custom
framework was created
● Wiremock was used for
stubbing external
dependencies
● Functional Component Tests
for BE services
● Platform Integration tests
11
Software Engineer in Test
● A developer role focusing in testability of the platform
● Implement automated tests
● Review automated tests implemented by devs
● Implement test tooling (e..g. Timeshifting, Test Support
Tools)
● Responsible for test environments (Kubernetes cluster in
AWS)
● Implement test APIs
11
12
Lessons learned
● Introduce Contract driven testing-
Spring Cloud Contract integrates
with Spock and Wiremock
● QA and SET need more
collaboration
12
● Layered test suites
parallelized testing and
decreased execution time
● Less UI tests meaned
increased stability
Thank you!

More Related Content

PPTX
Konstantinos Sidiropoulos - Testing microservices a real example
PDF
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
PPTX
Introduction to robot framework
PPT
Robot Framework for beginners and what is new at 2019
PPTX
Robot framework Gowthami Goli
PPT
Software Testing - Tool support for testing (CAST) - Mazenet Solution
PPTX
Test automation proposal
Konstantinos Sidiropoulos - Testing microservices a real example
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
Introduction to robot framework
Robot Framework for beginners and what is new at 2019
Robot framework Gowthami Goli
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Test automation proposal

What's hot (20)

KEY
Testing Flex RIAs for NJ Flex user group
PDF
Api testing
PDF
ATDD Using Robot Framework
PPTX
Test Management System (TMS) using JIRA Customization
DOC
Implementing checkpoint in qtp
PDF
Introduction to Robot Framework – Exove
PDF
Robot Framework Dos And Don'ts
PDF
Robot framework and selenium2 library
PPTX
ALM@Work - Unit testing in Visual studio 2012
PDF
Make sure your code works
PDF
Introduction to Robot Framework
PDF
Mozilla: Mozmill meets L10n
PDF
Continuous Integration with Mozmill
PDF
Ruin your life using robot framework
PDF
Robot Framework with actual robot
PDF
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
PDF
Test automation design patterns
PDF
Quality for developers
PPTX
Robot a quick automation frame work
PDF
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
Testing Flex RIAs for NJ Flex user group
Api testing
ATDD Using Robot Framework
Test Management System (TMS) using JIRA Customization
Implementing checkpoint in qtp
Introduction to Robot Framework – Exove
Robot Framework Dos And Don'ts
Robot framework and selenium2 library
ALM@Work - Unit testing in Visual studio 2012
Make sure your code works
Introduction to Robot Framework
Mozilla: Mozmill meets L10n
Continuous Integration with Mozmill
Ruin your life using robot framework
Robot Framework with actual robot
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
Test automation design patterns
Quality for developers
Robot a quick automation frame work
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
Ad

Similar to Testing microservices (20)

PDF
Wso2 test automation framework internal training
PDF
WSO2 Test Automation Framework : Approach and Adoption
PPTX
Microservice test strategies for applications based on Spring, K8s and Istio
PDF
Automation for developers
PPTX
WiKi Based Automation Testing: Fitness & DevOps
PDF
Testing Angular
PDF
Mykola Kovsh - Functional API automation with Jmeter
PDF
Fundamentals of software testing
PDF
Apidays Helsinki & North 2024 - Bridging the Gap Between Backend and Frontend...
PPTX
B4usolution performance testing
PDF
automationframework
PPTX
Unit Testing in VS2012
PDF
Testlink Test Management with Teamforge
PDF
API Testing following the Test Pyramid
PPTX
Perofrmance testing and apache jmeter
PPT
TLE2015_SPI_WATS
PDF
Functional Testing - A Detailed Guide.pdf
PPTX
Основы нагрузочного тестирования с инструментом Jmeter
PPTX
Running a Test Harness in Parallel using Jenkins
PPT
Eurostar innovation week 2 (3) (1)
Wso2 test automation framework internal training
WSO2 Test Automation Framework : Approach and Adoption
Microservice test strategies for applications based on Spring, K8s and Istio
Automation for developers
WiKi Based Automation Testing: Fitness & DevOps
Testing Angular
Mykola Kovsh - Functional API automation with Jmeter
Fundamentals of software testing
Apidays Helsinki & North 2024 - Bridging the Gap Between Backend and Frontend...
B4usolution performance testing
automationframework
Unit Testing in VS2012
Testlink Test Management with Teamforge
API Testing following the Test Pyramid
Perofrmance testing and apache jmeter
TLE2015_SPI_WATS
Functional Testing - A Detailed Guide.pdf
Основы нагрузочного тестирования с инструментом Jmeter
Running a Test Harness in Parallel using Jenkins
Eurostar innovation week 2 (3) (1)
Ad

Recently uploaded (20)

PPTX
Artificial Intelligence
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
Fundamentals of Mechanical Engineering.pptx
PPTX
communication and presentation skills 01
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PPT
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
Soil Improvement Techniques Note - Rabbi
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
Artificial Intelligence
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Fundamentals of Mechanical Engineering.pptx
communication and presentation skills 01
Automation-in-Manufacturing-Chapter-Introduction.pdf
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
86236642-Electric-Loco-Shed.pdf jfkduklg
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
Fundamentals of safety and accident prevention -final (1).pptx
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Soil Improvement Techniques Note - Rabbi
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
R24 SURVEYING LAB MANUAL for civil enggi

Testing microservices

  • 2. 2 iLottery PLatform ● iLottery Platform built in a microservices architecture ● Java, Spring framework, Cassandra ● Kubernetes, Docker 2
  • 3. 3 Test Pyramid 3 ● Stage 1: Automated Unit Tests ● Stage 2: Functional Component tests- Automated tests against a service with ALL its dependent services (Platform AND 3rd-party mocked) ● Stage 3: Platform Integration Tests - Automated Tests run against the platform (without web app or admin portal) and 3rd- party ONLY mocked ● Stage 4: System integration tests - Automated tests of our platform with web app and admin but 3rd-parties are mocked.
  • 4. 4 Unit tests ● Technology facing tests ● These are tests against Java classes. ● The boundary is the class ● No build can be done if line, branch, complexity coverage is less than 80% 4
  • 5. ● Functional component tests- Automated tests against a service with ALL its dependent services (Platform AND 3rd-party mocked) ● Web app, Admin Portal and backend services are tested in isolation ● They are triggered with every merge to master ● If these tests fail then no version is created, so service is not deployed 5 Functional Component Tests 5
  • 6. ● Platform Integration Tests - Automated Tests run against the platform (without web app or admin portal) and 3rd-party ONLY mocked ● Tests that check the integration of platform services ● They run every 3 hours from 8:00 till 20:00 UK time ● They run against latest stable versions of services (i.e. services where functional component tests are passed) 6 Platform Integration Tests 6
  • 7. ● These are E2E tests ● Automated Tests run against the platform (with webapp or admin portal) and 3rd-party ONLY mocked ● They run every 3 hours from 8:00 till 20:00 UK time ● They run against latest stable versions of services (i.e. services where functional component tests are passed) 7 System Integration Tests 7
  • 8. ● These are tests that check how the platform behaves in case of errors in http calls ● Wiremock was used with its proxy ability ● Failure injection of wiremock was used ● They run against latest stable versions of services (i.e. services where functional component tests are passed) 8 Reconciliation tests 8
  • 9. { "request" : { "urlPath" : "/api/play", "method" : "POST" }, "response" : { "status" : 504 } } 9 Reconciliation tests 9
  • 10. 10 Tools used ● For UI tests Geb(http://www.gebish.org/), Spock test framework were used ● Web app and admin functional component tests ● System Integration Tests 10 ● For API testing Spock test framework, groovy REST client and a custom framework was created ● Wiremock was used for stubbing external dependencies ● Functional Component Tests for BE services ● Platform Integration tests
  • 11. 11 Software Engineer in Test ● A developer role focusing in testability of the platform ● Implement automated tests ● Review automated tests implemented by devs ● Implement test tooling (e..g. Timeshifting, Test Support Tools) ● Responsible for test environments (Kubernetes cluster in AWS) ● Implement test APIs 11
  • 12. 12 Lessons learned ● Introduce Contract driven testing- Spring Cloud Contract integrates with Spock and Wiremock ● QA and SET need more collaboration 12 ● Layered test suites parallelized testing and decreased execution time ● Less UI tests meaned increased stability