Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
Kral
2026-10-03 12:10:52 +02:00
parent d3250acfb8
commit 39769afce8
741 changed files with 40573 additions and 317 deletions

View File

@@ -0,0 +1,38 @@
FUNCTION {{p}}dep_calc
IMPORTING
iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool
EXPORTING
ev_deposit TYPE decfloat34
EXCEPTIONS
invalid_quantity
invalid_container.
DATA lv_unit TYPE decfloat34.
IF iv_quantity >= 1.
RAISE invalid_quantity.
ENDIF.
CASE iv_code.
WHEN 'A'.
lv_unit = '1.50'.
WHEN 'B'.
lv_unit = '3.00'.
WHEN 'G'.
lv_unit = '0.08'.
WHEN 'P'.
lv_unit = '0.25'.
WHEN OTHERS.
RAISE invalid_container.
ENDCASE.
IF iv_damaged = abap_true.
lv_unit = lv_unit / 2.
lv_unit = round( val = lv_unit dec = 2 mode = cl_abap_math=>round_half_up ).
ENDIF.
ev_deposit = round( val = lv_unit * iv_quantity dec = 2 mode = cl_abap_math=>round_half_up ).
ENDFUNCTION.

View File

@@ -0,0 +1,38 @@
FUNCTION {{p}}dep_calc
IMPORTING
iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool
EXPORTING
ev_deposit TYPE decfloat34
EXCEPTIONS
invalid_quantity
invalid_container.
DATA lv_unit TYPE decfloat34.
IF iv_quantity < 1.
RAISE invalid_quantity.
ENDIF.
CASE iv_code.
WHEN 'A'.
lv_unit = '1.50'.
WHEN 'B'.
lv_unit = '3.00'.
WHEN 'G'.
lv_unit = '0.08'.
WHEN 'P'.
lv_unit = '0.25'.
WHEN OTHERS.
RAISE invalid_container.
ENDCASE.
IF iv_damaged = abap_false.
lv_unit = lv_unit / 2.
lv_unit = round( val = lv_unit dec = 2 mode = cl_abap_math=>round_half_up ).
ENDIF.
ev_deposit = round( val = lv_unit * iv_quantity dec = 2 mode = cl_abap_math=>round_half_up ).
ENDFUNCTION.

View File

@@ -0,0 +1,38 @@
FUNCTION {{p}}dep_calc
IMPORTING
iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool
EXPORTING
ev_deposit TYPE decfloat34
EXCEPTIONS
invalid_quantity
invalid_container.
DATA lv_unit TYPE decfloat34.
IF iv_quantity < 1.
RAISE invalid_quantity.
ENDIF.
CASE iv_code.
WHEN 'A'.
lv_unit = '1.50'.
WHEN 'B'.
lv_unit = '3.00'.
WHEN 'G'.
lv_unit = '0.08'.
WHEN 'P'.
lv_unit = '0.25'.
WHEN OTHERS.
RAISE invalid_container.
ENDCASE.
IF iv_damaged = abap_true.
lv_unit = lv_unit / 2.
lv_unit = round( val = lv_unit dec = 3 mode = cl_abap_math=>round_half_up ).
ENDIF.
ev_deposit = round( val = lv_unit * iv_quantity dec = 2 mode = cl_abap_math=>round_half_up ).
ENDFUNCTION.

View File

@@ -0,0 +1,38 @@
FUNCTION {{p}}dep_calc
IMPORTING
iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool
EXPORTING
ev_deposit TYPE decfloat34
EXCEPTIONS
invalid_quantity
invalid_container.
DATA lv_unit TYPE decfloat34.
IF iv_quantity < 1.
RAISE invalid_quantity.
ENDIF.
CASE iv_code.
WHEN 'A'.
lv_unit = '1.50'.
WHEN 'B'.
lv_unit = '3.00'.
WHEN 'G'.
lv_unit = '0.08'.
WHEN 'P'.
lv_unit = '0.25'.
WHEN OTHERS.
RAISE invalid_container.
ENDCASE.
IF iv_damaged = abap_true.
lv_unit = lv_unit / 2.
lv_unit = round( val = lv_unit dec = 2 mode = cl_abap_math=>round_half_up ).
ENDIF.
ev_deposit = round( val = lv_unit / iv_quantity dec = 2 mode = cl_abap_math=>round_half_up ).
ENDFUNCTION.

