SlideShare a Scribd company logo
TESTING
MICROSERVICE
ARCHITECTURE
ŁUKASZ ROSŁONEK
ŁUKASZ ROSŁONEK
# Senior Test Engineer
# TestDetective.com
MONOLITH ARCHITECTURE
ISSUES:
# application scalability
# technology stack commitment
# reversed learning curve
# development process
# single point of failure
MICROSERVICE ARCHITECTURE
PROS:
# independent development
# continuous deployment
# scalability
# technology diversity
# fault isolation
WHAT’S THE RUSH ?
HTTP REQUEST -> RESPONSE
client
db
ValidationService/NewUser
REST / JSON API
PUT/NewUser
{
name: “John”,
surname: “Snow”,
address: {
city: “Winterfell”,
land: “Seven Kingdoms”
}
}
UserService:
201 Created
{
UserId: “1”
}
WEBSERVICE ANATOMY
ORM
API
DOMAIN
SERVICE
EXTERNAL
CLIENTS
DB
TESTING STRATEGIES
# unit tests
# integration tests
# contract tests
# end-to-end tests
UNIT TESTING
ORM
API
DOMAIN
SERVICE
EXTERNAL
CLIENTS
WHAT’S THE PROBLEM ?
INTEGRATION TESTING
ORM
API
DOMAIN
SERVICE
EXTERNAL
CLIENTS
DB
WHAT’S THE PROBLEM ?
CONTRACT TESTING
END-TO-END TESTS
END-2-END TESTING
CHALLENGES
# test releases stability
# network calls issues
# external services debugging
END-2-END TESTS PATTERNS
# as few as possible
# focus on user perspective
# user perspective != GUI
# test environment as code
TOOLBOX
WHY MOCKS ?
WIREMOCK
WHY TEST CONTRACTS ?
CDT TESTING - ACCUREST
Validation
Service
/NewUser
producing stubs
API
stubs
run test
against
WHY E2E TESTS ?
E2E TEST – REST ASSURED
public void getUserData(String userId) {
given().
contentType("application/json").
when().
get("/user/" + userId).
then().
body(containsString("id")).
statusCode(200);
}
@Test
public void shouldRetrieveUserData() {
RestService service = new RestService();
service.getUserData("1");
}
Q&A?
# lukasz.roslonek@gmail.com
# twitter.com/TestDetective
# www.testdetective.com

More Related Content

PDF
Testing Microservices Architectures
ODP
Microservices Manchester: Testing Microservices: Pain or Opportunity? By Davi...
PDF
Testing Microservices
PDF
Integration Testing with Docker Containers with DockerCompose
PPTX
Testing microservice-architecture-qe
PDF
Delivery pipelines at Symphony Talent - Present and Future
PDF
Continuously serving the developer community with Continuous Integration and...
PDF
Microservices Manchester: Microservice, Microservice, Wherefor Art Thou Micro...
Testing Microservices Architectures
Microservices Manchester: Testing Microservices: Pain or Opportunity? By Davi...
Testing Microservices
Integration Testing with Docker Containers with DockerCompose
Testing microservice-architecture-qe
Delivery pipelines at Symphony Talent - Present and Future
Continuously serving the developer community with Continuous Integration and...
Microservices Manchester: Microservice, Microservice, Wherefor Art Thou Micro...

What's hot (20)

PPTX
Microservices Manchester: Concursus - Event Sourcing Evolved By Domonic Fox
PDF
End-to-End test architectures, a dead End road
PPTX
Metrics Driven DevOps - Automate Scalability and Performance Into your Pipeline
PPT
Continuous integration
PDF
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
PDF
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
POTX
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
PDF
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
PDF
KKBOX WWDC17 Performance and Testing - Hokila
PDF
HandsOn TestDriven Infrastructure As Code Development
PPTX
How to explain DevOps to your mom
PDF
Deep Dive on Continuous Integration and Continuous Delivery in Anypoint Platf...
PPTX
Continuous Testing in the Cloud
PDF
Frail & Cast Iron tools - a Postman Case Study
PPTX
Introduction to Continuous Integration with Jenkins
PDF
Continuous Delivery in the Cloud with Bitbucket Pipelines
PDF
Webinar: Continuous Deployment with MongoDB at Kitchensurfing
PPTX
Top Java Performance Problems and Metrics To Check in Your Pipeline
PPTX
Devops journey chefpopup-2016.04.26-v2
PPTX
Kubernetes your tests! automation with docker on google cloud platform
Microservices Manchester: Concursus - Event Sourcing Evolved By Domonic Fox
End-to-End test architectures, a dead End road
Metrics Driven DevOps - Automate Scalability and Performance Into your Pipeline
Continuous integration
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
KKBOX WWDC17 Performance and Testing - Hokila
HandsOn TestDriven Infrastructure As Code Development
How to explain DevOps to your mom
Deep Dive on Continuous Integration and Continuous Delivery in Anypoint Platf...
Continuous Testing in the Cloud
Frail & Cast Iron tools - a Postman Case Study
Introduction to Continuous Integration with Jenkins
Continuous Delivery in the Cloud with Bitbucket Pipelines
Webinar: Continuous Deployment with MongoDB at Kitchensurfing
Top Java Performance Problems and Metrics To Check in Your Pipeline
Devops journey chefpopup-2016.04.26-v2
Kubernetes your tests! automation with docker on google cloud platform
Ad

