Pilot study
One program, two variants, twelve rounds
Both variants began as the same deliberately buggy task-manager library of about 50 lines and received the same maintenance tasks in the same order.
Clean
Typed dataclasses, descriptive names, validation helpers, docstrings, and shared access patterns.
Degraded
Dictionaries, one-letter names, no types or docstrings, redundant boolean comparisons, and repeated raw-data access.
The system under test
By round 12, both variants supported priorities, due dates, tags, subtasks, notes, search, archiving, bulk operations, and recurring tasks. Their public method names matched, while their return representations differed.
tm = TaskManager()
task = tm.add_task("Ship the working paper", priority="high", tags=["writing"])
tm.add_subtask(task.id, "Draft outline")
tm.complete_task(task.id) # blocked until the subtask is complete
tm.complete_subtask(task.id, 1)
tm.complete_task(task.id)
Protocol
TreatmentClean versus deliberately degraded source code.
MaintenanceThe same twelve tasks, applied sequentially to both variants.
Behavioral graderA hidden pytest suite written from each task specification before either variant was changed.
Structural measuresComplexity, maintainability index, duplication, code churn, and selected anti-pattern counts.
Important limitation: I wrote both variants, interpreted every task, and performed the maintenance. The whole program fit in context, every ticket specified the required behavior, and the grader hid the interface difference between dataclasses and dictionaries. The pilot is useful for designing the next experiment, but it cannot support a general causal claim.