Test Case Template: Keep Expected Results Separate from the Run

A test row says “invalid tag: pass,” but nobody can tell which value was entered or what the program returned. Record the exact input, expected output and observed result so another tester can repeat that decision.

Give the case one requirement and a repeatable action

This independent example tests an original short-tag.mjs teaching script, not a deployed application. Proposed requirement TAG-1 accepts exactly one argument containing one through eight ASCII lowercase letters. TAG-2 rejects a wrong argument count. The full source and actual execution environment appear with the cases; no customer test run or release sign-off is claimed.

An original short-tag test-case record with requirements, setup, commands, expected results and actual boundary/error executions
An original short-tag test-case record with requirements, setup, commands, expected results and actual boundary/error executions
Open the full example ↗

A passing case needs an observed result that matches its expectation. The lower boundary is a single letter; the upper boundary is eight letters. Empty and nine-letter inputs test the two rejected length boundaries. Uppercase and a digit test the character rule. Missing and extra arguments test TAG-2 rather than the format rule.

TestRail's template guidance distinguishes preconditions, steps and expected results, then compares expectations with actual outcomes to assign a status. Use that distinction even when your cases live in a spreadsheet or repository. An expected error exit can mean the test passed; it does not mean the command succeeded.

Keep the run evidence attached to the status

Save the exact supplied script and use the recorded Node environment. Each case gives a command, expected stdout or stderr and exit status. The actual record comes from running that command against this source. Success returns Accepted: followed by the unchanged tag. Invalid content returns Invalid tag on stderr with exit one; a wrong argument count returns Usage: node short-tag.mjs TAG with exit one.

Do not copy these PASS statuses into a run against a different implementation. Start a new record with actual results blank and status Not run. If the environment or required source is unavailable, mark the case Blocked and explain the missing prerequisite. A failure needs the observed mismatch; inventing a bug ID or tester name adds no evidence.

Draft cases from requirements and supplied run data

Create one offline HTML test-case review record.
Requirement IDs and exact acceptance/error rules: [PASTE]
Complete source/build and required setup: [PASTE]
Case IDs, inputs, commands and expected stdout/stderr/exit: [PASTE]
Actual execution records and environment, if available: [PASTE]
Keep expected and actual outcomes separate. Include lower/upper accepted boundaries and adjacent rejected values where relevant. Compare actual output streams and exit codes before assigning PASS or FAIL. Expected rejection can pass the case. If no run data exists, leave actual results blank and mark Not run; use Blocked only with a supplied missing prerequisite. Never invent executions, names, bugs, coverage percentages or release approval. Flag inconsistent requirements or status with [CHECK CASE], and missing facts [TO CONFIRM]. Include the supplied source and readable cases with requirement/setup/action/expected/actual/status fields. No external assets, fake run button or tracker integration. End with the exact case another tester should reproduce.

Hand the repeatable case to another tester

Ask a colleague to repeat the empty-input and extra-argument cases from the same source. If the expected and actual records are hard to compare, read them together in the prepared HTML review copy in NOS, then record the new run in the team's actual test tool or repository.

Send the run with the source and environment it tested. Discuss a mismatch before changing the expected result; the review copy neither executes the command nor signs off a release.

Keep reading