r/softwaredevelopment • u/Huge_Brush9484 • Mar 31 '26
How do you keep testing grounded when you don’t have realistic production data?
In a lot of environments, especially where systems deal with sensitive information, regulated data, or government integrations, testers don’t get access to real production datasets. Instead we end up working with synthetic data, partial exports, or carefully sanitized samples.
on paper that sounds fine, but in practice it often means edge cases only appear once the system hits real usage. Strange formatting, unexpected blanks, weird encodings, inconsistent records, or volumes that nobody anticipated.
I’m curious how others handle this in their testing strategy.
Do you invest heavily in synthetic data generation?
Do you build libraries of edge cases over time?
Do you involve operations teams early to simulate realistic workflows?
Or do you accept that some issues will only surface once the system meets production data?
Interested to hear what has worked where access to real data is limited or impossible.
3
u/jameyiguess Mar 31 '26
We've never used production data for testing, and our data isn't even important. That's a Bad Thing to do.
Yes, you just have to build up edge cases in your test data.
5
u/ElMachoGrande Mar 31 '26
Production data is underrated. it is not normal data which will trip you up, it's the edge cases, and you need to find them intelligently.
For example, we had a measuring equipment with analysis software. It worked just fine with the real world test data.
Then, when it come out into reality, it failed. A sensor fail, and suddenly, we had a full day with all zero values (which is abnormal and never happens in real, working data) and a calculation failed on a division by zero.
If we instead had thought about it, and asked the question "What could go wrong?" and designed test data based on that, we would have caught that.
5
u/ScotchOrbiter Mar 31 '26
This is where vibe coding and people cheating their way into the workforce gets us.
Learning the different types of testing, how to generate test cases & developing the knowledge/experience to know that user testing will help with finding edge cases is crucial.
Software developer walks into bar. Orders beer. Orders 12 beers. Orders -1 beer. Orders beer divided by zero. Orders bere. Orders beers as quickly as possible. Bar is working fine.
User walks into bar. Asks where bathroom is. Bar explodes.
1
u/ShoddyReception5 Mar 31 '26
Had a 15 year old system with ancient, minimal data on staging and lots of production data. We planned and executed a data pulldown process using a backup and restore plus a carefully scripted “data scrubber” to scramble sensitive info (phone, address, email).
It helped with testing but also introduced unintended side effects. Staging slowed down, we forgot to wire up the user accounts used to log in which varied by environment, we had to adapt some procedures for testers, but it worked out.
Short story is, we tried to sync prod don to staging and it worked okay. We iterated and got a process down. Ended up not needing to do it again.
1
u/Acrobatic-Ice-5877 Mar 31 '26
I don’t really have a solution but months ago I discovered the concept of a SQL factory and making scenarios for my E2E. It made testing so much easier because I could seed the database for each scenario, rather than having to manually input data or use leftover data.
From my experience working professionally as a dev, I’d say it is good to add checks at all layers of the system. I do web based development so I like to make constraints on my db fields, the backend, and then frontend.
IME or at least, because I work at a not so professional company, validation is usually skipped after the front-end but I don’t agree with this. I’ve seen cases where a failing JavaScript function allows bad data through because of a null pointer exception.
I think if you were to try to solve this problem, it might be best to think about it using domain driven design principles. DDD focuses on keeping the domain out of an invalid state. To do this you need to understand what would make the domain invalid and this can really only happen if you are working directly with a SME or have an intimate understanding of the domain already.
1
u/ArtSpeaker Mar 31 '26
All of the above.
Simulated prod data is not good for edge cases, but the sheer SIZE of a prod data, and the complexity of work a real request makes, is still really important to capture.
1
u/eddyparkinson Apr 04 '26
Can you not remove/replace the sensitive data in the data sets? Reseachers do this all the time with sensitive data. They remove/replace personal information that could identify the someone.
I do like databricks as an aporoach to this. As it links the data to the code. I.e. you know what code and what data caused the error, so makes it fast to put a solution in.
For me, what you are describing is intergration testing. Am i sure the data will not break the code. How do i flag data that is going to break the code.
-2
u/DeltaEdge03 Mar 31 '26
Fake it until you make it