Test fixture
Code transformation while preserving behavior and intent.
The model receives the prompt (and optional system message). The run uses scorer contains_any with the JSON configuration below. Pass/fail and partial credit are determined entirely by that scorer against the model output; no human grading.
Refactor without changing behavior. Return only Python code.
def compute_total_08(lines):
total = 0
for j in range(len(lines)):
line = lines[j]
total = total + line['qty'] * line['price']
return total
{
"expected_contains": [
"for line in lines",
"line['qty'] * line['price']",
"return total"
]
}temperature
0
max_tokens
320
timeout (s)
120
type
scored
file
refactoring_hard_08.json