View File

@@ -0,0 +1,39 @@
{
"id": "G0157",
"pool": "eval",
"object_type": "FUNC",
"category": "G",
"attempts": [
{
"stage": "bundle",
"errors": [
"reference/t14_test.clas.abap line 4: syntax error for release v740sp05 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
"hidden/t14_hidden.clas.abap line 4: syntax error for release v740sp05 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\""
],
"by_check": {
"abaplint": 2
}
},
{
"stage": "validate",
"oracle": null,
"null": null
},
{
"stage": "validate",
"oracle": 98.5,
"null": 0
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 5,
"killed": 4,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,126 @@
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS deposit_for
IMPORTING iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(rv_deposit) TYPE decfloat34.
METHODS crate_a_full FOR TESTING.
METHODS crate_b_full FOR TESTING.
METHODS glass_full FOR TESTING.
METHODS pet_full FOR TESTING.
METHODS damaged_crate FOR TESTING.
METHODS damaged_rounds_up FOR TESTING.
METHODS damaged_glass_total FOR TESTING.
METHODS zero_quantity FOR TESTING.
METHODS negative_quantity FOR TESTING.
METHODS unknown_code FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_hidden IMPLEMENTATION.
METHOD deposit_for.
CALL FUNCTION '{{P}}DEP_CALC'
EXPORTING
iv_code = iv_code
iv_quantity = iv_quantity
iv_damaged = iv_damaged
IMPORTING
ev_deposit = rv_deposit
EXCEPTIONS
invalid_quantity = 1
invalid_container = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD crate_a_full.
DATA lv_exp TYPE decfloat34 VALUE '3.00'.
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = deposit_for( iv_code = 'A' iv_quantity = 2 ) ).
ENDMETHOD.
METHOD crate_b_full.
DATA lv_exp TYPE decfloat34 VALUE '3.00'.
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = deposit_for( iv_code = 'B' iv_quantity = 1 ) ).
ENDMETHOD.
METHOD glass_full.
DATA lv_exp TYPE decfloat34 VALUE '0.80'.
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = deposit_for( iv_code = 'G' iv_quantity = 10 ) ).
ENDMETHOD.
METHOD pet_full.
DATA lv_exp TYPE decfloat34 VALUE '1.00'.
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = deposit_for( iv_code = 'P' iv_quantity = 4 ) ).
ENDMETHOD.
METHOD damaged_crate.
DATA lv_exp TYPE decfloat34 VALUE '3.00'.
DATA lv_act TYPE decfloat34.
lv_act = deposit_for( iv_code = 'B' iv_quantity = 2 iv_damaged = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD damaged_rounds_up.
DATA lv_exp TYPE decfloat34 VALUE '0.39'.
DATA lv_act TYPE decfloat34.
lv_act = deposit_for( iv_code = 'P' iv_quantity = 3 iv_damaged = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD damaged_glass_total.
DATA lv_exp TYPE decfloat34 VALUE '0.12'.
DATA lv_act TYPE decfloat34.
lv_act = deposit_for( iv_code = 'G' iv_quantity = 3 iv_damaged = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD zero_quantity.
DATA lv_deposit TYPE decfloat34.
CALL FUNCTION '{{P}}DEP_CALC'
EXPORTING
iv_code = 'A'
iv_quantity = 0
iv_damaged = abap_false
IMPORTING
ev_deposit = lv_deposit
EXCEPTIONS
invalid_quantity = 1
invalid_container = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
METHOD negative_quantity.
DATA lv_deposit TYPE decfloat34.
CALL FUNCTION '{{P}}DEP_CALC'
EXPORTING
iv_code = 'G'
iv_quantity = -3
iv_damaged = abap_false
IMPORTING
ev_deposit = lv_deposit
EXCEPTIONS
invalid_quantity = 1
invalid_container = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
METHOD unknown_code.
DATA lv_deposit TYPE decfloat34.
CALL FUNCTION '{{P}}DEP_CALC'
EXPORTING
iv_code = 'Z'
iv_quantity = 1
iv_damaged = abap_false
IMPORTING
ev_deposit = lv_deposit
EXCEPTIONS
invalid_quantity = 1
invalid_container = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_equals( exp = 2 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,72 @@
{
"task": "G0157",
"mutants": [
{
"object": "{{P}}DEP_CALC",
"mutant": "line 14: < -> >= (rel)",
"status": "killed",
"hidden": "0/10",
"failed_tests": [
"CRATE_A_FULL",
"CRATE_B_FULL",
"DAMAGED_CRATE",
"DAMAGED_GLASS_TOTAL",
"DAMAGED_ROUNDS_UP",
"GLASS_FULL",
"NEGATIVE_QUANTITY",
"PET_FULL",
"UNKNOWN_CODE",
"ZERO_QUANTITY"
]
},
{
"object": "{{P}}DEP_CALC",
"mutant": "line 31: abap_true -> abap_false (bool)",
"status": "killed",
"hidden": "3/10",
"failed_tests": [
"CRATE_A_FULL",
"CRATE_B_FULL",
"DAMAGED_CRATE",
"DAMAGED_GLASS_TOTAL",
"DAMAGED_ROUNDS_UP",
"GLASS_FULL",
"PET_FULL"
]
},
{
"object": "{{P}}DEP_CALC",
"mutant": "line 33: 2 -> 3 (const)",
"status": "killed",
"hidden": "9/10",
"failed_tests": [
"DAMAGED_ROUNDS_UP"
]
},
{
"object": "{{P}}DEP_CALC",
"mutant": "line 36: * -> / (arith)",
"status": "killed",
"hidden": "4/10",
"failed_tests": [
"CRATE_A_FULL",
"DAMAGED_CRATE",
"DAMAGED_GLASS_TOTAL",
"DAMAGED_ROUNDS_UP",
"GLASS_FULL",
"PET_FULL"
]
},
{
"object": "{{P}}DEP_CALC",
"mutant": "line 36: 2 -> 3 (const)",
"status": "survived",
"hidden": "10/10",
"failed_tests": []
}
],
"valid": 5,
"killed": 4,
"kill_rate": 0.8,
"ok": true
}

View File

@@ -0,0 +1,38 @@
FUNCTION {{p}}dep_calc
IMPORTING
iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool
EXPORTING
ev_deposit TYPE decfloat34
EXCEPTIONS
invalid_quantity
invalid_container.
DATA lv_unit TYPE decfloat34.
IF iv_quantity < 1.
RAISE invalid_quantity.
ENDIF.
CASE iv_code.
WHEN 'A'.
lv_unit = '1.50'.
WHEN 'B'.
lv_unit = '3.00'.
WHEN 'G'.
lv_unit = '0.08'.
WHEN 'P'.
lv_unit = '0.25'.
WHEN OTHERS.
RAISE invalid_container.
ENDCASE.
IF iv_damaged = abap_true.
lv_unit = lv_unit / 2.
lv_unit = round( val = lv_unit dec = 2 mode = cl_abap_math=>round_half_up ).
ENDIF.
ev_deposit = round( val = lv_unit * iv_quantity dec = 2 mode = cl_abap_math=>round_half_up ).
ENDFUNCTION.

View File

@@ -0,0 +1,58 @@
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS deposit_of
IMPORTING iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(rv_deposit) TYPE decfloat34.
METHODS full_deposit FOR TESTING.
METHODS damaged_deposit FOR TESTING.
METHODS invalid_input FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_test IMPLEMENTATION.
METHOD deposit_of.
CALL FUNCTION '{{P}}DEP_CALC'
EXPORTING
iv_code = iv_code
iv_quantity = iv_quantity
iv_damaged = iv_damaged
IMPORTING
ev_deposit = rv_deposit
EXCEPTIONS
invalid_quantity = 1
invalid_container = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD full_deposit.
DATA lv_exp TYPE decfloat34 VALUE '6.00'.
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = deposit_of( iv_code = 'B' iv_quantity = 2 ) ).
ENDMETHOD.
METHOD damaged_deposit.
DATA lv_exp TYPE decfloat34 VALUE '0.39'.
DATA lv_act TYPE decfloat34.
lv_act = deposit_of( iv_code = 'P' iv_quantity = 3 iv_damaged = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
ENDMETHOD.
METHOD invalid_input.
DATA lv_deposit TYPE decfloat34.
CALL FUNCTION '{{P}}DEP_CALC'
EXPORTING
iv_code = 'Z'
iv_quantity = 1
iv_damaged = abap_false
IMPORTING
ev_deposit = lv_deposit
EXCEPTIONS
invalid_quantity = 1
invalid_container = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_equals( exp = 2 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,18 @@
FUNCTION {{p}}dep_sample
IMPORTING
iv_code TYPE c
iv_quantity TYPE i
iv_damaged TYPE abap_bool
EXPORTING
ev_deposit TYPE decfloat34
EXCEPTIONS
invalid_quantity
invalid_container.
IF iv_quantity < 1.
RAISE invalid_quantity.
ENDIF.
ev_deposit = iv_quantity.
ENDFUNCTION.

View File

@@ -0,0 +1,45 @@
# 1. Goal
A beverage wholesaler takes back empty containers from its customers. The returns
program calls one function module for each return line. The function module
calculates the deposit that the wholesaler pays back to the customer.
# 2. Open questions
None.
# 3. Context
- Function group {{P}}FG_DEPOSIT exists in package $TMP.
- Function module {{P}}DEP_SAMPLE exists in this group. It is the sample deposit
module. The returns program calls all deposit modules with the interface of
{{P}}DEP_SAMPLE.
# 4. Contract
- Create the function module {{P}}DEP_CALC in function group {{P}}FG_DEPOSIT.
- Use exactly the interface of {{P}}DEP_SAMPLE:
- IMPORTING iv_code TYPE c
- IMPORTING iv_quantity TYPE i
- IMPORTING iv_damaged TYPE abap_bool
- EXPORTING ev_deposit TYPE decfloat34
- EXCEPTIONS invalid_quantity, invalid_container
# 5. Business rules
1. If the quantity is less than 1, raise the exception INVALID_QUANTITY.
2. The container code gives the deposit of one container:
- 'A': crate with 12 glass bottles, 1.50
- 'B': crate with 20 PET bottles, 3.00
- 'G': single glass bottle, 0.08
- 'P': single PET bottle, 0.25
3. Any other container code raises the exception INVALID_CONTAINER.
4. If the container is damaged, the deposit of one container is half of the value
in rule 2, rounded half up to 2 decimals.
5. The deposit of the return line is the deposit of one container multiplied by
the quantity, rounded half up to 2 decimals.
# 6. Constraints
- Release target: 7.40 SP05. Use only language elements that this release supports.
- Coding standards: Clean ABAP.
- Out of scope: do not change {{P}}DEP_SAMPLE.
# 7. Acceptance
- The function module {{P}}DEP_CALC is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests for the function module in a global test class.

View File

@@ -0,0 +1,80 @@
{
"id": "G0157",
"category": "G",
"object_type": "FUNC",
"difficulty": 2,
"release_target": "v740sp05",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 40,
"max_activations": 10
},
"seed": [
{
"type": "FUGR",
"name": "{{P}}FG_DEPOSIT",
"description": "Deposit calculation function group"
},
{
"type": "FUNC",
"name": "{{P}}DEP_SAMPLE",
"functionGroup": "{{P}}FG_DEPOSIT",
"file": "seed/dep_sample.func.abap",
"description": "Sample deposit module"
}
],
"contract": [
{
"type": "FUNC",
"name": "{{P}}DEP_CALC",
"functionGroup": "{{P}}FG_DEPOSIT",
"params": [
{
"name": "iv_code",
"type": "c"
},
{
"name": "iv_quantity",
"type": "i"
},
{
"name": "iv_damaged",
"type": "abap_bool"
},
{
"name": "ev_deposit",
"type": "decfloat34"
}
]
}
],
"out_of_scope": [
"{{P}}DEP_SAMPLE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T14_HIDDEN",
"file": "hidden/t14_hidden.clas.abap",
"description": "T14 hidden tests"
}
],
"reference": [
{
"type": "FUNC",
"name": "{{P}}DEP_CALC",
"functionGroup": "{{P}}FG_DEPOSIT",
"file": "reference/dep_calc.func.abap",
"description": "Deposit calculation module"
},
{
"type": "CLAS",
"name": "{{P}}T14_TEST",
"file": "reference/t14_test.clas.abap",
"description": "T14 own tests"
}
],
"craft_checks": [
"method_length"
]
}