
In this article
AI assistants write plausible code. Plausible is not the same as correct. Here is how to check without being a programmer.
Advertisement
1. Expected-output tests
Ask the assistant to turn your sample files into automatic tests:
Write tests/test_clean.py using pytest. For each file in sample/, run the cleaner
and compare with the matching file in expected/. Also add tests for: an empty file,
a file with only headers, and a row with an amount of "0.00".
pip install pytest
pytest -q
Run the tests after every change. If something that used to pass now fails, the last change broke it.
2. A 10-point review checklist
- Does it ever delete or overwrite input files? (It shouldn’t.)
- Are totals checked against something independent?
- What happens with blank cells, extra spaces, and text in number columns?
- Are dates parsed day-first (Indian format)?
- Are rounding rules explicit (₹ to 2 decimals)?
- Does it print a summary (rows in, rows out, rows rejected)?
- Are rejected rows saved somewhere you can see them?
- Are there any passwords, keys or file paths with your name in the code?
- Does it call the internet? Why?
- Could you explain each step in one sentence?
3. Second opinion
Paste the code into a fresh AI chat and ask: “Review this for bugs, data loss and wrong edge-case handling. List problems by severity.” A fresh conversation doesn’t share the first one’s assumptions.
Red flags — stop and ask a developer
- It needs admin rights or wants to change system settings.
- It sends data to a website or API you didn’t ask for.
- It touches a production database or your company’s ERP directly.
- The fix for one bug keeps breaking something else, three times in a row.
✨ Ask AI about this article
Stuck on a step? Ask a question and the AI answers using this article.
Free · AI can be wrong