Similar to Testing Microservices Architecture (20)

DOC
Nitin_Krishna_Resume
PPTX
DevOps and the Future of Enterprise Security
DOC
Karthikeyan Resume
PDF
MartinVanha
DOC
JeffWalkerResume2016
PDF
Your App deserves more – The Art of App Modernization
PPTX
Testing Web Apps and APIs (1)
PPTX
Testing Web Apps and API's
DOCX
Soumya_S_Mukherjee_Resume
PDF
Stan_Wang_Resume
DOC
Sandip hazra resume
PDF
Your App Deserves More – The Art of App Modernization
PDF
Curriculum vitae of nguyen hai quy
DOC
Santhosh build and release (1)
PPTX
Bring Service Mesh To Cloud Native-apps
PPTX
MEAN stack
PDF
Best online js training institute in chandigarh and converted
PPTX
API Management and OAuth for Web, Mobile and the Cloud: Scott Morrison's Pres...
PDF
The automation journey, feedback about the road to Ansible.
PDF
JavaOne 2010 Keynote
Nitin_Krishna_Resume
DevOps and the Future of Enterprise Security
Karthikeyan Resume
MartinVanha
JeffWalkerResume2016
Your App deserves more – The Art of App Modernization
Testing Web Apps and APIs (1)
Testing Web Apps and API's
Soumya_S_Mukherjee_Resume
Stan_Wang_Resume
Sandip hazra resume
Your App Deserves More – The Art of App Modernization
Curriculum vitae of nguyen hai quy
Santhosh build and release (1)
Bring Service Mesh To Cloud Native-apps
MEAN stack
Best online js training institute in chandigarh and converted
API Management and OAuth for Web, Mobile and the Cloud: Scott Morrison's Pres...
The automation journey, feedback about the road to Ansible.
JavaOne 2010 Keynote
Ad

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
cuic standard and advanced reporting.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
sap open course for s4hana steps from ECC to s4
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
20250228 LYD VKU AI Blended-Learning.pptx
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
cuic standard and advanced reporting.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Testing Microservices Architecture

Editor's Notes

  • #4: DEVELOPMENT -- SPAGETTI
  • #5: -martin fowler, 2pizze -mbank -listingi, kupowanie -
  • #6: -dowolna konfa->mikroserwisy -nie idealne, ale najlepiej sie dostosowuja -nie tylko nowe, stare sie przepisuja -facebook
  • #7: -zagadka: synchroniczne czy asynchroniczne?
  • #8: -wysylamy post, dostajemy 201 -protokol http – 8 metod: (GET,POST,PUT,DELETE,HEAD,TRACE,OPTIONS,CONNECT) -REST to 4 glowne -kody http -co sie dzieje w naszym przykladzie? -request->dispacher servlet->kontroller->serwis->klient zewn->baza->response
  • #10: -wszyscy wiedza ze TDD dobre -kazdy build tool wspiera oraz IDE -unit testy-> zwykle tylko metody -jak inaczej?
  • #11: -pojedyncze metody -mocki do wszystkiego innego
  • #12: -pojedyncze metody ok -razem nie dzialaja
  • #13: -nowe podejscie: testy integracyjne -main, test, integration -dla naszego przykladu: (request i response, wywolanie ext client, serializacja zapis do bazy)
  • #14: -rozproszone aplikacje -> komunikacja -spodziewana konkretna odpowiedz -nasza aplikacja spodziewa sie metody, kodu i odpowiedzi -jesli zmienia na post -> wyjebka u nas
  • #15: -kontrakt -> tez go testujemy -contract driven testing -co to kontrakt -ciezko pilnowac samemu, pojawily się narzedzia
  • #16: -niby nic nowego -w mikroserwisach duzo problemow ale tez ciekawe wyzwania -niestabilne releasy -wywolania sieciowe -> sieciowe problemy -debugowanie zewnetrznych aplikacji -srodowiska integracyjne -> kasa, skalowanie -James Lewis, e2e on production -czesto nierealne, raty -testy e2e wazne, trzeba robic