Skip to content
>devspeak
← glossary
level 6Testing & Reliability

Deterministic

also: determinism, non-deterministic, nondeterministic

Always giving the same result from the same starting conditions. A deterministic test passes every time or fails every time, never at random.

a bit more technical

Behavior that produces identical output for identical input and state. Tests become non-deterministic when they depend on things that vary between runs: the current time, random numbers, network responses, or the order in which things finish.

picture it

A calculator is deterministic: 7 times 8 is always 56. Asking a friend to pick a restaurant is not; you may get a different answer each time.

why it matters

You can only trust a test result if the test is deterministic. If an agent's test depends on today's date or a live API, it may pass today and fail tomorrow with no code change.

what your agent might say
agent
To make the test deterministic, I froze the clock at 2025-03-01 09:00 and fixed the random values it uses, so every run produces the same result.
how you might use it
you → your agent
Make the streak tests deterministic: use a fixed fake date instead of the real clock, and don't call the live API.
common mistake

Assuming a test that passed once will always pass. If it depends on time, randomness or the network, the next run can differ.