SlideShare a Scribd company logo
Modern Testing Strategy
For Evolving Ecosystems
@hundredmondays
Why tho?
● Ability to prove system correctness
● Reasonable maintenance cost
● Low cognitive burden of writing tests
● Rapid feedback from test execution
● Ability to test business hypotheses
● Test strategy evolving with the system
Wrong idea
Wrong specification
Wrong code
unit testing
integration testing
internal service testing
black-box service testing
functional testing
production testing ????????????
$$$$$$$$$$
$
$$$$$$$
$$$$$
$$$
units of code
cohesive groups of units
core service
whole service
system of services
production
There are trade-offs
● Execution time
● Impact on release process
● Cost of maintenance
● Execution frequency
● Impact on design
● Achievable coverage
Lets zoom in
unit_3
mock
unit_1
unit_2
mock
Unit test
Interacts with a unit of code
Unit = class, function, actor, etc.
Full isolation, all dependencies mocked
No IO operations, no network, no server
test_1
Benefits
● Drive the design
● Code as documentation
● Formal proof
● Lightning-speed execution
Trade-offs
● Unit testing legacy codebase
● Brittleness
Now zoom out
Modern Testing Strategies for Evolving Ecosystems
unit_3
mock
unit_1
unit_2
Integration test
Interacts with system of few units
Testing cohesive units, mock external units
No IO operations, no network, no server
Testing interactions between units
test_1
The Problem
How to decide which units to cover with integration test?
Unit Test
Integration Test
Good candidates for integration test?
● units from the same package
● units share state between each other
● units lifecycles are coupled
● units experience temporal coupling (order of calls matter)
● units look like one unit from the outside
● integration test does not require much mocking
Benefits
● Avoid ‘Zero integration tests’ fail
● Code as documentation
● Formal proof
Trade-offs
● Should we test behavior or state
● Defining cohesive units is hard
● Where to draw a boundary?
● DB? Filesystem? Concurrency?
● Medium maintenance cost
Mutation test
unit_1test_1
unit_1test_1
unit_1test_1
inject defect
inject defect
passes
fails
passes
?
bad
good
Benefits
● assures quality of tests
● expresses REAL coverage
Trade-offs
● language specific tooling
● adds execution time
Property based test
unit_1test_1
Regular Unit test Property Based Test
pre-defined
input
unit_1test_1
auto-generated
input
.
.
.
repeat N times
Benefits
● generalized and randomized input
● discovering edge cases
● improved coverage
● can execute hundreds of tests with
one definition
Trade-offs
● language specific tooling
● adds execution time
Static analysis
code
base
analyzerKnown
Violations
Benefits
● reduces bugs
● better code design
● detects security issues
● helps assure standards
Trade-offs
● hard to cover legacy systems
● adds execution time
Zooming out even more
Service
● A graph of code units and their interactions forms a service
● A service is one deployment entity
● The particular arrangement of units in a service is its architecture
● An architecture should be chosen that guarantees testability
Hexagonal architecture
● Core domain does not refer to tools, frameworks and external services
● All external dependencies in core domain are abstracted to ports
● All external dependencies injected as adapters
● Alternative names: Onion Architecture, Ports and Adapters
u2u3
Core Domain
Ports & Adapters
External Service
Client
Message Queue
Database
p1
a1
u1
a2 a4
p2 p4
a3
p3
u2u3
Core Domainp1
u1
p2 p4
p3
Internal service test
in-mem service stub
in-mem queue
in-mem repository
u2u3
Core Domain
Ports & Adapters
a1
u1
a2 a4
svc_test_1
a3
p1
p2 p4
p3
Benefits
● relatively fast execution
● no IO operations, no network
● good isolation - parallel execution
● for monolithic service this is a
functional test
Trade-offs
● runtime impacted by tests
● architecture constraints
● language-specific setup
● does not test production adapter
● cost of maintaining stubs
Black-box service test
external service stub
Message queue
Database
u2u3
Core Domain
Ports & Adapters
a1
u1
a2 a4
svc_test_1
a3
Benefits
● language agnostic
● service works like in production
Trade-offs
● architecture constraints
● cost of maintaining stubs
● test harness needs to assure
isolation
● orchestration of deployment (not a
single process anymore)
● resource consuming
Keep zooming out
svc1
svc3
ext1
ext3
ext2svc2
System
System
● A system consists of multiple services communicating with each other
● Each service delivers one or more capabilities (business/technology)
● Boundary services are the ones talking to external services and clients
● It should be possible to replace services with stubs for testing
● Services expose their capabilities following a Contract
Contract
● Expectations of the service defined by the client
● Each client can have different contract with the same service
● Constraints around schema and behavior
● If well expressed, it helps decoupling testing of client and service
● The service can be stubbed based on contract
● The service can be tested based on contract
ext1contract 1
contract 2
contract 3
svc1
svc1
svc2
ext2contract 4svc3
ext3contract 5svc3
svc3
svc3
Contract test
Benefits
● specification of entire system
● teams can work independently
● assuring compatibility
● consumer driven contracts
Trade-offs
● constraints on process
● maintenance cost
● needs proper tooling
svc1
svc3
stub
stub
stubsvc2
functest_1 functest_2
Functional test
Benefits
● Tests the system as a whole
● Validates end-user interaction
Trade-offs
● High maintenance
● Resource consumption
● How to assure proper state
● Long execution time
● Hard to measure coverage
● Brittleness
● How to spin 20 services up
if the system has poorly defined boundaries
or complex operation modes
it is hard to have meaningful tests of isolated services
Exploratory test
system
record
explore
functest_1
load
replay
interceptor
Benefits
● Discovering subtle bugs
● Testing user experience
● Source of relevant functional tests
Trade-offs
● Manual
● Record-replay is difficult
● Need advanced tooling
● Need experienced test engineers
Testing in production
● It is possible to perform non-invasive tests on production environment
● A/B testing: exposing different versions of the capability
● Canary release: exposing change to a limited group of early adopters
● Smoke tests: automated testing of few critical path scenarios
Production rollout slider
dark launch
canary release
A/B testing
sunsetting
v2 in production, but no traffic directs to it
only beta testers and internal employees can access v2
pre-defined populations access different versions
cut-over
only legacy clients can access v1
new clients only access v2
all clients access v2
Smoke Testing (Canary)
v_B
v_A
router
Benefits
● reduces release risk
● helps achieve continuous delivery
● can be fully automated
Trade-offs
● requires proper infrastructure
● requires feature flags system
● needs to be built into the system
A/B Testing
version A
Client
version B
Benefits
● validates business hypothesis
Trade-offs
● requires proper infrastructure
● requires feature flags system
● needs to be built into the system
Behavior Driven Development
a.k.a.
Acceptance Test Driven Development
Behavior Driven Development: Before
Set up logged in user, who never
applied for Card and has credit score
below 680.
When that user applies for Card, their
application is accepted.
T
R
A
N
S
L
A
T
I
O
N
Behavior Driven Development: After
GIVEN the user is logged in
AND the user never applied for Card
AND the user has credit score > 680
WHEN the user applies for Card
THEN the application is accepted
T
R
A
N
S
L
A
T
I
O
N
Benefits
● drives the design
● specification is testable
● business understands tests
● highly reusable test code
● living documentation
● facilitates collaboration
Trade-offs
● requires expertise
● takes time and skills to set up
Category: Performance
Microbenchmarking
unittest
warm up
run tests
.
.
.
validate results
Benefits
● determines performance of small
units of code
● drives design of highly performant
architectures
Trade-offs
● long execution times if the test
suite is large
● requires understanding of the
runtime in order to set up correctly
Load test
load
generator
2
system
under test
load
generator
1
load
generator
3
orchestrator
observations
Benefits
● can simulate production traffic
● can validate performance
requirements
Trade-offs
● expensive set up
● long execution time
Stress test
load
generator
2
system
under test
load
generator
1
load
generator
3
orchestrator
observations
Benefits
● identifies breaking point of the
system
Trade-offs
● resource intensive
● expensive setup
Soak (Endurance) test
load
generator
2
system
under test
load
generator
1
load
generator
3
orchestrator
observations
Benefits
● validates stability of the system
● detects resource leaks
● detects difficult bugs
Trade-offs
● very long execution time
Chaos test
chaos
tester
observe
Benefits
● proves system resiliency
Trade-offs
● expensive set up
● requires well designed system
Category: Security
Vulnerability Scanning
scanning
engine
Known
Vulnerabilities
system
under test
Benefits
● ensuring standards are met
● automation
● good coverage
● detects missing patches
● detects common vulnerabilities
(e.g. Heartbleed, Shellshock)
Trade-offs
● no tests beyond standards
● execution time
● difficult setup, especially in
distributed architectures like
microservices
Penetration Testing
system
under test
skilled security
engineer
Benefits
● unique vulnerabilities detection
● non standard testing
● discovering true impact of
vulnerabilities
Trade-offs
● lots of manual exploration
● no automation
● expert knowledge required
● unclear coverage
So now you...
● Know types of software testing
● Can decide which tests you need
● Understand and accept trade-offs
but there is a lot more to learn
Questions?

