FREN

Let’s keep in touch

Social

Regulation· 10 min read

Test data and GDPR: testing without copying production

Test data and GDPR: why not to copy production, what the CNIL recommends, and how to test or fix a bug when working with a service provider.

Copying the production database to test a change or reproduce a bug is a common reflex. Under the GDPR, it is far from harmless: the copy multiplies the places where personal data is held and the people who can access it, and it often outlives the acceptance testing. The CNIL, the French data protection authority, recommends developing and testing on fictitious or anonymised data. This guide explains why, how to go about it, and what to plan for when a service provider works on the application.

It is aimed at CIOs, application owners and executives whose application processes personal data (customers, employees, users) and who have it developed or maintained, by their own team or by an application maintenance provider.

Why copying production to test is a problem

A copy of the production database installed on an acceptance-test server or on a developer’s workstation contains the same personal data as the original, but rarely the same protections: broader access, less logging, backups that nobody tracks. And it tends to stay in place long after the tests are over.

Three GDPR principles are at stake.

  • Minimisation. Data must be “adequate, relevant and limited to what is necessary in relation to the purposes for which they are processed” (Article 5). Testing a screen does not require customers’ real names.
  • Data protection by design. Article 25 requires the controller to put in place, from the design stage, measures “such as pseudonymisation” to implement these principles effectively. Test environments are part of that design.
  • Security. Article 32 requires the controller and the processor to ensure a level of security appropriate to the risk. An acceptance database filled with real data inherits that risk without having the protections.

The CNIL sums up the danger in its GDPR guide for development teams: using production database data for tests increases security risks, and may give access to the data to people who have no need to know it.

What the CNIL recommends

The CNIL’s guide to personal data security devotes a sheet to supervising IT development. For testing, its recommendations come down to four points.

  • Develop and test in an environment separate from production: other machines, physical or virtual.
  • Work on fictitious or anonymised data: “fictitious datasets must be used as far as possible”.
  • If that data is not enough, test in pre-production with real data, in an environment “configured and secured to the same level as the production environment itself”.
  • Only present a service or an update there that has already passed its unit, integration and functional tests in the development and test environments.

The CNIL’s GDPR guide for development teams points in the same direction. Its “Test your applications” sheet rules out real production data during development and testing, and advises building a set of fictitious data that resembles the data the application will process: if it is disclosed, the people concerned suffer no consequences. Failing that, test environments must receive the same security measures as production, and a configuration imported from production must be anonymised.

Fictitious, anonymised, pseudonymised: don’t confuse them

The three words do not mean the same thing, and the difference has a direct consequence: data that is genuinely anonymised falls outside data protection law, whereas pseudonymised data does not.

DataWhat it isUnder the GDPRUse in testing
FictitiousCreated from scratch, modelled on the real thingNo real person behind themThe default choice, in development and in acceptance testing
AnonymisedTaken from production and transformed irreversiblyOutside the scope, if anonymisation is successfulWhen realism matters: volumes, distributions, rare cases
PseudonymisedIdentifiers replaced by codes, with the mapping kept separatelyStill personal dataA security measure, not an exemption
RealA copy of productionPersonal data, with the full GDPR regimeIn pre-production secured like production, if nothing else is enough

Definitions based on Article 4 of the GDPR and the CNIL. The “Use in testing” column is our summary of its recommendations.

Successful anonymisation can be checked. The CNIL uses three criteria.

  • Singling out. It must not be possible to isolate an individual in the dataset.
  • Linkability. It must not be possible to link distinct datasets together.
  • Inference. It must not be possible to deduce, with near certainty, new information about a person.

In practice, deleting names and email addresses is almost never enough: a date of birth, a town and a profession can be enough to find someone. Free-text fields (comments, notes, attachments) are the hardest to handle, because they contain names, numbers and details of people’s lives. The CNIL also calls for ongoing monitoring: re-identification techniques are improving, and anonymisation judged sufficient yesterday may no longer be so.

Pseudonymisation is defined by Article 4 of the GDPR: the data can no longer be attributed to a specific person without additional information, kept separately. It remains reversible, and the data retains its personal nature. It is a good security measure, cited in Articles 25 and 32, not a way of escaping the GDPR.

Reproducing a production bug without copying the database

This is the situation where the temptation is strongest: a user reports an anomaly, it only occurs with their data, and copying the database seems the shortest route. There is almost always another way.

  • Describe the case, not the person. What triggers the anomaly is a property of the data: an empty field, a special character, a deadline, a volume, a combination of options. It is noted in the ticket, without copying the user’s record into it.
  • Rebuild the case with fictitious data. The test set receives a record that has the same property. It then joins the automated tests: the anomaly cannot come back without being noticed.
  • Extract the minimum, anonymised at source. If some of the real data is indispensable, only the useful tables and fields are extracted, and they are anonymised before they leave the production environment.
  • Diagnose on site, under control. When nothing else works, the analysis is done in production, or in a pre-production secured like it, by an authorised person, with traced access limited in time, rather than by moving the data out.
  • Clean the logs. Error logs and traces sent to monitoring tools often contain personal data: they must be masked too.

These practices are not one more constraint: a case reproduced with fictitious data can be replayed at will, shared without precautions and tested automatically. It is also what makes tests reliable over time.

When a service provider develops or maintains the application

Consulting data is one of the processing operations defined by Article 4 of the GDPR. As soon as it accesses personal data on behalf of its client, a service provider that develops or maintains the application therefore acts as a processor. The contract governing it must contain the clauses required by Article 28, and the provider may not itself engage another processor “without prior specific or general written authorisation of the controller”.

For test data, five points deserve a line in the contract or its appendix.

  • Access to production data: forbidden by default, or reserved for named people, for described operations.
  • Test data: who provides the dataset, who builds it, and using which anonymisation method.
  • Environments: where they are hosted, who accesses them, and how any pre-production is secured.
  • Traceability: named, logged access, withdrawn when each team member leaves.
  • The end of acceptance testing: destruction of copies, backups included, and proof that it took place.

One more point if the provider’s team works outside the European Economic Area (EEA): according to the European Data Protection Board’s Recommendations 01/2020, remote access from a third country to data located in the EEA is a transfer, to be governed by the tools of Chapter V of the GDPR. A team that only sees fictitious or genuinely anonymised data receives no personal data at all.

Our guide to the application maintenance contract details the other clauses to check, and the one on outsourcing your application maintenance covers what the company always keeps in-house.

At iones, this is the rule: no developer has direct access to production databases, and the teams work on isolated development and staging environments, with anonymised or test data (see your data security).

The checklist before each acceptance test

  • The test set is fictitious or anonymised, and the method is written down.
  • No direct identifier remains: name, email address, telephone number, postal address, customer or contract number.
  • Free-text fields and attachments have been emptied or replaced.
  • Logs and error-tracking tools do not receive real data.
  • If real data is indispensable, the environment is secured like production and the decision is documented.
  • Access is named and traced.
  • The date for destroying copies, backups included, is set.

Frequently asked questions

Can production data be used for testing?
The CNIL advises against it in development and testing: it recommends environments separate from production and fictitious or anonymised data. If that data is not enough, tests on real data remain possible in pre-production, in an environment configured and secured to the same level as production, once the unit, integration and functional tests have passed.
Is pseudonymised data enough for a test environment?
Not on their own: pseudonymised data is still personal data, because the link to the people exists elsewhere. Pseudonymisation reduces the risk, but the environment remains subject to the GDPR. To get out of its scope, you need fictitious or genuinely anonymised data.
How can I tell whether data is really anonymised?
The CNIL uses three criteria: it must not be possible to isolate a person in the dataset, to link the dataset to other data in order to find them, or to deduce new information about them with near certainty. Anonymisation is checked case by case, free-text fields included, and reassessed over time.
How do I fix a bug that only appears with one customer’s data?
By identifying what in that data triggers the bug (a format, a boundary value, a volume), then reproducing that case with fictitious data. If an analysis on real data is indispensable, it is done in production or in a pre-production secured like it, by an authorised person, with traced access.
Can a maintenance provider access our production data?
Yes, if it is necessary and supervised: it then acts as a processor, under a contract compliant with Article 28 of the GDPR, which states who accesses what data, for which operations and with what traceability. If its team works outside the European Economic Area, that access is a data transfer, which must also be governed.

Test data: a deliverable like any other

Not copying production is not one more constraint: it is what allows you to test often, to share a case without precautions and to entrust an application to an external team without exposing its users. The rule fits in one sentence: fictitious data by default, anonymised data when realism matters, real data only in an environment protected like production.

iones’ nearshore team provides application maintenance and testing for existing applications, with no direct access to production databases. You can also write to us for an initial conversation.

Sources

  1. Sécurité : encadrer les développements informatiques (guide de la sécurité des données personnelles) – CNIL, 14 March 2024
  2. Guide RGPD de l’équipe de développement, fiche n° 11 “Tester vos applications” – CNIL, version of 13 December 2021
  3. L’anonymisation de données personnelles – CNIL, 19 May 2020
  4. GDPR, Article 4: definitions (processing, pseudonymisation, processor) – Text of the regulation, CNIL website
  5. GDPR, Article 5: principles (data minimisation) – Text of the regulation, CNIL website
  6. GDPR, Articles 25, 28 and 32: data protection by design, processor, security – Text of the regulation, CNIL website
  7. Recommandations 01/2020 sur les mesures qui complètent les instruments de transfert – EDPB (CEPD), final version of 18 June 2021

Start a project

Ready to take action?

Tell us what you need – we will get back to you quickly with a technical assessment and an action plan.

  • Reply within 48–72 hours
  • No-obligation conversation
  • NDA confidentiality