<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/replay-testing-is-not-magic-but-it-feels-like-it-it-is-the-only-type-of-test-that-works-with-100--t2gce5srg" -->

---
title: Replay testing is not magic, but it feels like it. It is...
description: Replay testing is a technique for event-sourced systems that replays the entire production event history through a new code version to validate backward...
canonical: https://daily.dev/posts/replay-testing-is-not-magic-but-it-feels-like-it-it-is-the-only-type-of-test-that-works-with-100--t2gce5srg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Replay testing is not magic, but it feels like it. It is the only type of test that works with 100% realistic data without taking the risks of testing in production. | daily.dev
og:description: Replay testing is a technique for event-sourced systems that replays the entire production event history through a new code version to validate backward...
og:url: https://daily.dev/posts/replay-testing-is-not-magic-but-it-feels-like-it-it-is-the-only-type-of-test-that-works-with-100--t2gce5srg
og:image: https://api.daily.dev/og/posts/t2GCe5srg.png
og:image:alt: Replay testing is not magic, but it feels like it. It is the only type of test that works with 100% realistic data without taking the risks of testing in production.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Replay testing is not magic, but it feels like it. It is the only type of test that works with 100% realistic data without taking the risks of testing in production.

**[PHP Dev](https://daily.dev/sources/phpdev)** · [@sebastianbergmann](https://daily.dev/sebastianbergmann) · 1 upvotes · 0 comments

## Summary

Replay testing is a technique for event-sourced systems that replays the entire production event history through a new code version to validate backward compatibility and correctness. Two oracle types are covered: implicit oracles (crash-free execution) and explicit oracles (comparing final state against known production snapshots). The approach enables A/B testing of new business logic against historical data without production risk. Key practical challenges include handling non-determinism (clocks, external APIs), event schema evolution via upcasting, silencing side-effect adapters to prevent real emails or payments, and GDPR compliance through crypto shredding or pseudonymisation. Replay testing complements—not replaces—unit and end-to-end tests, serving as the ultimate regression safety net for complex domain refactorings.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://phpunit.expert/articles/replay-testing.html>

## Similar posts on daily.dev

- [Debugging as a design goal](https://daily.dev/posts/debugging-as-a-design-goal-p6g6p3nlp) · PHPUnit Expert · 13 upvotes · 1 comments
- [To test, or not to Test? Part 3 – Make it easier to recover from a defect](https://daily.dev/posts/to-test-or-not-to-test-part-3-make-it-easier-to-recover-from-a-defect-u4fa1chcv) · We Are .NET · 0 upvotes · 0 comments
- [A better way to end-to-end test your webapp](https://daily.dev/posts/a-better-way-to-end-to-end-test-your-webapp-gxhq7phhr) · swizec.com · 3 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#architecture](https://daily.dev/tags/architecture), [#phpunit](https://daily.dev/tags/phpunit)

[View this post on daily.dev](https://daily.dev/posts/replay-testing-is-not-magic-but-it-feels-like-it-it-is-the-only-type-of-test-that-works-with-100--t2gce5srg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/replay-testing-is-not-magic-but-it-feels-like-it-it-is-the-only-type-of-test-that-works-with-100--t2gce5srg","headline":"Replay testing is not magic, but it feels like it. It is the only type of test that works with 100% realistic data without taking the risks of testing in production.","text":"Shared: Replay Testing","url":"https://daily.dev/posts/replay-testing-is-not-magic-but-it-feels-like-it-it-is-the-only-type-of-test-that-works-with-100--t2gce5srg","datePublished":"2026-02-25T16:56:01.704Z","dateModified":"2026-02-25T16:56:46.569Z","author":{"@type":"Person","name":"Sebastian Bergmann","url":"https://daily.dev/sebastianbergmann","image":"https://media.daily.dev/image/upload/s--C1spaGmt--/f_auto/v1769079877/avatars/avatar_Yy0cnkFhv4SEvnBDkKVDx?_a=BAMAMiiu0","description":"Created PHPUnit. Co-Founded thePHPcc. Helps developers build better software.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":810}},"image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/utTZOeiEv"},"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/phpdev","name":"PHP Dev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHP Dev","item":"https://daily.dev/squads/phpdev"},{"@type":"ListItem","position":3,"name":"Replay testing is not magic, but it feels like it. It is the only type of test that works with 100% realistic data without taking the risks of testing in production."}]}
```

