Practical guides · Practical guide

Selecting and masking production data for GxP testing

A production copy may contain confidential information, unexplained historical states and none of the boundary cases you need. Choose and control test data for the actual test objective before deciding whether a production extract is appropriate.

Table of contents

At a glance

Can you use production data for GxP validation?

Production data may be suitable where use, authority, protection and relevance have been assessed. Assess legality under applicable data protection rules separately. Masking should preserve required relationships and failure characteristics. For critical functions, include independent expected results and targeted boundary and failure cases. A copy of production data is neither automatically permitted nor automatically a useful test dataset.

Realistic does not mean fully appropriate

Production data actually reveal occurring formats, quantities, and relationships. They can therefore assist in evaluating typical processing conditions and historical anomalies. At the same time, they often contain few deliberately introduced failure scenarios or known boundary values. A dataset that functioned accidentally during operation does not validate behavior under conditions such as missing assignments, inconsistent units, or interrupted processing.

Start with the validation assertions. Which requirement, which risk, and which expected response should the dataset cover? Then decide between synthetic data, selected production examples, or a controlled combination. A full production replica is only justified when its additional benefits and risks are fully understood. It may be unnecessary for a single authorization test; however, it can be essential for a complex migration exercise.

Sources: [1] [2]

Intended use, protection, and authorization for copying to be clarified

Describe the source, environment, scope, test purpose, users, and retention period. Check for the presence of confidential business, employee, patient, or customer data. The data protection legality is to be assessed separately by the responsible authorities; this contribution does not provide general legal authorization. Even in the absence of personal data, confidentiality and contractual usage limitations may still apply.

A test environment often has different controls compared to production. External consultants, broadly authorized developers, or additional cloud tools may gain access. Therefore, verify target authorizations, logging, interfaces, and potential exports. A copy must not trigger actual notifications, orders, or data transfers. Before usage, ensure that production-targeted addresses and tasks are handled in accordance with the approved concept. A simple label "Test System" is insufficient to prevent such impacts.

Sources: [1]

Anonymization, pseudonymization, and masking differ

Masking is a technical collective term for changed or concealed values. This does not automatically result in legally reliable anonymisation. In case of pseudonymization, the assignment to a person with separately stored additional information may still be possible (GDPR Art. 4 No. 5). Such data remain personal; Recital 26 explains the delimitation to anonymous information. Also combinations of seemingly inconspicuous features can make persons or companies identifiable. Therefore, the concrete protection effect is evaluated and not derived from a tool name.

For the validity of test conclusions, it is essential to define which attributes are preserved. Any arbitrary replacement of a batch number can disrupt relationships between tables. A uniform substitution of all data with the same date can eliminate time sequences and edge cases. Therefore, establish rules per data type: consistent key mapping, allowable lengths, required distributions, and intentionally retained edge cases. Maintain a separate and restricted back-mapping key only within authorized limits.

Sources: [3]

Example of batch links after masking

In the example, delivery, inspection, and batch data are used for a system interface test. The original batch C-4711 appears in three tables. After masking, it must consistently receive the new key T-008 across all tables. Customer names are replaced; the relationship between delivery and recipient is preserved. A missing inspection record remains intentionally absent, as this specific failure scenario is intended to be validated.

The intended use is documented prior to execution: two complete batch chains, one incomplete chain, and a rejected dataset containing an invalid unit. Masking is self-verified before the dataset enters validation. If the system automatically fills in missing fields, the test loses its purpose. The table below serves as an internal work aid and does not establish a general obligation to use productive data or a specific masking technique.

Internal work aid: Masking rules by data type
Data typeProtected contentTo obtain the test sample
Person name Identification statement Required Role or Relationship
Batch identifier Confidential original key Consistent mapping via tables
Date A date or time that could identify a person Technical Sequence and Edge Cases
Freitext Confidential non-structured information Required format or length characteristics
Result More sensitive measurement or business content Critical limit and expected evaluation
Attachment Hidden information and metadata Required type and basis for assignment

Sources: [1] [2]

Reference dataset and expected values to be defined independently

Document the specific data sets and the requirements they address. Link cases to expected outcomes and relevant risks. A test dataset must have a controlled baseline to ensure future repetitions remain interpretable. If the source is continuously updated, preserve the snapshot used and document the timing of the data selection. A query such as "current production" without a fixed reference point is often too imprecise for reproducible results.

Determine the required value independently of the function being assessed. During a migration, known source objects and relationships may serve as reference points; during a calculation, a separately traceable calculation must be provided. Do not simply accept the existing report as truth when its logic is under review. Evaluate known data deficiencies in the source. A past error must neither go unobserved and be incorporated into the new acceptance criterion nor be eliminated through unplanned test data cleansing.

Sources: [1]

Targeted synthetic edge cases are deliberately augmented

Product examples are supplemented with cases that are rare or have never occurred before. This includes empty values, duplicate keys, invalid states, long text entries, special characters, unit conversions, and temporal edge cases. Select them based on the function. A date import requires different validation data than a role assignment. Increasing the number of random data sets does not automatically enhance the validity of the results.

