Xiaobo Chen, Yan Mo and Sihong He studied a Python function that promises to report bad input but returns a default instead. A coding assistant can narrow the handler to one type of error and clear the warning. The function still returns the default for the error callers were promised they would see.
- In a retrospective check on synthetic tasks, ordinary continuous integration (CI), the automated checks run on a code change, accepted 85.8% of 162 wrong repairs. Adding Ruff or Pylint exception rules still let half through.
- On 335 cases with bugs planted in real Python functions, seven assistants cleared the warning but kept the bug in 9.7% to 51.5% of cases. Adding a test for the documented error reduced that failure for four of the five assistants in the main statistical comparison.
Caveat: The researchers could build a usable test for only 169 of the 335 cases (50.4%). The bugs were planted, so the percentages describe what happened when this problem was present, not how often it occurs in ordinary projects.