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:
44
tasks_gen/eval/G0151/faulty/m0_groom_fee.func.abap
Normal file
44
tasks_gen/eval/G0151/faulty/m0_groom_fee.func.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
FUNCTION {{p}}groom_fee
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
DATA lv_base TYPE decfloat34.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
CASE iv_size.
|
||||
WHEN 'S'.
|
||||
lv_base = '26.50'.
|
||||
WHEN 'M'.
|
||||
lv_base = '42.50'.
|
||||
WHEN 'L'.
|
||||
lv_base = '64.50'.
|
||||
WHEN OTHERS.
|
||||
RAISE invalid_size.
|
||||
ENDCASE.
|
||||
|
||||
IF iv_channel = 'PARTNER'.
|
||||
ev_skip = abap_false.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_base.
|
||||
IF iv_long_hair = abap_true.
|
||||
cv_fee = cv_fee + round( val = lv_base * 15 / 100
|
||||
dec = 2
|
||||
mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
IF iv_weekend = abap_true.
|
||||
cv_fee = cv_fee + 10.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
44
tasks_gen/eval/G0151/faulty/m1_groom_fee.func.abap
Normal file
44
tasks_gen/eval/G0151/faulty/m1_groom_fee.func.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
FUNCTION {{p}}groom_fee
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
DATA lv_base TYPE decfloat34.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
CASE iv_size.
|
||||
WHEN 'S'.
|
||||
lv_base = '26.50'.
|
||||
WHEN 'M'.
|
||||
lv_base = '42.50'.
|
||||
WHEN 'L'.
|
||||
lv_base = '64.50'.
|
||||
WHEN OTHERS.
|
||||
RAISE invalid_size.
|
||||
ENDCASE.
|
||||
|
||||
IF iv_channel = 'PARTNER'.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_base.
|
||||
IF iv_long_hair = abap_false.
|
||||
cv_fee = cv_fee + round( val = lv_base * 15 / 100
|
||||
dec = 2
|
||||
mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
IF iv_weekend = abap_true.
|
||||
cv_fee = cv_fee + 10.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
44
tasks_gen/eval/G0151/faulty/m2_groom_fee.func.abap
Normal file
44
tasks_gen/eval/G0151/faulty/m2_groom_fee.func.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
FUNCTION {{p}}groom_fee
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
DATA lv_base TYPE decfloat34.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
CASE iv_size.
|
||||
WHEN 'S'.
|
||||
lv_base = '26.50'.
|
||||
WHEN 'M'.
|
||||
lv_base = '42.50'.
|
||||
WHEN 'L'.
|
||||
lv_base = '64.50'.
|
||||
WHEN OTHERS.
|
||||
RAISE invalid_size.
|
||||
ENDCASE.
|
||||
|
||||
IF iv_channel = 'PARTNER'.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_base.
|
||||
IF iv_long_hair = abap_true.
|
||||
cv_fee = cv_fee - round( val = lv_base * 15 / 100
|
||||
dec = 2
|
||||
mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
IF iv_weekend = abap_true.
|
||||
cv_fee = cv_fee + 10.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
44
tasks_gen/eval/G0151/faulty/m3_groom_fee.func.abap
Normal file
44
tasks_gen/eval/G0151/faulty/m3_groom_fee.func.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
FUNCTION {{p}}groom_fee
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
DATA lv_base TYPE decfloat34.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
CASE iv_size.
|
||||
WHEN 'S'.
|
||||
lv_base = '26.50'.
|
||||
WHEN 'M'.
|
||||
lv_base = '42.50'.
|
||||
WHEN 'L'.
|
||||
lv_base = '64.50'.
|
||||
WHEN OTHERS.
|
||||
RAISE invalid_size.
|
||||
ENDCASE.
|
||||
|
||||
IF iv_channel = 'PARTNER'.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_base.
|
||||
IF iv_long_hair = abap_true.
|
||||
cv_fee = cv_fee + round( val = lv_base * 15 / 100
|
||||
dec = 3
|
||||
mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
IF iv_weekend = abap_true.
|
||||
cv_fee = cv_fee + 10.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
44
tasks_gen/eval/G0151/faulty/m4_groom_fee.func.abap
Normal file
44
tasks_gen/eval/G0151/faulty/m4_groom_fee.func.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
FUNCTION {{p}}groom_fee
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
DATA lv_base TYPE decfloat34.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
CASE iv_size.
|
||||
WHEN 'S'.
|
||||
lv_base = '26.50'.
|
||||
WHEN 'M'.
|
||||
lv_base = '42.50'.
|
||||
WHEN 'L'.
|
||||
lv_base = '64.50'.
|
||||
WHEN OTHERS.
|
||||
RAISE invalid_size.
|
||||
ENDCASE.
|
||||
|
||||
IF iv_channel = 'PARTNER'.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_base.
|
||||
IF iv_long_hair = abap_true.
|
||||
cv_fee = cv_fee + round( val = lv_base * 15 / 100
|
||||
dec = 2
|
||||
mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
IF iv_weekend <> abap_true.
|
||||
cv_fee = cv_fee + 10.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
19
tasks_gen/eval/G0151/generation.json
Normal file
19
tasks_gen/eval/G0151/generation.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "G0151",
|
||||
"pool": "eval",
|
||||
"object_type": "FUNC",
|
||||
"category": "F",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
108
tasks_gen/eval/G0151/hidden/t14_hidden.clas.abap
Normal file
108
tasks_gen/eval/G0151/hidden/t14_hidden.clas.abap
Normal file
@@ -0,0 +1,108 @@
|
||||
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
iv_fee TYPE decfloat34 DEFAULT 7
|
||||
EXPORTING ev_skip TYPE abap_bool
|
||||
ev_fee TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS small_base FOR TESTING.
|
||||
METHODS medium_base FOR TESTING.
|
||||
METHODS large_base FOR TESTING.
|
||||
METHODS long_hair_surcharge FOR TESTING.
|
||||
METHODS weekend_surcharge FOR TESTING.
|
||||
METHODS combined_surcharges FOR TESTING.
|
||||
METHODS partner_skips FOR TESTING.
|
||||
METHODS invalid_size FOR TESTING.
|
||||
METHODS skip_false_for_shop FOR TESTING.
|
||||
METHODS partner_invalid_size FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
ev_fee = iv_fee.
|
||||
CALL FUNCTION '{{P}}GROOM_FEE'
|
||||
EXPORTING
|
||||
iv_size = iv_size
|
||||
iv_long_hair = iv_long_hair
|
||||
iv_weekend = iv_weekend
|
||||
iv_channel = iv_channel
|
||||
IMPORTING
|
||||
ev_skip = ev_skip
|
||||
CHANGING
|
||||
cv_fee = ev_fee
|
||||
EXCEPTIONS
|
||||
invalid_size = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD small_base.
|
||||
call( EXPORTING iv_size = `S` iv_long_hair = abap_false iv_weekend = abap_false iv_channel = `SHOP`
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '26.50' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD medium_base.
|
||||
call( EXPORTING iv_size = `M` iv_long_hair = abap_false iv_weekend = abap_false iv_channel = `WEB`
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '42.50' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD large_base.
|
||||
call( EXPORTING iv_size = `L` iv_long_hair = abap_false iv_weekend = abap_false iv_channel = `SHOP`
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '64.50' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD long_hair_surcharge.
|
||||
" 26.50 + 15 % of 26.50 = 26.50 + 3.98
|
||||
call( EXPORTING iv_size = `S` iv_long_hair = abap_true iv_weekend = abap_false iv_channel = `SHOP`
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '30.48' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD weekend_surcharge.
|
||||
call( EXPORTING iv_size = `M` iv_long_hair = abap_false iv_weekend = abap_true iv_channel = `SHOP`
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '52.50' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD combined_surcharges.
|
||||
" 64.50 + 15 % of 64.50 = 64.50 + 9.68, plus 10.00
|
||||
call( EXPORTING iv_size = `L` iv_long_hair = abap_true iv_weekend = abap_true iv_channel = `WEB`
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '84.18' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD partner_skips.
|
||||
call( EXPORTING iv_size = `M` iv_long_hair = abap_false iv_weekend = abap_false
|
||||
iv_channel = `PARTNER` iv_fee = 7
|
||||
IMPORTING ev_skip = DATA(lv_skip) ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 7 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_size.
|
||||
call( EXPORTING iv_size = `X` iv_long_hair = abap_false iv_weekend = abap_false iv_channel = `SHOP`
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD skip_false_for_shop.
|
||||
call( EXPORTING iv_size = `S` iv_long_hair = abap_false iv_weekend = abap_false iv_channel = `SHOP`
|
||||
IMPORTING ev_skip = DATA(lv_skip) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD partner_invalid_size.
|
||||
call( EXPORTING iv_size = `X` iv_long_hair = abap_false iv_weekend = abap_false iv_channel = `PARTNER`
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
66
tasks_gen/eval/G0151/mutation.json
Normal file
66
tasks_gen/eval/G0151/mutation.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"task": "G0151",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}GROOM_FEE",
|
||||
"mutant": "line 30: abap_true -> abap_false (bool)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"PARTNER_SKIPS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}GROOM_FEE",
|
||||
"mutant": "line 35: abap_true -> abap_false (bool)",
|
||||
"status": "killed",
|
||||
"hidden": "4/10",
|
||||
"failed_tests": [
|
||||
"COMBINED_SURCHARGES",
|
||||
"LARGE_BASE",
|
||||
"LONG_HAIR_SURCHARGE",
|
||||
"MEDIUM_BASE",
|
||||
"SMALL_BASE",
|
||||
"WEEKEND_SURCHARGE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}GROOM_FEE",
|
||||
"mutant": "line 36: + -> - (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "8/10",
|
||||
"failed_tests": [
|
||||
"COMBINED_SURCHARGES",
|
||||
"LONG_HAIR_SURCHARGE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}GROOM_FEE",
|
||||
"mutant": "line 37: 2 -> 3 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "8/10",
|
||||
"failed_tests": [
|
||||
"COMBINED_SURCHARGES",
|
||||
"LONG_HAIR_SURCHARGE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}GROOM_FEE",
|
||||
"mutant": "line 40: = -> <> (eq)",
|
||||
"status": "killed",
|
||||
"hidden": "4/10",
|
||||
"failed_tests": [
|
||||
"COMBINED_SURCHARGES",
|
||||
"LARGE_BASE",
|
||||
"LONG_HAIR_SURCHARGE",
|
||||
"MEDIUM_BASE",
|
||||
"SMALL_BASE",
|
||||
"WEEKEND_SURCHARGE"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
44
tasks_gen/eval/G0151/reference/groom_fee.func.abap
Normal file
44
tasks_gen/eval/G0151/reference/groom_fee.func.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
FUNCTION {{p}}groom_fee
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
DATA lv_base TYPE decfloat34.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
CASE iv_size.
|
||||
WHEN 'S'.
|
||||
lv_base = '26.50'.
|
||||
WHEN 'M'.
|
||||
lv_base = '42.50'.
|
||||
WHEN 'L'.
|
||||
lv_base = '64.50'.
|
||||
WHEN OTHERS.
|
||||
RAISE invalid_size.
|
||||
ENDCASE.
|
||||
|
||||
IF iv_channel = 'PARTNER'.
|
||||
ev_skip = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
cv_fee = lv_base.
|
||||
IF iv_long_hair = abap_true.
|
||||
cv_fee = cv_fee + round( val = lv_base * 15 / 100
|
||||
dec = 2
|
||||
mode = cl_abap_math=>round_half_up ).
|
||||
ENDIF.
|
||||
IF iv_weekend = abap_true.
|
||||
cv_fee = cv_fee + 10.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
86
tasks_gen/eval/G0151/reference/t14_test.clas.abap
Normal file
86
tasks_gen/eval/G0151/reference/t14_test.clas.abap
Normal file
@@ -0,0 +1,86 @@
|
||||
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS fee_for
|
||||
IMPORTING iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
RETURNING VALUE(rv_fee) TYPE decfloat34.
|
||||
METHODS base_fee FOR TESTING.
|
||||
METHODS surcharges FOR TESTING.
|
||||
METHODS partner_channel FOR TESTING.
|
||||
METHODS invalid_size FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_test IMPLEMENTATION.
|
||||
METHOD fee_for.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
CALL FUNCTION '{{P}}GROOM_FEE'
|
||||
EXPORTING
|
||||
iv_size = iv_size
|
||||
iv_long_hair = iv_long_hair
|
||||
iv_weekend = iv_weekend
|
||||
iv_channel = iv_channel
|
||||
IMPORTING
|
||||
ev_skip = lv_skip
|
||||
CHANGING
|
||||
cv_fee = rv_fee
|
||||
EXCEPTIONS
|
||||
invalid_size = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_fee.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '42.50' )
|
||||
act = fee_for( iv_size = `M` iv_long_hair = abap_false
|
||||
iv_weekend = abap_false iv_channel = `SHOP` ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD surcharges.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '30.48' )
|
||||
act = fee_for( iv_size = `S` iv_long_hair = abap_true
|
||||
iv_weekend = abap_false iv_channel = `SHOP` ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '52.50' )
|
||||
act = fee_for( iv_size = `M` iv_long_hair = abap_false
|
||||
iv_weekend = abap_true iv_channel = `SHOP` ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD partner_channel.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
DATA lv_fee TYPE decfloat34 VALUE 5.
|
||||
CALL FUNCTION '{{P}}GROOM_FEE'
|
||||
EXPORTING
|
||||
iv_size = `L`
|
||||
iv_long_hair = abap_false
|
||||
iv_weekend = abap_false
|
||||
iv_channel = `PARTNER`
|
||||
IMPORTING
|
||||
ev_skip = lv_skip
|
||||
CHANGING
|
||||
cv_fee = lv_fee.
|
||||
cl_abap_unit_assert=>assert_true( lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 5 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_size.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
CALL FUNCTION '{{P}}GROOM_FEE'
|
||||
EXPORTING
|
||||
iv_size = `XL`
|
||||
iv_long_hair = abap_false
|
||||
iv_weekend = abap_false
|
||||
iv_channel = `SHOP`
|
||||
CHANGING
|
||||
cv_fee = lv_fee
|
||||
EXCEPTIONS
|
||||
invalid_size = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
16
tasks_gen/eval/G0151/seed/groom_sample.func.abap
Normal file
16
tasks_gen/eval/G0151/seed/groom_sample.func.abap
Normal file
@@ -0,0 +1,16 @@
|
||||
FUNCTION {{p}}groom_sample
|
||||
IMPORTING
|
||||
iv_size TYPE string
|
||||
iv_long_hair TYPE abap_bool
|
||||
iv_weekend TYPE abap_bool
|
||||
iv_channel TYPE string
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_size.
|
||||
|
||||
ev_skip = abap_false.
|
||||
|
||||
ENDFUNCTION.
|
||||
40
tasks_gen/eval/G0151/spec.md
Normal file
40
tasks_gen/eval/G0151/spec.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# 1. Goal
|
||||
Calculate the fee of a grooming appointment. A booking program calls one event
|
||||
module for each appointment. The event module must have the same interface as the
|
||||
sample event module, because the booking program calls all event modules in the
|
||||
same way.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Function group {{P}}FG_GROOM exists in package $TMP.
|
||||
- Function module {{P}}GROOM_SAMPLE exists in this group. It is the sample event
|
||||
module. Its interface is the interface that all event modules must use.
|
||||
|
||||
# 4. Contract
|
||||
- Create the function module {{P}}GROOM_FEE in function group {{P}}FG_GROOM.
|
||||
- Use exactly the interface of {{P}}GROOM_SAMPLE: the same parameter names, kinds,
|
||||
types, and exceptions.
|
||||
|
||||
# 5. Business rules
|
||||
1. If the size is not one of 'S', 'M' or 'L', raise the exception INVALID_SIZE.
|
||||
This check applies to every channel.
|
||||
2. Set the skip flag to false.
|
||||
3. If the channel is 'PARTNER', set the skip flag to true and do not change the
|
||||
fee. Rules 4 to 7 do not apply.
|
||||
4. The base fee depends on the size: S = 26.50, M = 42.50, L = 64.50.
|
||||
5. If the hair is long, add 15 % of the base fee. Round the surcharge half up to
|
||||
2 decimals.
|
||||
6. If the appointment is on a weekend, add 10.00.
|
||||
7. The fee is the base fee plus the surcharges of rules 5 and 6.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP.
|
||||
- Out of scope: do not change {{P}}GROOM_SAMPLE.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests for the function module in a global test class.
|
||||
88
tasks_gen/eval/G0151/task.json
Normal file
88
tasks_gen/eval/G0151/task.json
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"id": "G0151",
|
||||
"category": "F",
|
||||
"object_type": "FUNC",
|
||||
"difficulty": 2,
|
||||
"release_target": "v758",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "FUGR",
|
||||
"name": "{{P}}FG_GROOM",
|
||||
"description": "Grooming fee events"
|
||||
},
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}GROOM_SAMPLE",
|
||||
"functionGroup": "{{P}}FG_GROOM",
|
||||
"file": "seed/groom_sample.func.abap",
|
||||
"description": "Sample grooming event module"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}GROOM_FEE",
|
||||
"functionGroup": "{{P}}FG_GROOM",
|
||||
"params": [
|
||||
{
|
||||
"name": "iv_size",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "iv_long_hair",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "iv_weekend",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "iv_channel",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "ev_skip",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "cv_fee",
|
||||
"type": "decfloat34"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}GROOM_SAMPLE"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T14_HIDDEN",
|
||||
"file": "hidden/t14_hidden.clas.abap",
|
||||
"description": "T14 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}GROOM_FEE",
|
||||
"functionGroup": "{{P}}FG_GROOM",
|
||||
"file": "reference/groom_fee.func.abap",
|
||||
"description": "Grooming fee event module"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T14_TEST",
|
||||
"file": "reference/t14_test.clas.abap",
|
||||
"description": "T14 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user