WeAreDevelopers LIVE • Dec 15, 2023

Three-and-a-half Ways of Testing your Repositories

Daniel Raniz Raneland

Directly mocking database clients creates brittle tests that mask crucial API errors. Discover how to use ephemeral containers and HTTP stubs to achieve true environmental parity.

Pause
Mute Enter Fullscreen
#1 about 2 min

Speaker introduction and software engineering background

A brief overview of the speaker's software engineering journey and consulting experience.

#2 about 3 min

Role of repositories in domain-driven design architectures

Defining bounded contexts and placing the repository pattern within a multilayered software architecture.

#3 about 3 min

Structuring repository tests using behavior-driven software syntax

Applying test-driven development and behavior-driven syntax to test repository interactions with external APIs.

#4 about 7 min

Implementing backend client mocks for repository tests

Replacing an external API dependency with a dynamic mock object to verify expected interactions.

#5 about 4 min

Advantages and drawbacks of mocking backend clients

How mocking provides fast test execution but increases complexity and hides integration errors.

#6 about 6 min

Mocking backend services for REST API integration

Intercepting client network calls locally to validate database responses without external connections.

#7 about 3 min

Evaluating the strategy of mocking backend services

How service mocking surfaces real client edge cases while increasing startup time and test verbosity.

#8 about 4 min

Challenges of mocking relational database client libraries

The brittleness of mocking sequential database cursors and exact parameterized SQL queries.

#9 about 3 min

Executing test queries against true database replications

Connecting tests to a persistent development database to avoid writing cumbersome parameter mocks.

#10 about 4 min

Evaluating the drawbacks of managing shared test databases

Analyzing how shared database instances mimic production environments but introduce unreliable cleanup workflows.

#11 about 5 min

Deploying temporary test containers for database operations

Bootstrapping an ephemeral database runtime to ensure isolated query testing without cleanup failures.

#12 about 1 min

Evaluating test isolation using temporary container services

Why local container setups require runtime dependencies and slightly impact unit test duration.

#13 about 2 min

Decoupling tests via implementation agnostic roundtrip testing

Verifying database insertions primarily through data retrieval queries to avoid relying on explicit table structures.

#14 about 5 min

Summary of repository testing strategies and trade-offs

Reviewing core differences between mocks, actual database environments, and ephemeral container instances.

#15 about 4 min

Exploring best practices for selecting testing mocking frameworks

Evaluating external mock environments and handling licensed database interactions for efficient build pipelines.

#16 about 3 min

Balancing isolated unit and integration tests for repositories

Employing unit tests for individual functions and integration endpoints for complete structural verification.

#17 about 3 min

Maintaining repository tests in automated deployment pipelines

Handling database migrations and container cleanup loops effectively inside continuous integration workflows.

#18 about 6 min

Managing backward compatibility and automated database migrations

Utilizing migration frameworks alongside local tests to enforce snapshot consistencies across repository versions.

Matching moments

1:47 min

Core architectural assumptions for expressive and scalable testing

Leszek Włodarski Leszek Włodarski · WWC Europe 2026

1:54 min

Validating database interactions in local integration tests

Raphael Manke Raphael Manke · WWC 2023

2:18 min

Reviewing real-world configurations and handling untested repositories

Susanne Bach Ladefoged Hou Susanne Bach Ladefoged Hou · WWC Europe 2026

6:31 min

Audience Q&A on CDK implementation and automated testing

Alexander Bubeck · WWC 2023

1:31 min

Defining software stacks and robust execution testing mechanisms

Luka Samaržija +1 · LIVE

2:24 min

Mocking external dependencies in unit testing layers

Bartosz Pietrucha · WWC 2022

Upcoming sessions on this topic

Open session

World Congress 2026 North America

Testing React Backends Like a Pro: Mocking Databases with SQLite

David Morris

Solution Architect

David Morris
Open session

World Congress 2026 North America

One Repo, One Strategy: Scalable Full-Stack Testing in a Monorepo World

Bartosz Leczycki, Paweł Matynia

Bartosz Leczycki
Paweł Matynia
Open session

World Congress 2026 North America

Reinventing Testing Practices in the AI Era

Eric Deandrea

Java Champion & Senior Principal Software Engineer, IBM

Eric Deandrea
Open session

World Congress 2026 North America

Boring Failover: Predictable Region Recovery Across 5,000 Microservices

Garvit Kataria, Sahil Sabharwal

Garvit Kataria
Sahil Sabharwal
Open session

World Congress 2026 North America

Agents Can't Iterate Against Tests That Lie

Rocky Warren

Senior Staff Software Engineer at Clipboard

Rocky Warren
Open session

World Congress 2026 North America

Testing AI Workflows Locally with Testcontainers

Anna Chernyshova

Sr Solutions Engineer @ Docker

Anna Chernyshova