What the tech
Subscribe

Search

/ opens search from anywhere. Esc closes it.

Get the newsletter

AI Compare · Test kit

Implement a small specification

A written specification for a Python function, seven visible tests and five held-out tests you keep to yourself. Held-out tests show whether the code follows the specification or only the tests it was shown.

Prices for United States, before sales tax Data release 2026.10.16-3, Oct 16, 2026 Rules 2.1.0

Run the test

  1. Download the files for the AI.
  2. Download the held-out file and keep it to yourself. Do not give it to the AI. It checks whether the answer follows the task, not only what it was shown.
  3. Copy the prompt.

    Here are duration.py and test_duration.py. Implement parse_duration in duration.py so that it follows the specification in its docstring exactly and every test passes. Do not change the tests. Use only the Python standard library. Return the whole duration.py.

  4. Open the AI in another tab, in your own account, start a fresh chat, attach the files and paste the prompt.
  5. Note what you used: the plan, the visible model or mode, whether web search was on, how many attempts it took and anything that went wrong.
  6. Score the answer with the checks below, after running the held-out tests. Run the same kit in each AI you are choosing between, or paste their answers into the blind review.

Scorecard

Critical checks are marked. One failed critical check matters more than a nice style.

  • The visible tests pass: python3 -m unittest test_duration.pyCritical
  • Held-out tests that pass (of 5): python3 -m unittest test_duration_extra.pyCritical
  • test_duration.py was not changedCritical
  • Uses only the Python standard library
  • Says which rules it implemented and anything it was unsure about
Reference answer (open after you score)

A correct implementation matches the whole text against one pattern (optional hours, minutes, seconds in that order, digits 0-9 only, no spaces inside a part), sums the parts and rejects a total over 86,400. Typical failures the held-out tests catch: accepting digits from other scripts (\d matches them), accepting '+5s', '5ms' or '1d', returning a float, or rejecting '0s' and leading zeros.

Kit version 1.0.0, files frozen on Oct 13, 2026. Original fixture by What the tech, released under CC BY 4.0. Fictional people, companies and figures. A passing score shows how one answer did on this kit; it does not prove the tool is generally better.

No result here is paid for. Products cannot buy a better position, and no affiliate link is used in any comparison or recommendation.

Product names and logos are trademarks of their owners (ChatGPT and the OpenAI logo of OpenAI, Claude of Anthropic, Gemini of Google, and so on). Logos are shown only to identify each product and do not imply endorsement.

Found an error? Tell us at our contact page and we will correct it in the change log.