Building a QA test file kit

The files every tester should keep ready, organised into baseline, boundary and edge-case sets.

Published by SampleTestFiles. About 3 minutes to read.

Most testers assemble test files the same way: in a hurry, the first time a feature needs one. A screenshot renamed three times, a CV from the downloads folder, a spreadsheet from another project. It works until a bug needs reproducing and nobody can say exactly which file caused it.

A small, deliberate kit fixes this. It takes half an hour to put together and serves every project afterwards.

What makes a good test file

  • Known properties. You can state its exact size, type and contents without opening it.
  • Stable. It is the same today as it was last month. A checksum proves it.
  • Safe to share. It contains no personal or confidential information, so it can be attached to a bug report or sent to a supplier.
  • Obviously a test file. Nobody will mistake it for real data.

Real documents from your own computer fail the third and fourth tests, and often the first.

The three sets

Baseline: does it work at all?

One small, valid, unremarkable file for each type the product accepts. If any of these fail, nothing else matters.

TypeSuggested file
DocumentSingle-page invoice PDF
Word document50 KB DOCX
Image100 KB JPG and 100 KB PNG
SpreadsheetCustomers CSV, 100 rows and orders XLSX
DataUsers JSON
VideoSix-second MP4

Boundary: where are the limits?

For each documented limit, one file either side. The size index lists every exact size available. A typical set for a product with a 5 MB limit:

  • 1 MB, which must be accepted
  • 5 MB, the boundary itself
  • 10 MB, which must be refused

If the product limits image dimensions, the download page of each image sample lists its width and height.

Edge cases: what did nobody think of?

This is the set that finds bugs.

Organising the kit

Keep the files in one folder with a predictable layout, and keep that folder in version control or shared storage so the whole team uses the same bytes.

test-files/
  baseline/
  boundary/
  edge-cases/
  CHECKSUMS.txt

Generate the checksum list once:

find . -type f ! -name CHECKSUMS.txt -exec sha256sum {} + > CHECKSUMS.txt

Later, sha256sum --check CHECKSUMS.txt confirms that nothing has been changed or corrupted.

A test matrix

For a feature that handles files, a simple grid keeps coverage honest. List the files down the side and the operations across the top.

FileUploadPreviewDownloadDelete
Baseline PDF
5 MB JPG
Zero-byte file
Non-ASCII file name

Fill each cell with pass, fail or not applicable. Empty cells are untested behaviour.

Reporting a file bug

A file-related bug report needs four facts that are often left out:

  1. The exact file. Give its name and SHA-256 checksum, or attach it. "A large PDF" is not reproducible.
  2. Its size in bytes. Not "about 5 MB".
  3. How it was provided. File picker, drag-and-drop, paste, mobile camera or API call.
  4. What happened to it. Was it rejected, accepted and corrupted, or accepted and lost?

An example:

Title: Upload of exactly 1,048,576 bytes fails with a blank 413 page

File: sample-pdf-1mb.pdf (1,048,576 bytes)
SHA-256: (value from the download page)
Steps: Profile > Documents > Upload, choose the file with the file picker
Expected: accepted, since the stated limit is 1 MB
Actual: nginx 413 error page, no application message
Note: sample-pdf-500kb.pdf uploads correctly

A report like that can be reproduced on the first attempt.

Keeping the kit useful

Add a file every time a bug is found with an input you did not have. Over a few projects the edge-case folder becomes a record of everything that has gone wrong before, which is the most valuable test suite a team can own.

Files used in this guide

Sample files referred to in this guide
FileFormatSizeContentsDownload
Sample customers CSV (100 rows)sample-customers.csv CSV 7.83 KB8,018 bytes Data rows: 100 Download CSV
CSV with quoted fields, embedded commas and line breakssample-csv-quoted-fields.csv CSV 324 B324 bytes Data rows: 6 Download CSV
CSV with a UTF-8 byte order mark and non-ASCII textsample-csv-utf8-bom.csv CSV 193 B193 bytes Data rows: 6 Download CSV
Empty file (0 bytes)empty-file.txt TXT 0 B0 bytes Lines: 0 Download TXT
File with a 120-character namesample-long-file-name-abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij-end.txt TXT 36 B36 bytes File name length: 120 characters Download TXT
Transparent PNG with an alpha gradient, 512 × 512sample-transparent-512x512.png PNG 42.0 KB42,984 bytes 512 × 512 px Download PNG

Related guides