With large datasets, distinguish between functional correctness and performance requirements. A small reference case can validate the mapping rule, while an additional volume test assesses the intended operating conditions. Keep these statements separate. Masking can alter distributions and thereby render volume testing unrealistic. Evaluate, for example, whether all values suddenly become equally long or whether the dataset volume significantly decreases due to the removal of attachments. The dataset must align with the specific objective of the validation.

Sources: [1]

Copy, execution, and repetition to be verified

Capture the procedure for provision including tooling setup, rules, and result verification. Verify completeness of the selected population and correct transformation. Relevant relationships are reconciled prior to actual test execution. A successful copy job confirms only that a technical run has been completed. The technical suitability and protective efficacy remain subject to separate evaluation.

Control how test data is reset or re-supplied following a test execution. A previous test may have altered status, numbering sequences, and inventory levels. If a tester re-runs the next case based on this state, the outcome may have a different root cause than originally assumed. Document the initial state and any required cleansing actions. For automated tests, setup and evaluation processes must be reliable. Avoid direct connections to production environments that could uncontrolledly modify test inventory or influence actual data.

Sources: [1]

Closure, storage, and access restriction

Separate evidence required for reconstruction of testing from unnecessary raw copies. Define which data versions, selection criteria, and results are to be controlled and retained. The legal and operational retention decision is made in consultation with the responsible parties. This article does not specify a universal data retention period. The removal from backups and subsequent offsite archives may also require individual evaluation.

When testing ends, revoke access and document remaining copies. Include exports, local developer copies and attachments as well as the test database. Give any reusable reference dataset an owner and defined change rules. Good test data protects information the test does not need and supports a traceable conclusion. Check both before relying on a masked production copy.

Sources: [1] [2]

Project experience and collaboration

Protect data while preserving their usefulness for the test

Before testing, we identify the data characteristics required, such as links between records, rare combinations of values or a specific error state. With the process team and IT, we compare them before and after masking. Your data protection owners assess whether the proposed use is permissible. Synthetic data may be simpler where they support the same test. If a realistic structure is needed, we check that masking preserves it and that any residual personal information has been assessed.

Frequently asked questions about Using production data for GxP testing

Are masked production data automatically anonymized?

No. Masking initially describes a technical modification. Whether a person remains identifiable also depends on relationships, additional knowledge, and the possibility of reassignment. Conduct a separate detailed data protection assessment. For the test, additionally verify that required attributes and failure scenarios have been preserved.

Sources: [3]

Are synthetic data acceptable for GxP tests?

They may be well suited when they represent the relevant requirements and risks. Specific boundary and error cases can be systematically evaluated using them. Document the selection rationale and expected outcomes. Additional controlled examples may be required for complex real-world structures or large datasets.

Sources: [1]

Must the entire production always be copied?

No. The scope follows the specific testing statement. Selected data or synthetic cases may be sufficient and easier to validate. A full copy requires a justified additional benefit, along with appropriate protection and operating measures. Many data sets neither replicate known "should" scenarios nor intentionally introduced failure cases.

How does one establish relationships during masking?

Use consistent rules for related keys and verify their impact across tables and appendices. The same original identifier must retain the same replacement identifier to the extent required. Additionally, assess ambiguities, duplicates, and missing references. A single-column check does not validate the complete relationship chain.

Can genuine email addresses be retained in a test system?

This requires a separate evaluation. In particular, prevent unintended messages and external transmissions. For many tests, controlled placeholder addresses are sufficient. Also review background jobs, interfaces, and notifications. The environment should not be considered risk-free solely because it is designated as a test environment.

What must be documented regarding the test data used?

At a minimum, the purpose, relevant origin or production, controlled starting material, rationale for selection, and expected outcomes shall be specified. Additional protective measures and distribution procedures, where applicable, shall be included if they influence the statement. The evidence should enable subsequent reconstruction without unnecessarily perpetuating sensitive data.

Sources and review date

As of October 14, 2026. The regulatory classification is based on the listed original sources. Masking rules, test matrices, and examples are internal reference tools; adapt them to your data set and testing objectives. Additional source reconciliation on October 18, 2026: GDPR Article 4 point 5 and Consideration 26; the remainder of the source list remains historical.

  1. European Commission: EU GMP Annex 11, Computerised Systems (2011)Current version as per EudraLex inventory as of 14.10.2026. Application, risks, operation, and data lifecycle; specific testing proposals are derived independently.
  2. PIC/S: PI 041-1, Good Practices for Data Management and Integrity (2021)Inspection Guidance on Data Integrity; in particular electronic data, transmission, access, and review.
  3. EU-Lex: General Data Protection Regulation, Art. 4 No. 5 and Consideration 26Definition of pseudonymization and identifiability of natural persons. Targeted original matching on 18.10.2026; no individual data privacy release.

Sources checked: .

Daniel Herrmann, Daniel Herrmann Consulting

Daniel Herrmann Consulting

How we can support you

Daniel Herrmann Consulting combines professional assessment with hands-on work on the specific system. During the first meeting, we clarify your intended use, existing documentation, and the next most appropriate action step.

  • Computer system validation →

    Bring your GxP systems into validated operation, from laboratory software, MES and eQMS to ERP. We define the scope, plan risk-based tests using GAMP 5 and hand the evidence to QA for release.

Send a project enquiry Customer testimonials →