A tool isn’t finished when it runs — it’s finished when it gives the right answer every time. Here’s a simple way to test and debug.
Testing against expected results
- Start with the test cases — each has an input and the expected output.
- Run your tool with each input.
- Compare the actual output to the expected output, exactly.
- A test passes only if they match; otherwise it fails — note which one and why.
Keep going until every case passes, including the tricky ones (like input in a different case).
Debugging a problem
When something’s wrong, work through it calmly:
- Reproduce it. Find the exact input that triggers the problem.
- Narrow it down. Which step produces the wrong value — input, processing or output?
- Check your assumptions. Print or inspect the value at that step; is it what you expected?
- Find the cause, not just the symptom. For example, a case-sensitive comparison can make “high” fall through to the wrong branch.
- Fix it, then re-test everything — make sure the fix didn’t break another case.
Worked example
Test T5 expects
SR-1043(urgency “high”, lowercase) to come out Critical, but the tool returns Low. Narrowing it down shows the priority check compares urgency exactly, so “high” never matches “High”. Normalising the case before comparing fixes it — and the other tests still pass.
Recording the result
Once all tests pass, note it in your handover: what you tested, that it meets the spec, and anything to watch. See the handover template.