Back to Guides

Stabilization

Bug fixing

What to prepare

  • Symptom, expected behavior, and preferably a reproducible input case with relevant field values.
  • The code paths that compute or change the state; in ABAP this is often mapper, validator, status logic, or database selection code.
  • Known non-goals: areas that must not be touched, performance-sensitive paths, or business edge cases that must remain unchanged.

Recommended workflow

  1. Provide contextPlace the affected files, error message, and preferably a short reproduction path into the workspace. If available, describe the concrete values that trigger the defect.
  2. Describe the task preciselyDescribe current behavior, expected behavior, and edge cases. Ask for cause hypotheses first, then the smallest change with a regression test.
  3. Review the changeCheck that the fix targets the described defect and does not accidentally change broader logic. Tests are especially important because small conditions in status logic can move other cases.

Example prompt

A bug-fix prompt should include symptom, expectation, and boundaries.

In ZCL_ORDER_STATUS_MAPPER, cancelled items sometimes return status OPEN.
Expected is CANCELLED when LOEKZ is set.
Analyze the cause, change only the smallest necessary area, and add a unit test for this case.

Review checklist

  • Does the new test reproduce the original defect and fail without the fix?
  • Is the change locally scoped, or does it secretly alter a more general business rule?
  • Are edge cases such as initial values, deleted items, status priorities, or missing Customizing data considered?

Expected result

The result should be a minimal code change plus a regression test. The reasoning must explain why exactly this path caused the defect and which similar cases were intentionally left unchanged.