Fake Data Generation Suite Documentation
MockLock Fake Data Generation Suite
Overview
The MockLock Fake Data Generation Suite provides developers with tools to create realistic test data for development and testing environments. This suite is essential for creating authentic-looking test data without using real personally identifying information.
Features
The Test Data Suite includes four primary generators:
- Fake Person Generator
- Fake ID Generator
- Fake Passport Generator
- Test Card Data Generator
Fake Person Generator
Purpose
Generate complete fictional user profiles with realistic personal details for testing user-centric applications.
Generated Data
- Personal information (name, age, gender)
- Contact details (email, phone number)
- Address information (street, city, postal code)
- Nationality
- Generated username and password
Use Cases
- Testing user registration flows
- Populating databases with test users
- UI development for user profile pages
- Testing data validation rules
How to Use
- Open the Fake Person Generator
- Customize nationality settings if desired
- Click "Generate" for a complete fictional profile
- Copy individual fields or the entire profile as needed
Fake ID Generator
Purpose
Create realistic-looking identification document data for testing identity verification systems.
Generated Data
- ID number following country-specific formats
- Issue date and expiration date
- Personal details (name, date of birth, gender)
- Address information
- Document-specific details
Use Cases
- Testing KYC (Know Your Customer) processes
- Developing identity verification systems
- Testing document scanner applications
- Simulating user verification workflows
How to Use
- Select the ID type and country
- Customize fields if needed or use randomized data
- Generate the ID document data
- Copy or download the generated information
Implementation Details
The ID generator uses country-specific algorithms to create valid-format IDs. For example, South African ID numbers follow the format:
YYMMDD GSSS CAZ
Where:
- YYMMDD: Date of birth
- G: Gender (0-4 female, 5-9 male)
- SSS: Sequence number
- C: Citizenship (0 for SA citizen)
- A: Usually 8 (for pre-1994 IDs, 0 or 1)
- Z: Control digit
Fake Passport Generator
Purpose
Generate realistic passport data for international testing scenarios.
Generated Data
- Passport number
- Personal information (name, date of birth, place of birth)
- Issue and expiry dates
- Nationality/issuing country
- Machine Readable Zone (MRZ) data
Use Cases
- Testing international travel applications
- Developing passport scanning functionality
- Testing international user workflows
- Simulating travel booking systems
How to Use
- Select the passport country of issue
- Generate a random passport or customize specific fields
- View the generated passport data including MRZ codes
- Copy individual fields or export the complete data
Security Notes
- The generated passports are for testing only and follow the correct format but are not valid documents
- The data includes checksums that will pass basic validation
- A clear "SPECIMEN" or "TEST DATA" watermark is included in any visual representation
Test Card Data Generator
Purpose
Create valid-format credit card numbers for testing payment systems without using real financial data.
Generated Data
- Card number (following Luhn algorithm)
- Card brand (Visa, Mastercard, Amex, etc.)
- Expiration date
- Security code (CVV/CVC)
- Cardholder name
Use Cases
- Testing payment processing systems
- Developing e-commerce checkout flows
- QA testing for financial applications
- Testing payment gateway integrations
How to Use
- Select the desired card brand
- Generate random card details
- Copy the card information for testing
- Use the test mode of your payment processor with this data
Implementation Details
The card numbers are generated following the Luhn algorithm to ensure they pass basic validation checks:
javascriptfunction isValidCardNumber(number) {
// Remove spaces and non-digit characters
number = number.replace(/\D/g, '');
// Check if empty or not the right lengthpan> empty or not the right length
if (!number || number.length < 13) return false;
// Luhn algorithm implementation
let sum = 0;
let doubled = false;
// Loop through each digit from right to leftkeyword">from right to left
for (let i = number.length - 1; i >= 0; i--) {
let digit = parseInt(number.charAt(i));
// Double every second digit
if (doubled) {
digit *= 2;
if (digit > 9) digit -= 9;
}
sum += digit;
doubled = !doubled;
}
// Valid if sum is a multiple of 10>if sum is a multiple of 10
return sum % 10 === 0;
}
Best Practices
General Guidelines
- Always use test data in development/testing environments only
- Never attempt to use generated data for actual identity verification
- Include clear markers in your test database to identify test data
- Use different test data profiles for different test scenarios
Data Protection
- Even though the data is fictitious, handle it according to your data protection policies
- Do not expose generated test data in public repositories
- Sanitize logs that might contain generated test data
- Use data anonymization when converting production data for testing
Testing Strategies
- Create a library of test data profiles for consistent testing
- Test edge cases by customizing the generated data
- Use generated data in automated testing scripts
- Maintain a set of known test data for regression testing
Technical Implementation
The Fake Data Generation Suite is built using:
- React components for the user interface
- JavaScript algorithms for data generation
- Country-specific rule implementations
- Data validation to ensure realistic outputs
Each generator uses specialized algorithms to create data that appears authentic and passes basic validation, while ensuring the data doesn't match any real person's information.