📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

How do you generate realistic test data for EF Core integration tests without copying production data?

Junior Theory Intermediate

🎯 Key points

  • Bogus with a fixed seed for reproducible fake data
  • Real SQL Server via Testcontainers
  • Reset with Respawn or rolled-back transactions
  • No production personal information in test
  • Generate volume for performance tests
  • Masked copies only with data-owner approval

⏱ 30-second answer

Use a library such as Bogus to generate synthetic but realistic data with a fixed seed, so runs are reproducible. Create it per test or per fixture against a real SQL Server in a Testcontainers container, and reset between tests (Respawn or a transaction rolled back at the end). Never copy production data into test environments: it moves personal information into less protected places, which is a Privacy Act and Notifiable Data Breaches risk. When you need production-like volumes, generate them, or use a masked copy approved by the data owner.

🔍 What the interviewer is checking

Checks synthetic data generation and Privacy Act awareness

↩ Usually asked after

More in Production EF

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me