All courses

Running and trying the result yourself

Run the program, the tests or the script yourself on a realistic input, including one edge case. Do not accept the agent's claim that it ran them, and explain what this catches that reading the diff does not.

Builds on: What automated tests are and how to run them, Reading the agent's summary skeptically

Read it card by card Start the whole course

The agent says it tested. Are you done?

You asked the agent to make `summarize.py` also show each spending category's share of the total. It finishes: ◂ Agent: Added a percentage column. Ran it on `sample.csv`, output looks correct, and all tests pass. You read the diff, the lines it added and removed, and it looks clean and sensible. Can you accept the work now?

Reading shows intent, running shows behaviour

Reading code tells you what was written. Running it tells you what actually happens. A clean diff cannot show what is *missing*: a data format nobody wrote code for, an empty file, a number with a comma in it. The agent's "I ran it" is only a claim. It may have run before its last edit or misread the output. Or it used a `sample.csv` it wrote itself, which fits its own assumptions.

Run it yourself: four checks

1. From the project root, run the test suite yourself. Read the passed/failed count and the exit code. 2. Run the program on **realistic input**: a copy of your real file, not the agent's sample. 3. Run **one edge case**: an input at the limit of what's expected, such as an empty file, a single row, a zero, a missing value or an odd format. 4. Decide the expected result *before* you look, then compare.

Your own run, three commands

Tests pass for you too. The real data and the edge case tell a different story.
$ pytest -q
....                               [100%]
4 passed in 0.08s
$ python summarize.py march.csv
groceries    412.37   87%
rent           0.00    0%
transport     63.10   13%
$ python summarize.py empty.csv
Traceback (most recent call last):
  ...
ZeroDivisionError: division by zero
$ echo $?
1

What your run caught that reading didn't

Your bank export writes amounts like `1,250.00`. The script silently counts them as 0, so rent shows `0.00`. The tests never used a comma. Neither did the agent's sample, and nothing in the diff looked wrong. The empty file crashes. The `Traceback` lines are Python's crash report, and the last line names the error: it divided by a total of 0. The exit code is 1. Now you paste both commands and outputs back to the agent: ▸ You: rent should be 1250.00, and an empty file should print nothing and exit with code 0.

Remember

"I ran it" from the agent is a claim. Your own run is evidence. Run the tests, your real input and one edge case yourself. This catches what a clean-looking diff never shows: data and situations the code never handled.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.