lastnameNameLocale Aware

Mock Jutsu HOW-TO | UK

The lastname function is a core component of the mock-jutsu library, designed to provide developers with authentic and diverse surnames for a variety of software testing requirements. By generating a random lastname based on specific locale parameters, the tool ensures that the test data remains culturally relevant and representative of real-world demographics. Whether you are populating a database for a local application or a global enterprise system, this function simplifies the process of creating high-quality mock data without the need for manual entry or the use of static, repetitive datasets.

At its technical core, the lastname function leverages extensive, curated datasets mapped to standardised language and country codes. This algorithmic approach ensures that when a developer requests a surname for a specific region—such as the example "Yilmaz"—the output is statistically probable and linguistically accurate. Within the mock-jutsu ecosystem, this functionality is accessible across multiple interfaces, including a direct Python API call via jutsu.generate('lastname'), a streamlined Command Line Interface for rapid prototyping, and a dedicated JMeter plugin for complex load testing scenarios.

Integrating this function into your development workflow offers significant benefits, particularly when validating user interfaces or stress-testing backend systems. High-quality test data is essential for identifying edge cases, such as handling hyphenated surnames or non-ASCII characters, which are often overlooked with generic placeholders. By using mock-jutsu to automate the generation of a lastname, teams can improve their test coverage and ensure that validation logic, sorting algorithms, and search functionalities behave as expected across different international locales.

Ultimately, the lastname function empowers engineers to build more robust and inclusive applications. By replacing predictable strings with realistic mock data, the library bridges the gap between development environments and production reality. This versatility makes it an indispensable asset for QA engineers and developers alike, facilitating seamless integration into CI/CD pipelines and ensuring that every layer of the application—from the frontend form to the underlying database schema—is thoroughly vetted against varied and realistic inputs.

CLI Usage
mockjutsu generate lastname --locale TRmockjutsu generate lastname --locale DEmockjutsu bulk lastname --count 10 --locale TRmockjutsu export lastname --count 10 --format json --locale TRmockjutsu export lastname --count 10 --format csv --locale TRmockjutsu export lastname --count 10 --format sql --locale TRmockjutsu generate lastname --gender male# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate lastname --locale TR --maskmockjutsu bulk lastname --count 5 --locale TR --mask
Python API
from mockjutsu import jutsujutsu.generate('lastname', locale='TR')jutsu.bulk('lastname', count=10, locale='TR')jutsu.template(['lastname'], count=5, locale='TR')# with --gender parameterjutsu.generate('lastname', gender='male', locale='TR')# mask=True: regulation-compliant outputjutsu.generate('lastname', locale='TR', mask=True)jutsu.bulk('lastname', count=5, locale='TR', mask=True)
JMeter
${__mockjutsu_identity(lastname,TR)}${__mockjutsu_identity(lastname:male)}# JMeter Function: __mockjutsu_identity# Parameter 1: lastname OR lastname:# Qualifier values: male|female# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_identity(lastname,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_identity(lastname,TR,mask)}
REST API
GET /generate/lastname?locale=TR# → {"type":"lastname","result":"...","status":"ok"}GET /bulk/lastname?count=10&locale=TRPOST /template {"types":["lastname"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/lastname?locale=TR&mask=trueGET /bulk/lastname?count=5&locale=TR&mask=true

Parameters

Parameter Values Description
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output
--gender male|female Filter output by gender
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages