When Should Used Test Data Be Deleted? Retention Periods and Automatic Disposal
· DataMint · 6 min read
Clean up a server list and you find names like this: TEST_2023_차세대_임시 (in Korean, roughly "TEST_2023_NextGen_Temp"). Nobody knows who created it, and it holds forty customer tables. Nobody can say whether it is safe to delete, so it stays for another year.
The answer to when it should be deleted is "when the test is over." The problem is that nobody declares when the test is over. So instead of leaving the end to someone's judgment, you need an approach that sets the deadline at creation time.
The basis
This section is about Korean law. Article 21 of the Personal Information Protection Act (PIPA) (in Korean) requires personal data to be destroyed without delay once the retention period has passed or the purpose of processing has been achieved and the data is no longer needed. Destruction must be done so that the data cannot be recovered. If testing was the purpose, the point when the test ends is the point when the purpose is achieved.
The financial sector is more specific. Article 13(1)(8) of Korea's Electronic Financial Supervision Regulations (in Korean) says that if user (customer) information was unavoidably converted and used in testing, it must be "deleted as soon as the test ends." Control 2.8.4 of ISMS-P (Korea's information security and privacy management certification) also requires procedures not only for creating and using test data but for destroying it.
Why it does not get deleted
- There is no end. Integration testing is followed by acceptance testing, go-live by stabilization, and after that comes the "just in case" period.
- The owner changes. The person who created it left when the project ended, and those who remain never created that database.
- Deleting is the losing move. Delete it and someone comes looking, and you are held responsible. Leave it and nothing happens. At least until there is an incident.
- There is no list. Which test database was built when, from which production data, is not written down in one place.
- There are copies. Developer PCs that took another dump from the test database, backup servers, and other test environments.
The third is the core of it. In a structure where only the person who deletes carries risk and the person who leaves it carries none, nobody deletes. Deletion has to be the default behavior, not someone's decision.
How to set the retention period
There is no right number. Set it differently according to how the environment is used, and build it so that data is deleted when the deadline passes but can be extended when needed.
| Environment | Use | Example period |
|---|---|---|
| Development database refreshed on a schedule | Refilled every week | Same as the refresh cycle, since it is replaced at the next refresh |
| Project integration test database | Kept for the duration of the project | Project end date + stabilization period |
| Temporary database for reproducing an incident | Analysis of a specific problem | A few days to 2 weeks |
| Performance test database | For the test round | When the round ends |
Make extensions something you request
There will always be cases where data is needed past the deadline. When that happens, the deadline is not quietly pushed back. Someone requests it, stating who needs it, for what reason, and for how much longer, and gets it approved. Then every old test database has a record of "who said it was needed and why." No ownerless database turns up three years later.
Notify before the deadline passes
A notice has to go to the person in charge before the data is deleted. If data is deleted without warning, from then on everyone sets the deadline to the maximum.
What to check when deleting
| Item | What to check |
|---|---|
| Scope | Is there a list of which test databases were created when? |
| Deadline | Is the retention period set at creation time? |
| Automatic | When the deadline passes, is the data deleted without anyone having to remember? |
| Extension | Do extensions have a request and an approval, and is the reason kept? |
| Exceptions | Can tables that must not be deleted (code tables and the like) be designated separately? |
| Records | Is it recorded when what was deleted, and who approved each extension? |
| Copies | What happens to files exported again from the test database, and to backups? |
The last row cannot be solved with a tool alone. It also takes access control that prevents data from being downloaded from the test database to personal PCs, and a decision to run a backup policy for test environments that differs from production.
Automatic disposal in DataMint Core
DataMint Core is the product that creates the test data, so it already knows which data went into which database and when. So deletion is handled in the same place.
- A retention period is set per database. Test data past the period is deleted automatically.
- If it is needed longer, you request an extension before expiry and get it approved.
- A history of disposals and extensions is kept. You can see when what was deleted and who approved an extension.

When the record of creation and the record of deletion are connected in the same place, the question asked in audits, "when did you take it and when did you delete it," can be answered from one screen.
Closing
Everyone cares about creating test data, because the tests have to be run. Nobody cares about deleting it, because what gets better by deleting is not visible. So deletion has to be left to structure, not to people's diligence. Set the deadline at creation, delete when the deadline passes, and require a reason to keep using it. With these three, ownerless test databases do not appear.
If yours is a development database refilled every week, also see automating the development database refresh.
- #test data disposal
- #test data retention
- #personal data retention period
- #personal data destruction
- #test database management
- #development database