Booleans arrive from a database as 1, from a CSV as yes, and from a config file as on. A parser that handles one and not the others fails quietly. Generate a batch in each representation and find out which ones yours accepts.
What you can control
- Seven representations covering how booleans actually appear across databases, files and APIs.
- The true rate is a percentage, so you can produce a 95%-true column and see whether a filter still works.
- Nullable mode adds a third state, which is what a SQL
BOOLEAN NULLcolumn really holds. - Bit-string mode packs up to 64 flags per row for testing bitmask handling.
Testing ideas
- Representations. Generate
yes/no,Y/N,1/0andon/offto test the parser on the other side of a CSV import or form post. - Tri-state. Allow null to test checkboxes and filters that must distinguish "false" from "not answered".
- Skewed ratios. Set the chance of true to 1% or 99% to test feature-flag rollouts and empty-state logic.
- Bit strings. Use bit strings up to 64 bits to test bitmask permissions.
What this is not
The true rate is a probability, not a quota. A batch of ten at fifty per cent will not necessarily contain five of each — increase the count if you need the distribution to converge.