More Related Content

PPT
Automation testing by Durgasoft in Hyderabad
DOC
NAGESH B KALAL
DOC
Meenakshi Pal_16
PPSX
Test Bench Development
PDF
One integrated platform for all activities,from engineering to production
PPT
Test Driven Development
PDF
AdaCore Paris Tech Day 2016: Elie Richa - Integrated Unit Testing for a Trust...
PPTX
Build it, Test it, Ship it: Continuous Delivery at Turner Broadcasting System...
Automation testing by Durgasoft in Hyderabad
NAGESH B KALAL
Meenakshi Pal_16
Test Bench Development
One integrated platform for all activities,from engineering to production
Test Driven Development
AdaCore Paris Tech Day 2016: Elie Richa - Integrated Unit Testing for a Trust...
Build it, Test it, Ship it: Continuous Delivery at Turner Broadcasting System...

What's hot (20)

PDF
Architecting for the cloud storage build test
DOC
PDF
Software testing: an introduction - 2017
PDF
Manual testing
PPTX
Database Unit Testing Made Easy with VSTS
PPTX
Regression Testing with Symfony
DOCX
Qtp basics
PPT
Software Engineering (Testing techniques)
ODP
Android Test Driven Development
PPTX
Practical unit testing in c & c++
PDF
A New Generation Software Test Automation Framework – CIVIM
PDF
S emb t10-development
PPTX
Cs 704 d set2
PPTX
Object oriented testing
PDF
Design for Testability
PPTX
Performance Testing in Continous Delivery
PDF
Asish Gouda's Manual Testing Course of study
PDF
Manual testing by reddy
PDF
7 stages of unit testing
PDF
UNH-IOL NVMe Plugfest #12 Webinar
Architecting for the cloud storage build test
Software testing: an introduction - 2017
Manual testing
Database Unit Testing Made Easy with VSTS
Regression Testing with Symfony
Qtp basics
Software Engineering (Testing techniques)
Android Test Driven Development
Practical unit testing in c & c++
A New Generation Software Test Automation Framework – CIVIM
S emb t10-development
Cs 704 d set2
Object oriented testing
Design for Testability
Performance Testing in Continous Delivery
Asish Gouda's Manual Testing Course of study
Manual testing by reddy
7 stages of unit testing
UNH-IOL NVMe Plugfest #12 Webinar
Ad

Similar to Modern Testing Strategies for Evolving Ecosystems (20)

PPTX
Integration Testing as Validation and Monitoring
PDF
Automation for developers
PDF
Quality for developers
PDF
Quality Loopback
PDF
Continuous Performance Testing
PPTX
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
PPTX
Technical Practices for Agile Engineering - PNSQC 2019
PDF
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
PDF
WSO2 Test Automation Framework : Approach and Adoption
PDF
Wso2 test automation framework internal training
PDF
Performance testing with jmeter
PPTX
Semantic Validation: Enforcing Kafka Data Quality Through Schema-Driven Verif...
ODP
Performance Test Automation With Gatling
ODP
Gatling
PPTX
Scriptless Automation Testing: A Unique Framework To Accelerate Delivery
PDF
Testing Node.js.pdf
PDF
Continuous Performance Testing
PDF
MuleSoft Surat Virtual Meetup#6 - MuleSoft API Led Connectivity, SEDA and MUn...
PDF
Expedia 3x3 presentation
PDF
Introduction to K6
Integration Testing as Validation and Monitoring
Automation for developers
Quality for developers
Quality Loopback
Continuous Performance Testing
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
Technical Practices for Agile Engineering - PNSQC 2019
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
WSO2 Test Automation Framework : Approach and Adoption
Wso2 test automation framework internal training
Performance testing with jmeter
Semantic Validation: Enforcing Kafka Data Quality Through Schema-Driven Verif...
Performance Test Automation With Gatling
Gatling
Scriptless Automation Testing: A Unique Framework To Accelerate Delivery
Testing Node.js.pdf
Continuous Performance Testing
MuleSoft Surat Virtual Meetup#6 - MuleSoft API Led Connectivity, SEDA and MUn...
Expedia 3x3 presentation
Introduction to K6
Ad

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administraation Chapter 3
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
L1 - Introduction to python Backend.pptx
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
top salesforce developer skills in 2025.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Reimagine Home Health with the Power of Agentic AI​
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Digital Strategies for Manufacturing Companies
System and Network Administraation Chapter 3
Upgrade and Innovation Strategies for SAP ERP Customers
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Design an Analysis of Algorithms II-SECS-1021-03
How Creative Agencies Leverage Project Management Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms I-SECS-1021-03
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Nekopoi APK 2025 free lastest update
How to Migrate SBCGlobal Email to Yahoo Easily
Softaken Excel to vCard Converter Software.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
L1 - Introduction to python Backend.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
top salesforce developer skills in 2025.pdf

Modern Testing Strategies for Evolving Ecosystems

Editor's Notes

  • #40: notice the parallel to integration tests