SnapShelf · Case study · The tests

What the tests check, in plain words.

SnapShelf has more than 400 automatic tests that run on Windows and Linux at every change. This is a selection of seventeen. I chose them because each one protects a user's files or money, caught a real fault before release, or pins down a decision I made.

Every test in the project is named as a sentence saying what it proves, so this list is close to how they read in the code. The tests were written by an AI coding tool. What they check was decided by me.

Protecting the user

Originals are byte-for-byte unchanged after an export.
Also after a cancelled export, and after a run that hit a full disk. Every photo is fingerprinted before and after. This is the product's first promise, so it is tested in the worst cases, not only the normal one.
Free output is the same picture a licensed copy makes.
The files from the free version and the paid version are compared byte for byte. I decided the free version would never stamp anything on a seller's photos; this test is that decision, enforced.
Being offline never takes the license away.
A paid copy keeps working with no connection for as long as it likes. After 30 days it asks, gently, to go online once, and still limits nothing.
Only the last four characters of a license key are ever shown.
So a key cannot leak through a screenshot or a support log.
The update check sends nothing about the user.
The test reads the request the app makes and confirms it carries only the app's version: no identifier, no extra data in the address.

Licensing and payment

A third computer is refused at a limit of two.
And once one computer gives up its place, the third is let in.
A key bought for another product is refused, and its seat given back.
The refusal must not leave the buyer's key with one of its places used up.
Removing a license while offline is refused.
If the app forgot the license without telling the server, that computer's place would be lost for good. So it keeps the license and says why.
A refund ends the license at the next check.
Run against the real license server code, not a copy of its rules, and later confirmed with a refunded test purchase through the payment provider's sandbox.

Getting it right

The file-name table shows exactly what the export writes.
The preview of new names and the export share one naming function, and a test exports for every platform with three different patterns and compares the two lists.
eBay never gets a watermark.
eBay's picture policy does not allow them. The same run that watermarks the other platforms' files leaves eBay's untouched, in the export and in the preview.
A photo smaller than a platform's size is never stretched.
It is exported as it is and pointed out. Enlarging a small photo makes it blurry, and the seller would not know why.
A broken preset file is listed, and everything else still works.
Presets are files a user can edit by hand, so a typo in one must not stop the app or hide the others.
Text can be read on every surface, in both themes.
Every pairing of text and background colour is measured against the accessibility guideline's contrast rule, automatically, so a later colour change cannot quietly break it.

Tests that caught a real fault

An image too large to open safely is refused.
The first version of this safeguard sat in the wrong place and such images slipped through. The test failed, and the safeguard was moved before the code went any further.
A run refused because its folder already exists writes nothing into that folder.
The first version still wrote its report there, which could have replaced an earlier run's report. Caught by this test on the day it was written.
On a padded photo the watermark is on the photo, not in the padding.
The design's order of steps put the mark in the white border, where a white mark vanished. The first tests showed the design was wrong, and it was changed.

What the tests did not catch

Two faults were found only when the app first called its real, deployed license server: the server's network refused the app's requests, and Windows could not verify the server's security certificate. No test on a developer's machine could have shown either. They were found in a sandbox, before any customer existed, and each now has a test of its own. That is why the first purchase was a test purchase.

The other tests are of the same kind as these. I am glad to walk through all of them on a call.