64 / 65 · 15 SQL & Database Testing · Data Masking and Anonymization← prev⊞ allnext →☰ Read as one page
8.8Practical Exercise
- Write a masking script that transforms emails and phone numbers while preserving format
- Write tests that verify masked data: format preservation, relationship consistency, referential integrity
- Write a GDPR deletion test: create a user with activity across 4 tables, delete them, verify all traces are removed
- Test that no original values appear in the masked dataset
- Compare statistics (count, average, distribution) between original and masked datasets