SlideShare a Scribd company logo
Microservice Test Strategies for
application based on Spring, K8s and
Istio
Ahmed Misbah
Microservice Test Pyramid
E2E
Out-of-Process
Component
Tests
Component Tests
Unit Tests
Microservice Test Pyramid
‱ As per the guide below:
https://martinfowler.com/articles/microservice-
testing/
the following tests will be implemented:
1. Unit Tests (Developers): Purpose of these tests is
to ensure that each class/method works right
independently
2. Components Tests (Developers): Purpose of
these tests is to test that all classes in the JAR
work right together independent of any external
component or service
Microservice Test Pyramid
3. Out-of-process Component Tests on Core
Microservices only (Developers): Purpose of
these tests to ensure that the microservice
works right on K8s and communicates
correctly with its DBs and other APIs
4. E2E Tests (QA): Purpose of E2E tests are to
test behavior and functionally of APIs fully
integrated
Core Microservice Component
Diagram
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC - Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Some Data store on the
cloud
Some Driver (e.g. API
composer, another
Microservice using Envoy)
Some 3rd party API
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Core Microservice Integration
Some Driver (e.g. API
composer, another
Microservice through Envoy
or OSP
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Core Microservice Unit Tests
Some Data store on the
cloud
Some 3rd party API
Core Microservice Unit Tests
Spring MVC - Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities (Mock)
Unit tests Service (Mock)
Data Store (Stub)
Unit tests
Unit tests
Repository (Mock)
Core Microservice Unit Tests
‱ Unit tests will run in Gitlab job
‱ Tests will be part of the Spring Boot application
‱ Junit 5 will be used
‱ Mockito will be used for mocking
‱ Controller tests will use @WebMvcTest annotation:
https://reflectoring.io/spring-boot-web-controller-test/
‱ Repository tests will use @DataTestJPA annotation, which
implicitly used H2 and tests ORM as well:
https://reflectoring.io/spring-boot-data-jpa-test/
‱ Liquibase will be used to create schemas at the start of
each test class
‱ Sprint @Sql annotation will be used to remove and insert
data before each test case:
https://www.javarticles.com/2016/02/spring-sql-annotation-
example.html
Some Data store on the
cloud
Some Driver (e.g. API
Composer, another
Microservice through
Envoy)
Some 3rd party API
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Core Microservice Component Tests
Core Microservice Component Tests
Spring MVC - Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Component tests
Data Store (Stub)
Web server (Stub)
Core Microservice Component Tests
‱ Component tests will run in Gitlab job
‱ Tests will be part of the Spring Boot
application
‱ Junit 5 will be used
‱ Tests will use @SpringBootTest annotation
‱ REST/SOAP APIs will be stubbed using
WireMock:
https://www.baeldung.com/introduction-to-
wiremock
Core Microservice Component Tests
‱ MySQL will be stubbed using H2
‱ Liquibase will be used to create schemas at
the start of each test class
‱ Sprint @Sql annotation will be used to remove
and insert data before each test case:
https://www.javarticles.com/2016/02/spring-
sql-annotation-example.html
Core Microservice Component Tests
‱ Any other data store will be stubbed using an
embedded version of it:
– https://www.baeldung.com/spring-embedded-
redis
– https://www.baeldung.com/spring-boot-
embedded-mongodb
‱ @TODO Need to check how we will provision
test data in each NoSQL store
Some Driver (e.g. API
composer, another
Microservice through
Envoy)
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Core Microservice Out-of-process
Component Tests
Some Data store on the
cloud
Some 3rd party API
Out-of-process Component
Tests
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service
Spring Data - Repository
JPA/Hibernate - ORM
Utilities
Core Microservice Out-of-process
Component Tests
Some Data store on the
cloud
Some 3rd party API
Core Microservice Out-of-process
Component Tests
‱ Out-of-process Component Tests will not be
part of the Spring Boot application under test
and will be in a separate project
‱ There will be one project for all core
microservice out-of-process component tests
‱ The tests will be separated by means of
Spring/Maven profiles. Tests will cover
happy/unhappy scenarios for whole core
microservice
Core Microservice Out-of-process
Component Tests
‱ Before executing the out-of-process
component tests in a gitlab job, the core
microservice will be deployed to K8s cluster
‱ Test drivers will be written using REST Assured
or Spring REST Template
‱ Liquibase will not be used to create schemas
at the start of each test class, as these scripts
will be executed in each microservice when it
starts
Core Microservice Out-of-process
Component Tests
‱ Sprint @Sql annotation will be used to remove
and insert data before each test case:
https://www.javarticles.com/2016/02/spring-
sql-annotation-example.html
@TODO Need to check how we will provision
test data in each NoSQL store
API Composers Component Diagram
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC - Controller
Spring Bean - Service Utilities
API Gateway (Ambassador)
Core Microservices
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service Utilities
API Composers Integration
API Gateway (Ambassador)
Core Microservices
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service Utilities
API Composers Unit Tests
API Composers Unit Tests
Spring MVC - Controller
Spring Bean - Service Utilities (Mock)
Unit tests Service (Mock)
Unit tests
API Gateway (Ambassador)
Core Microservices
Istio -
Envoy -
Sidecar
Proxy
K8s - Pod
JAR – Spring Boot
K8s - Service
Spring MVC -
Controller
Spring Bean - Service Utilities
API Composers Component Tests
API Composers Component Tests
Spring MVC - Controller
Spring Bean - Service Utilities
Component tests
Web server (Stub)
E2E Tests
E2E Tests
API Gateway (Ambassador)
API Composer (s)
Core Microservices
K8s
Some Data store on the
cloud
Some 3rd party API
E2E Tests
‱ E2E tests will run as a separate Robot
Framework project in the CI/CD pipeline in
Gitlab
‱ There will be one project for all E2E tests
‱ The tests will be separated by means of
profiles. Tests will cover happy/unhappy
scenarios for an endpoint or user story
AN Microservice Code Coverage
E2E (~ 10%)
Out-of-Process
Component
Tests (~ 20%)
Component Tests (~ 50%)
Unit Tests ( ~ 100%)
Source: https://learning.oreilly.com/library/view/the-clean-
coder/9780132542913/ch08.html
Microservice Test Coverage
‱ Test coverage will only be a measure for Out-of-
process component tests and E2E tests
‱ Minimum test coverage should be based upon
acceptance criteria of user story. This will include
all/most positive and negative scenarios
‱ For unit and component tests, we must take care
that code coverage can be a deceiving measure of
quality of tests. Test design techniques should be
used for designing test cases.

More Related Content

PDF
White paper mbre_en
PPTX
Spring boot
 
PPTX
Ready! Steady! SpringBoot!
PDF
Spring Framework 5.2: Core Container Revisited
PDF
SpringBoot
PPTX
Workshop Framework(J2EE/OSGi/RCP)
PDF
Getting Reactive with Spring Framework 5.0’s GA release
ODP
Springboot and camel
White paper mbre_en
Spring boot
 
Ready! Steady! SpringBoot!
Spring Framework 5.2: Core Container Revisited
SpringBoot
Workshop Framework(J2EE/OSGi/RCP)
Getting Reactive with Spring Framework 5.0’s GA release
Springboot and camel

What's hot (20)

PDF
Rediscovering Spring with Spring Boot(1)
PDF
Testing Spring Boot Applications
PDF
Spring Boot
PPTX
Docker Sydney: 5 Patterns for App Transformation with Containers
PPTX
Java springboot microservice - Accenture Technology Meetup
PPTX
Spring boot
PPTX
Spring 5
PDF
PUC SE Day 2019 - SpringBoot
PDF
Spring Boot
PPTX
Spring boot 3g
PPTX
Next stop: Spring 4
PDF
Spring - CDI Interop
PPTX
Development Process Optimization Using Docker. Based on a True Story
PPT
Springboot introduction
PDF
Introduction to Spring Framework
ODP
Developing Microservices using Spring - Beginner's Guide
PDF
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
PPTX
Introduction to spring boot
PDF
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
PDF
Spring framework 5: New Core and Reactive features
Rediscovering Spring with Spring Boot(1)
Testing Spring Boot Applications
Spring Boot
Docker Sydney: 5 Patterns for App Transformation with Containers
Java springboot microservice - Accenture Technology Meetup
Spring boot
Spring 5
PUC SE Day 2019 - SpringBoot
Spring Boot
Spring boot 3g
Next stop: Spring 4
Spring - CDI Interop
Development Process Optimization Using Docker. Based on a True Story
Springboot introduction
Introduction to Spring Framework
Developing Microservices using Spring - Beginner's Guide
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Introduction to spring boot
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Spring framework 5: New Core and Reactive features
Ad

Similar to Microservice test strategies for applications based on Spring, K8s and Istio (20)

PDF
Testing Java Microservices Using Arquillian Hoverfly Assertj Junit Selenium A...
PPTX
Integration testing for microservices with Spring Boot
PDF
Pragmatic Java Test Automation
PDF
Test Pyramid in Microservices Context
PDF
Serverless microservices: Test smarter, not harder
 
PDF
TDD for APIs in a Microservice World (extended Version) by Michael Kuehne-Sch...
PPTX
Microservices workshop
PDF
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
PDF
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
PDF
Microservice Test Strategy (@Bonn Code Meetup)
PDF
Testing Your Application On Google App Engine
PDF
Testing your application on Google App Engine
PDF
Testing with Spring: An Introduction
PPTX
GeeCon.cz - Integration Testing from the Trenches Rebooted
PPTX
Konstantinos Sidiropoulos - Testing microservices a real example
PDF
Test Strategies for Microservices with Christoph Ebeling
PPTX
Testing microservices
PDF
Testing Microservices
PPTX
GeeCON 2012 hurdle run through ejb testing
PDF
SpectoLabs Xebia TestWorks Conf October 2016
Testing Java Microservices Using Arquillian Hoverfly Assertj Junit Selenium A...
Integration testing for microservices with Spring Boot
Pragmatic Java Test Automation
Test Pyramid in Microservices Context
Serverless microservices: Test smarter, not harder
 
TDD for APIs in a Microservice World (extended Version) by Michael Kuehne-Sch...
Microservices workshop
TDD for APIs in a Microservice World (Short Version) by Michael Kuehne-Schlin...
TDD for APIs in a Microservice World (Michael Kuehne Schlinkert)
Microservice Test Strategy (@Bonn Code Meetup)
Testing Your Application On Google App Engine
Testing your application on Google App Engine
Testing with Spring: An Introduction
GeeCon.cz - Integration Testing from the Trenches Rebooted
Konstantinos Sidiropoulos - Testing microservices a real example
Test Strategies for Microservices with Christoph Ebeling
Testing microservices
Testing Microservices
GeeCON 2012 hurdle run through ejb testing
SpectoLabs Xebia TestWorks Conf October 2016
Ad

More from Ahmed Misbah (20)

PDF
6+1 Technical Tips for Tech Startups (2023 Edition)
PDF
Migrating to Microservices Patterns and Technologies (edition 2023)
PDF
Practical Microservice Architecture (edition 2022).pdf
PDF
Istio as an enabler for migrating to microservices (edition 2022)
PDF
DevOps for absolute beginners (2022 edition)
PDF
TDD Anti-patterns (2022 edition)
PPTX
Implementing FaaS on Kubernetes using Kubeless
PDF
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
PDF
Introduction to TDD
PDF
Getting Started with DevOps
PDF
DevOps for absolute beginners
PPTX
Cucumber jvm best practices v3
PPTX
Welcome to the Professional World
PPTX
More topics on Java
PPTX
Career Paths for Software Professionals
PPTX
Effective User Story Writing
PPTX
AndGen+
PPTX
DDT Testing Library for Android
PPTX
Big Data for QAs
PPTX
Software Architecture
6+1 Technical Tips for Tech Startups (2023 Edition)
Migrating to Microservices Patterns and Technologies (edition 2023)
Practical Microservice Architecture (edition 2022).pdf
Istio as an enabler for migrating to microservices (edition 2022)
DevOps for absolute beginners (2022 edition)
TDD Anti-patterns (2022 edition)
Implementing FaaS on Kubernetes using Kubeless
Istio as an Enabler for Migrating Monolithic Applications to Microservices v1.3
Introduction to TDD
Getting Started with DevOps
DevOps for absolute beginners
Cucumber jvm best practices v3
Welcome to the Professional World
More topics on Java
Career Paths for Software Professionals
Effective User Story Writing
AndGen+
DDT Testing Library for Android
Big Data for QAs
Software Architecture

Recently uploaded (20)

PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Digital Strategies for Manufacturing Companies
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
AI in Product Development-omnex systems
PDF
Nekopoi APK 2025 free lastest update
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
medical staffing services at VALiNTRY
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Digital Strategies for Manufacturing Companies
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Navsoft: AI-Powered Business Solutions & Custom Software Development
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
AI in Product Development-omnex systems
Nekopoi APK 2025 free lastest update
CHAPTER 2 - PM Management and IT Context
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
L1 - Introduction to python Backend.pptx
Understanding Forklifts - TECH EHS Solution
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Operating system designcfffgfgggggggvggggggggg
Upgrade and Innovation Strategies for SAP ERP Customers
medical staffing services at VALiNTRY
VVF-Customer-Presentation2025-Ver1.9.pptx
How to Choose the Right IT Partner for Your Business in Malaysia
Design an Analysis of Algorithms II-SECS-1021-03
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf

Microservice test strategies for applications based on Spring, K8s and Istio

  • 1. Microservice Test Strategies for application based on Spring, K8s and Istio Ahmed Misbah
  • 3. Microservice Test Pyramid ‱ As per the guide below: https://martinfowler.com/articles/microservice- testing/ the following tests will be implemented: 1. Unit Tests (Developers): Purpose of these tests is to ensure that each class/method works right independently 2. Components Tests (Developers): Purpose of these tests is to test that all classes in the JAR work right together independent of any external component or service
  • 4. Microservice Test Pyramid 3. Out-of-process Component Tests on Core Microservices only (Developers): Purpose of these tests to ensure that the microservice works right on K8s and communicates correctly with its DBs and other APIs 4. E2E Tests (QA): Purpose of E2E tests are to test behavior and functionally of APIs fully integrated
  • 5. Core Microservice Component Diagram Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities
  • 6. Some Data store on the cloud Some Driver (e.g. API composer, another Microservice using Envoy) Some 3rd party API Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities Core Microservice Integration
  • 7. Some Driver (e.g. API composer, another Microservice through Envoy or OSP Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities Core Microservice Unit Tests Some Data store on the cloud Some 3rd party API
  • 8. Core Microservice Unit Tests Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities (Mock) Unit tests Service (Mock) Data Store (Stub) Unit tests Unit tests Repository (Mock)
  • 9. Core Microservice Unit Tests ‱ Unit tests will run in Gitlab job ‱ Tests will be part of the Spring Boot application ‱ Junit 5 will be used ‱ Mockito will be used for mocking ‱ Controller tests will use @WebMvcTest annotation: https://reflectoring.io/spring-boot-web-controller-test/ ‱ Repository tests will use @DataTestJPA annotation, which implicitly used H2 and tests ORM as well: https://reflectoring.io/spring-boot-data-jpa-test/ ‱ Liquibase will be used to create schemas at the start of each test class ‱ Sprint @Sql annotation will be used to remove and insert data before each test case: https://www.javarticles.com/2016/02/spring-sql-annotation- example.html
  • 10. Some Data store on the cloud Some Driver (e.g. API Composer, another Microservice through Envoy) Some 3rd party API Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities Core Microservice Component Tests
  • 11. Core Microservice Component Tests Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities Component tests Data Store (Stub) Web server (Stub)
  • 12. Core Microservice Component Tests ‱ Component tests will run in Gitlab job ‱ Tests will be part of the Spring Boot application ‱ Junit 5 will be used ‱ Tests will use @SpringBootTest annotation ‱ REST/SOAP APIs will be stubbed using WireMock: https://www.baeldung.com/introduction-to- wiremock
  • 13. Core Microservice Component Tests ‱ MySQL will be stubbed using H2 ‱ Liquibase will be used to create schemas at the start of each test class ‱ Sprint @Sql annotation will be used to remove and insert data before each test case: https://www.javarticles.com/2016/02/spring- sql-annotation-example.html
  • 14. Core Microservice Component Tests ‱ Any other data store will be stubbed using an embedded version of it: – https://www.baeldung.com/spring-embedded- redis – https://www.baeldung.com/spring-boot- embedded-mongodb ‱ @TODO Need to check how we will provision test data in each NoSQL store
  • 15. Some Driver (e.g. API composer, another Microservice through Envoy) Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities Core Microservice Out-of-process Component Tests Some Data store on the cloud Some 3rd party API
  • 16. Out-of-process Component Tests Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Spring Data - Repository JPA/Hibernate - ORM Utilities Core Microservice Out-of-process Component Tests Some Data store on the cloud Some 3rd party API
  • 17. Core Microservice Out-of-process Component Tests ‱ Out-of-process Component Tests will not be part of the Spring Boot application under test and will be in a separate project ‱ There will be one project for all core microservice out-of-process component tests ‱ The tests will be separated by means of Spring/Maven profiles. Tests will cover happy/unhappy scenarios for whole core microservice
  • 18. Core Microservice Out-of-process Component Tests ‱ Before executing the out-of-process component tests in a gitlab job, the core microservice will be deployed to K8s cluster ‱ Test drivers will be written using REST Assured or Spring REST Template ‱ Liquibase will not be used to create schemas at the start of each test class, as these scripts will be executed in each microservice when it starts
  • 19. Core Microservice Out-of-process Component Tests ‱ Sprint @Sql annotation will be used to remove and insert data before each test case: https://www.javarticles.com/2016/02/spring- sql-annotation-example.html @TODO Need to check how we will provision test data in each NoSQL store
  • 20. API Composers Component Diagram Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Utilities
  • 21. API Gateway (Ambassador) Core Microservices Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Utilities API Composers Integration
  • 22. API Gateway (Ambassador) Core Microservices Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Utilities API Composers Unit Tests
  • 23. API Composers Unit Tests Spring MVC - Controller Spring Bean - Service Utilities (Mock) Unit tests Service (Mock) Unit tests
  • 24. API Gateway (Ambassador) Core Microservices Istio - Envoy - Sidecar Proxy K8s - Pod JAR – Spring Boot K8s - Service Spring MVC - Controller Spring Bean - Service Utilities API Composers Component Tests
  • 25. API Composers Component Tests Spring MVC - Controller Spring Bean - Service Utilities Component tests Web server (Stub)
  • 26. E2E Tests E2E Tests API Gateway (Ambassador) API Composer (s) Core Microservices K8s Some Data store on the cloud Some 3rd party API
  • 27. E2E Tests ‱ E2E tests will run as a separate Robot Framework project in the CI/CD pipeline in Gitlab ‱ There will be one project for all E2E tests ‱ The tests will be separated by means of profiles. Tests will cover happy/unhappy scenarios for an endpoint or user story
  • 28. AN Microservice Code Coverage E2E (~ 10%) Out-of-Process Component Tests (~ 20%) Component Tests (~ 50%) Unit Tests ( ~ 100%) Source: https://learning.oreilly.com/library/view/the-clean- coder/9780132542913/ch08.html
  • 29. Microservice Test Coverage ‱ Test coverage will only be a measure for Out-of- process component tests and E2E tests ‱ Minimum test coverage should be based upon acceptance criteria of user story. This will include all/most positive and negative scenarios ‱ For unit and component tests, we must take care that code coverage can be a deceiving measure of quality of tests. Test design techniques should be used for designing test cases.