bmiHealth

Mock Jutsu HOW-TO | UK

The bmi function within the mock-jutsu library provides developers with a streamlined method for generating realistic Body Mass Index values for their applications. As a core component of the health category, this utility produces a numeric representation of a person's body mass based on height and weight. By integrating this function into your development workflow, you can quickly populate databases with high-quality mock data that mirrors real-world health metrics, ensuring that your software handles physiological data points with precision and consistency across various environments.

Under the hood, the mock-jutsu engine calculates the bmi value using the standard international formula, which measures weight in kilograms divided by the square of height in metres. The generated test data adheres to standard medical ranges, providing a diverse spread of values that typically fall between 15.0 and 40.0. This adherence to established health standards ensures that the mock data remains statistically relevant for developers building fitness trackers, electronic medical records systems, or nutritional analysis tools that require authentic input for logic validation and UI rendering.

Utilising the bmi function is particularly beneficial for rigorous testing scenarios, such as verifying data visualisation components like charts and gauges or testing conditional logic within health-risk assessment algorithms. Whether you are performing performance testing via JMeter using the ${__mockjutsu(bmi,)} syntax or generating quick samples through the CLI with mockjutsu generate bmi, the library offers unparalleled flexibility. For Python developers, a simple call to jutsu.generate('bmi') integrates seamlessly into unit tests, allowing for the rapid creation of edge cases without the need for manual data entry or complex setup procedures.

By automating the creation of health-related test data, mock-jutsu significantly reduces the time spent on manual dataset curation. This efficiency allows engineering teams to focus on core feature development rather than the complexities of data synthesis. The inclusion of realistic bmi values ensures that your application's user interface and backend logic are battle-tested against a wide spectrum of potential user inputs. Ultimately, mock-jutsu empowers developers to build more robust, data-driven health applications with confidence, speed, and reliability.

CLI Usage
mockjutsu generate bmimockjutsu bulk bmi --count 10mockjutsu export bmi --count 10 --format jsonmockjutsu export bmi --count 10 --format csvmockjutsu export bmi --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate bmi --maskmockjutsu bulk bmi --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('bmi')jutsu.bulk('bmi', count=10)jutsu.template(['bmi'], count=5)# mask=True: regulation-compliant outputjutsu.generate('bmi', mask=True)jutsu.bulk('bmi', count=5, mask=True)
JMeter
${__mockjutsu_health(bmi)}# JMeter Function: __mockjutsu_health# Parameter 1: bmi# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_health(bmi,mask)}
REST API
GET /generate/bmi# → {"type":"bmi","result":"...","status":"ok"}GET /bulk/bmi?count=10POST /template {"types":["bmi"],"count":1}# mask=true: regulation-compliant outputGET /generate/bmi?mask=trueGET /bulk/bmi?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages