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:
14
tasks_gen/eval/G0172/generation.json
Normal file
14
tasks_gen/eval/G0172/generation.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "G0172",
|
||||
"pool": "eval",
|
||||
"object_type": "FUNC",
|
||||
"category": "H",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100,
|
||||
"null": 30
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
40
tasks_gen/eval/G0172/reference/sort_bin.func.abap
Normal file
40
tasks_gen/eval/G0172/reference/sort_bin.func.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
FUNCTION {{p}}sort_bin
|
||||
IMPORTING
|
||||
iv_size_code TYPE string
|
||||
iv_weight_kg TYPE decfloat34
|
||||
EXPORTING
|
||||
ev_bin TYPE i
|
||||
ev_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_weight
|
||||
overweight.
|
||||
|
||||
IF iv_weight_kg <= 0.
|
||||
RAISE invalid_weight.
|
||||
ENDIF.
|
||||
|
||||
IF iv_weight_kg > '31.5'.
|
||||
RAISE overweight.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_size_code.
|
||||
WHEN 'S'.
|
||||
ev_bin = 1.
|
||||
ev_fee = '1.50'.
|
||||
WHEN 'M'.
|
||||
ev_bin = 2.
|
||||
ev_fee = '2.00'.
|
||||
WHEN 'L'.
|
||||
ev_bin = 3.
|
||||
ev_fee = '3.00'.
|
||||
WHEN 'XL'.
|
||||
ev_bin = 4.
|
||||
ev_fee = '5.00'.
|
||||
WHEN OTHERS.
|
||||
" The specification does not define this case. The assumption here is
|
||||
" that the sorting centre rejects the parcel.
|
||||
ev_bin = 0.
|
||||
ev_fee = 0.
|
||||
ENDCASE.
|
||||
|
||||
ENDFUNCTION.
|
||||
62
tasks_gen/eval/G0172/reference/sort_bin_test.clas.abap
Normal file
62
tasks_gen/eval/G0172/reference/sort_bin_test.clas.abap
Normal file
@@ -0,0 +1,62 @@
|
||||
CLASS {{p}}sort_bin_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_code TYPE string
|
||||
iv_weight TYPE decfloat34
|
||||
EXPORTING
|
||||
ev_bin TYPE i
|
||||
ev_fee TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS small_parcel FOR TESTING.
|
||||
METHODS extra_large_parcel FOR TESTING.
|
||||
METHODS overweight_rejected FOR TESTING.
|
||||
METHODS zero_weight_rejected FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}sort_bin_test IMPLEMENTATION.
|
||||
|
||||
METHOD call.
|
||||
CALL FUNCTION '{{P}}SORT_BIN'
|
||||
EXPORTING
|
||||
iv_size_code = iv_code
|
||||
iv_weight_kg = iv_weight
|
||||
IMPORTING
|
||||
ev_bin = ev_bin
|
||||
ev_fee = ev_fee
|
||||
EXCEPTIONS
|
||||
invalid_weight = 1
|
||||
overweight = 2
|
||||
OTHERS = 3.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD small_parcel.
|
||||
call( EXPORTING iv_code = `S` iv_weight = '2.5'
|
||||
IMPORTING ev_bin = DATA(lv_bin) ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_bin ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1.50' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD extra_large_parcel.
|
||||
call( EXPORTING iv_code = `XL` iv_weight = '30'
|
||||
IMPORTING ev_bin = DATA(lv_bin) ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_bin ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '5.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD overweight_rejected.
|
||||
call( EXPORTING iv_code = `M` iv_weight = '32'
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_weight_rejected.
|
||||
call( EXPORTING iv_code = `S` iv_weight = 0
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
20
tasks_gen/eval/G0172/seed/sort_text.func.abap
Normal file
20
tasks_gen/eval/G0172/seed/sort_text.func.abap
Normal file
@@ -0,0 +1,20 @@
|
||||
FUNCTION {{p}}sort_text
|
||||
IMPORTING
|
||||
iv_bin TYPE i
|
||||
EXPORTING
|
||||
ev_text TYPE string.
|
||||
|
||||
CASE iv_bin.
|
||||
WHEN 1.
|
||||
ev_text = 'Small'.
|
||||
WHEN 2.
|
||||
ev_text = 'Medium'.
|
||||
WHEN 3.
|
||||
ev_text = 'Large'.
|
||||
WHEN 4.
|
||||
ev_text = 'Extra large'.
|
||||
WHEN OTHERS.
|
||||
ev_text = 'Unknown bin'.
|
||||
ENDCASE.
|
||||
|
||||
ENDFUNCTION.
|
||||
48
tasks_gen/eval/G0172/spec.md
Normal file
48
tasks_gen/eval/G0172/spec.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# 1. Goal
|
||||
A parcel sorting centre needs one function module. The function module
|
||||
calculates the destination bin and the handling fee of a parcel. The sorting
|
||||
program calls the function module for each parcel before the parcel goes to a
|
||||
bin.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Function group {{P}}FG_SORT exists in package $TMP.
|
||||
- Function module {{P}}SORT_TEXT exists in this function group. It gives the
|
||||
text of a bin number.
|
||||
- The sorting centre receives parcels from many shops. Some parcels have a size
|
||||
code that the sorting centre does not know. The sorting program calls the
|
||||
function module for these parcels too.
|
||||
|
||||
# 4. Contract
|
||||
- Create the function module {{P}}SORT_BIN in function group {{P}}FG_SORT.
|
||||
- Interface of {{P}}SORT_BIN:
|
||||
- iv_size_code TYPE string (importing)
|
||||
- iv_weight_kg TYPE decfloat34 (importing)
|
||||
- ev_bin TYPE i (exporting)
|
||||
- ev_fee TYPE decfloat34 (exporting)
|
||||
- Exceptions: invalid_weight, overweight
|
||||
- The function module has no other parameters.
|
||||
|
||||
# 5. Business rules
|
||||
1. If the weight is less than or equal to 0, raise the exception INVALID_WEIGHT.
|
||||
In this case, do not set the bin and do not set the fee.
|
||||
2. If the weight is greater than 31.5, raise the exception OVERWEIGHT. In this
|
||||
case, do not set the bin and do not set the fee.
|
||||
3. Size code 'S': the bin is 1. The fee is 1.50 euro.
|
||||
4. Size code 'M': the bin is 2. The fee is 2.00 euro.
|
||||
5. Size code 'L': the bin is 3. The fee is 3.00 euro.
|
||||
6. Size code 'XL': the bin is 4. The fee is 5.00 euro.
|
||||
7. The fee has two decimals.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: SAP_BASIS 816.
|
||||
- Package: $TMP. Do not use transports.
|
||||
- Out of scope: do not change {{P}}SORT_TEXT.
|
||||
- Use Clean ABAP. Pass large parameters by reference.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module is active and has no syntax error.
|
||||
- Write ABAP Unit tests for the function module in a global test class.
|
||||
- The hidden tests pass.
|
||||
94
tasks_gen/eval/G0172/task.json
Normal file
94
tasks_gen/eval/G0172/task.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"id": "G0172",
|
||||
"category": "H",
|
||||
"object_type": "FUNC",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "stop",
|
||||
"expected_gap": {
|
||||
"description": "The business rules define the bin and the fee for the size codes S, M, L and XL, but they do not define what the function module must do for any other size code.",
|
||||
"keywords": [
|
||||
[
|
||||
"unknown",
|
||||
"code"
|
||||
],
|
||||
[
|
||||
"other",
|
||||
"code"
|
||||
],
|
||||
[
|
||||
"not",
|
||||
"defined"
|
||||
],
|
||||
[
|
||||
"no",
|
||||
"rule"
|
||||
]
|
||||
]
|
||||
},
|
||||
"budget": {
|
||||
"max_tool_calls": 25,
|
||||
"max_activations": 6
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "FUGR",
|
||||
"name": "{{P}}FG_SORT",
|
||||
"description": "Parcel sorting"
|
||||
},
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}SORT_TEXT",
|
||||
"functionGroup": "{{P}}FG_SORT",
|
||||
"file": "seed/sort_text.func.abap",
|
||||
"description": "Text of a bin number"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}SORT_BIN",
|
||||
"functionGroup": "{{P}}FG_SORT",
|
||||
"params": [
|
||||
{
|
||||
"name": "iv_size_code",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "iv_weight_kg",
|
||||
"type": "decfloat34"
|
||||
},
|
||||
{
|
||||
"name": "ev_bin",
|
||||
"type": "i"
|
||||
},
|
||||
{
|
||||
"name": "ev_fee",
|
||||
"type": "decfloat34"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}SORT_TEXT"
|
||||
],
|
||||
"hidden_tests": [],
|
||||
"reference": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}SORT_BIN",
|
||||
"functionGroup": "{{P}}FG_SORT",
|
||||
"file": "reference/sort_bin.func.abap",
|
||||
"description": "Parcel sorting function module"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SORT_BIN_TEST",
|
||||
"file": "reference/sort_bin_test.clas.abap",
|
||||
"description": "Own tests for {{P}}SORT_BIN"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user