Test What It Should Do
Asking an assistant for tests is easy, and it will write them quickly. But if it looks at the code it just wrote and writes tests to match, the tests simply repeat the code's assumptions, bugs included. A test suite that agrees with a bug is worse than none, because it makes the bug look approved.
The rule
You pick the test cases from the spec; the assistant may type them.
A test is a small piece of code that runs part of your program and checks the result against what you expected. The important decision in any test is not the syntax but the case: which input, and which expected result. Those come from your spec and your understanding of the rules, not from the code under test.
Here are three tests for Kitty's split function, using pytest, a widely used Python testing library:
import pytest
from kitty.money import split_evenly
def test_even_split():
assert split_evenly(90000, ["Asha", "Ravi", "Meera"]) == {
"Asha": 30000, "Ravi": 30000, "Meera": 30000,
}
def test_leftover_paise_are_not_lost():
shares = split_evenly(100000, ["Asha", "Ravi", "Meera"])
assert sum(shares.values()) == 100000
def test_empty_flat_is_refused():
with pytest.raises(ValueError):
split_evenly(5000, [])Each one encodes a decision you made: even amounts split exactly, no paisa ever vanishes, and an empty flat is an error rather than a crash.
One more rule: watch every new test fail at least once. Break the code on purpose, or write the test before the fix, and check that it turns red. A test you have never seen fail may not be testing anything at all.