Test data guides

How to produce the file that actually finds the bug — a file of an exact size, one that is deliberately broken in a specific way, one with a filename your system will choke on, or one in an encoding your importer does not expect.

Each guide says what to generate, what to assert, and where the behavior is specific to a particular browser or operating system.

How to create a very large test file

Make a 1 GB test file in your browser, or a 5 GB one with a single OS command. Includes why browsers cannot go higher, and the sparse-file trap.

How to create an invalid JSON file for testing

Four different ways a JSON file can be invalid, what each one tests, and the byte-order-mark trap that makes a valid-looking file fail to parse.

How to make a corrupted file for testing

Corrupted, invalid and truncated are three different failures that break software in three different places. How to produce each one deliberately.

How to test file upload validation

The upload cases that actually find bugs: size boundaries, type spoofing, hostile filenames, empty and truncated files, and what to assert for each.

Filename test cases that break real systems

Awkward filenames find bugs that file contents never reach. The cases worth testing, and what browsers do to a reserved name when you download one.

Encoding test files: UTF-16, BOM and Latin-1

Why importers fail on files that look correct. What a byte-order mark does, why UTF-16 doubles every byte, and how to generate each deliberately.

Open the generator → · All formats