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:
45
tasks_gen/eval/G0152/faulty/m0_trl_price.func.abap
Normal file
45
tasks_gen/eval/G0152/faulty/m0_trl_price.func.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
FUNCTION {{p}}trl_price
|
||||
IMPORTING
|
||||
iv_source_lang TYPE string
|
||||
iv_target_lang TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_words.
|
||||
|
||||
IF iv_words < 0.
|
||||
RAISE invalid_words.
|
||||
ENDIF.
|
||||
|
||||
IF iv_words = 0.
|
||||
ev_price = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
IF ( iv_source_lang = 'EN' AND iv_target_lang = 'DE' )
|
||||
AND ( iv_source_lang = 'DE' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.12'.
|
||||
ELSEIF ( iv_source_lang = 'EN' AND iv_target_lang = 'FR' )
|
||||
OR ( iv_source_lang = 'FR' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.15'.
|
||||
ELSE.
|
||||
lv_rate = '0.20'.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_amount TYPE decfloat34.
|
||||
lv_amount = iv_words * lv_rate.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
lv_amount = lv_amount * '1.25'.
|
||||
ENDIF.
|
||||
|
||||
ev_price = round( val = lv_amount dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
IF ev_price < 25.
|
||||
ev_price = 25.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
45
tasks_gen/eval/G0152/faulty/m2_trl_price.func.abap
Normal file
45
tasks_gen/eval/G0152/faulty/m2_trl_price.func.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
FUNCTION {{p}}trl_price
|
||||
IMPORTING
|
||||
iv_source_lang TYPE string
|
||||
iv_target_lang TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_words.
|
||||
|
||||
IF iv_words < 0.
|
||||
RAISE invalid_words.
|
||||
ENDIF.
|
||||
|
||||
IF iv_words = 0.
|
||||
ev_price = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
IF ( iv_source_lang = 'EN' AND iv_target_lang = 'DE' )
|
||||
OR ( iv_source_lang = 'DE' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.12'.
|
||||
ELSEIF ( iv_source_lang = 'EN' AND iv_target_lang = 'FR' )
|
||||
OR ( iv_source_lang = 'FR' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.15'.
|
||||
ELSE.
|
||||
lv_rate = '0.20'.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_amount TYPE decfloat34.
|
||||
lv_amount = iv_words * lv_rate.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
lv_amount = lv_amount / '1.25'.
|
||||
ENDIF.
|
||||
|
||||
ev_price = round( val = lv_amount dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
IF ev_price < 25.
|
||||
ev_price = 25.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
45
tasks_gen/eval/G0152/faulty/m3_trl_price.func.abap
Normal file
45
tasks_gen/eval/G0152/faulty/m3_trl_price.func.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
FUNCTION {{p}}trl_price
|
||||
IMPORTING
|
||||
iv_source_lang TYPE string
|
||||
iv_target_lang TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_words.
|
||||
|
||||
IF iv_words < 0.
|
||||
RAISE invalid_words.
|
||||
ENDIF.
|
||||
|
||||
IF iv_words = 0.
|
||||
ev_price = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
IF ( iv_source_lang = 'EN' AND iv_target_lang = 'DE' )
|
||||
OR ( iv_source_lang = 'DE' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.12'.
|
||||
ELSEIF ( iv_source_lang = 'EN' AND iv_target_lang = 'FR' )
|
||||
OR ( iv_source_lang = 'FR' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.15'.
|
||||
ELSE.
|
||||
lv_rate = '0.20'.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_amount TYPE decfloat34.
|
||||
lv_amount = iv_words * lv_rate.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
lv_amount = lv_amount * '1.25'.
|
||||
ENDIF.
|
||||
|
||||
ev_price = round( val = lv_amount dec = 3 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
IF ev_price < 25.
|
||||
ev_price = 25.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
45
tasks_gen/eval/G0152/faulty/m4_trl_price.func.abap
Normal file
45
tasks_gen/eval/G0152/faulty/m4_trl_price.func.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
FUNCTION {{p}}trl_price
|
||||
IMPORTING
|
||||
iv_source_lang TYPE string
|
||||
iv_target_lang TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_words.
|
||||
|
||||
IF iv_words < 0.
|
||||
RAISE invalid_words.
|
||||
ENDIF.
|
||||
|
||||
IF iv_words = 0.
|
||||
ev_price = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
IF ( iv_source_lang = 'EN' AND iv_target_lang = 'DE' )
|
||||
OR ( iv_source_lang = 'DE' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.12'.
|
||||
ELSEIF ( iv_source_lang = 'EN' AND iv_target_lang = 'FR' )
|
||||
OR ( iv_source_lang = 'FR' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.15'.
|
||||
ELSE.
|
||||
lv_rate = '0.20'.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_amount TYPE decfloat34.
|
||||
lv_amount = iv_words * lv_rate.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
lv_amount = lv_amount * '1.25'.
|
||||
ENDIF.
|
||||
|
||||
ev_price = round( val = lv_amount dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
IF ev_price >= 25.
|
||||
ev_price = 25.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
19
tasks_gen/eval/G0152/generation.json
Normal file
19
tasks_gen/eval/G0152/generation.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "G0152",
|
||||
"pool": "eval",
|
||||
"object_type": "FUNC",
|
||||
"category": "F",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 4,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
104
tasks_gen/eval/G0152/hidden/t14_hidden.clas.abap
Normal file
104
tasks_gen/eval/G0152/hidden/t14_hidden.clas.abap
Normal file
@@ -0,0 +1,104 @@
|
||||
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING iv_source TYPE string
|
||||
iv_target TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
iv_price TYPE decfloat34 DEFAULT 7
|
||||
EXPORTING ev_price TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS base_rate_en_de FOR TESTING.
|
||||
METHODS base_rate_de_en FOR TESTING.
|
||||
METHODS base_rate_en_fr FOR TESTING.
|
||||
METHODS other_pair_rate FOR TESTING.
|
||||
METHODS express_surcharge FOR TESTING.
|
||||
METHODS minimum_price FOR TESTING.
|
||||
METHODS minimum_with_express FOR TESTING.
|
||||
METHODS zero_words_is_free FOR TESTING.
|
||||
METHODS rounding_half_up FOR TESTING.
|
||||
METHODS negative_words_raises FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
ev_price = iv_price.
|
||||
CALL FUNCTION '{{P}}TRL_PRICE'
|
||||
EXPORTING
|
||||
iv_source_lang = iv_source
|
||||
iv_target_lang = iv_target
|
||||
iv_words = iv_words
|
||||
iv_express = iv_express
|
||||
IMPORTING
|
||||
ev_price = ev_price
|
||||
EXCEPTIONS
|
||||
invalid_words = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_rate_en_de.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `DE` iv_words = 1000 iv_express = abap_false
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_rate_de_en.
|
||||
call( EXPORTING iv_source = `DE` iv_target = `EN` iv_words = 1000 iv_express = abap_false
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_rate_en_fr.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `FR` iv_words = 1000 iv_express = abap_false
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 150 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD other_pair_rate.
|
||||
call( EXPORTING iv_source = `ES` iv_target = `IT` iv_words = 1000 iv_express = abap_false
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 200 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_surcharge.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `DE` iv_words = 1000 iv_express = abap_true
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 150 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_price.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `DE` iv_words = 100 iv_express = abap_false
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 25 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_with_express.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `DE` iv_words = 100 iv_express = abap_true
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 25 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_words_is_free.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `DE` iv_words = 0 iv_express = abap_false
|
||||
IMPORTING ev_price = DATA(lv_price) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_price ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rounding_half_up.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `FR` iv_words = 333 iv_express = abap_true
|
||||
IMPORTING ev_price = DATA(lv_price) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '62.44' ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_words_raises.
|
||||
call( EXPORTING iv_source = `EN` iv_target = `DE` iv_words = -1 iv_express = abap_false
|
||||
iv_price = CONV decfloat34( 7 )
|
||||
IMPORTING ev_price = DATA(lv_price) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 7 ) act = lv_price ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
62
tasks_gen/eval/G0152/mutation.json
Normal file
62
tasks_gen/eval/G0152/mutation.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"task": "G0152",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}TRL_PRICE",
|
||||
"mutant": "line 23: OR -> AND (logic)",
|
||||
"status": "killed",
|
||||
"hidden": "7/10",
|
||||
"failed_tests": [
|
||||
"BASE_RATE_DE_EN",
|
||||
"BASE_RATE_EN_DE",
|
||||
"EXPRESS_SURCHARGE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TRL_PRICE",
|
||||
"mutant": "line 26: = -> <> (eq)",
|
||||
"status": "survived",
|
||||
"hidden": "10/10",
|
||||
"failed_tests": []
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TRL_PRICE",
|
||||
"mutant": "line 36: * -> / (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "8/10",
|
||||
"failed_tests": [
|
||||
"EXPRESS_SURCHARGE",
|
||||
"ROUNDING_HALF_UP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TRL_PRICE",
|
||||
"mutant": "line 39: 2 -> 3 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"ROUNDING_HALF_UP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TRL_PRICE",
|
||||
"mutant": "line 41: < -> >= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "2/10",
|
||||
"failed_tests": [
|
||||
"BASE_RATE_DE_EN",
|
||||
"BASE_RATE_EN_DE",
|
||||
"BASE_RATE_EN_FR",
|
||||
"EXPRESS_SURCHARGE",
|
||||
"MINIMUM_PRICE",
|
||||
"MINIMUM_WITH_EXPRESS",
|
||||
"OTHER_PAIR_RATE",
|
||||
"ROUNDING_HALF_UP"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 4,
|
||||
"kill_rate": 0.8,
|
||||
"ok": true
|
||||
}
|
||||
69
tasks_gen/eval/G0152/reference/t14_test.clas.abap
Normal file
69
tasks_gen/eval/G0152/reference/t14_test.clas.abap
Normal file
@@ -0,0 +1,69 @@
|
||||
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS price_for
|
||||
IMPORTING iv_source TYPE string
|
||||
iv_target TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
RETURNING VALUE(rv_price) TYPE decfloat34.
|
||||
METHODS standard_pair FOR TESTING.
|
||||
METHODS express_and_minimum FOR TESTING.
|
||||
METHODS zero_words FOR TESTING.
|
||||
METHODS negative_words FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_test IMPLEMENTATION.
|
||||
METHOD price_for.
|
||||
CALL FUNCTION '{{P}}TRL_PRICE'
|
||||
EXPORTING
|
||||
iv_source_lang = iv_source
|
||||
iv_target_lang = iv_target
|
||||
iv_words = iv_words
|
||||
iv_express = iv_express
|
||||
IMPORTING
|
||||
ev_price = rv_price
|
||||
EXCEPTIONS
|
||||
invalid_words = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD standard_pair.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 120 )
|
||||
act = price_for( iv_source = `EN` iv_target = `DE` iv_words = 1000 iv_express = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_and_minimum.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 150 )
|
||||
act = price_for( iv_source = `EN` iv_target = `DE` iv_words = 1000 iv_express = abap_true ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 25 )
|
||||
act = price_for( iv_source = `EN` iv_target = `DE` iv_words = 10 iv_express = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_words.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( 0 )
|
||||
act = price_for( iv_source = `EN` iv_target = `DE` iv_words = 0 iv_express = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_words.
|
||||
DATA lv_price TYPE decfloat34.
|
||||
CALL FUNCTION '{{P}}TRL_PRICE'
|
||||
EXPORTING
|
||||
iv_source_lang = `EN`
|
||||
iv_target_lang = `DE`
|
||||
iv_words = -1
|
||||
iv_express = abap_false
|
||||
IMPORTING
|
||||
ev_price = lv_price
|
||||
EXCEPTIONS
|
||||
invalid_words = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
45
tasks_gen/eval/G0152/reference/trl_price.func.abap
Normal file
45
tasks_gen/eval/G0152/reference/trl_price.func.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
FUNCTION {{p}}trl_price
|
||||
IMPORTING
|
||||
iv_source_lang TYPE string
|
||||
iv_target_lang TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_words.
|
||||
|
||||
IF iv_words < 0.
|
||||
RAISE invalid_words.
|
||||
ENDIF.
|
||||
|
||||
IF iv_words = 0.
|
||||
ev_price = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
IF ( iv_source_lang = 'EN' AND iv_target_lang = 'DE' )
|
||||
OR ( iv_source_lang = 'DE' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.12'.
|
||||
ELSEIF ( iv_source_lang = 'EN' AND iv_target_lang = 'FR' )
|
||||
OR ( iv_source_lang = 'FR' AND iv_target_lang = 'EN' ).
|
||||
lv_rate = '0.15'.
|
||||
ELSE.
|
||||
lv_rate = '0.20'.
|
||||
ENDIF.
|
||||
|
||||
DATA lv_amount TYPE decfloat34.
|
||||
lv_amount = iv_words * lv_rate.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
lv_amount = lv_amount * '1.25'.
|
||||
ENDIF.
|
||||
|
||||
ev_price = round( val = lv_amount dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
|
||||
IF ev_price < 25.
|
||||
ev_price = 25.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
14
tasks_gen/eval/G0152/seed/trl_sample.func.abap
Normal file
14
tasks_gen/eval/G0152/seed/trl_sample.func.abap
Normal file
@@ -0,0 +1,14 @@
|
||||
FUNCTION {{p}}trl_sample
|
||||
IMPORTING
|
||||
iv_source_lang TYPE string
|
||||
iv_target_lang TYPE string
|
||||
iv_words TYPE i
|
||||
iv_express TYPE abap_bool
|
||||
EXPORTING
|
||||
ev_price TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_words.
|
||||
|
||||
ev_price = 0.
|
||||
|
||||
ENDFUNCTION.
|
||||
43
tasks_gen/eval/G0152/spec.md
Normal file
43
tasks_gen/eval/G0152/spec.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# 1. Goal
|
||||
A translation agency prices translation jobs. The invoicing program calls one event
|
||||
module for each job. The event module must have the same interface as the sample
|
||||
event module, because the invoicing program calls all event modules in the same way.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Function group {{P}}FG_TRL exists in package $TMP.
|
||||
- Function module {{P}}TRL_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}}TRL_PRICE in function group {{P}}FG_TRL.
|
||||
- Use exactly the interface of {{P}}TRL_SAMPLE: the same parameter names, parameter
|
||||
kinds, parameter types, and exceptions.
|
||||
|
||||
# 5. Business rules
|
||||
1. If the word count is less than 0, raise the exception INVALID_WORDS. Do not
|
||||
change the price.
|
||||
2. If the word count is 0, the price is 0. The minimum price in rule 6 does not
|
||||
apply.
|
||||
3. The base rate for one word depends on the language pair. Compare the language
|
||||
codes exactly as they are given.
|
||||
- Source EN and target DE, or source DE and target EN: 0.12
|
||||
- Source EN and target FR, or source FR and target EN: 0.15
|
||||
- All other pairs: 0.20
|
||||
4. The base amount is the word count multiplied by the base rate.
|
||||
5. If the express flag is true, multiply the base amount by 1.25.
|
||||
6. The price is the amount from rules 4 and 5, rounded half up to 2 decimals. If
|
||||
the price is less than 25.00, the price is 25.00.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Coding standards: Clean ABAP. The code must not cause ATC findings of priority 1
|
||||
or priority 2.
|
||||
- Out of scope: do not change {{P}}TRL_SAMPLE.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module {{P}}TRL_PRICE is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests for the function module in a global test class.
|
||||
84
tasks_gen/eval/G0152/task.json
Normal file
84
tasks_gen/eval/G0152/task.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"id": "G0152",
|
||||
"category": "F",
|
||||
"object_type": "FUNC",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "FUGR",
|
||||
"name": "{{P}}FG_TRL",
|
||||
"description": "Translation job events"
|
||||
},
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}TRL_SAMPLE",
|
||||
"functionGroup": "{{P}}FG_TRL",
|
||||
"file": "seed/trl_sample.func.abap",
|
||||
"description": "Sample event module"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}TRL_PRICE",
|
||||
"functionGroup": "{{P}}FG_TRL",
|
||||
"params": [
|
||||
{
|
||||
"name": "iv_source_lang",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "iv_target_lang",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "iv_words",
|
||||
"type": "i"
|
||||
},
|
||||
{
|
||||
"name": "iv_express",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "ev_price",
|
||||
"type": "decfloat34"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}TRL_SAMPLE"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T14_HIDDEN",
|
||||
"file": "hidden/t14_hidden.clas.abap",
|
||||
"description": "T14 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}TRL_PRICE",
|
||||
"functionGroup": "{{P}}FG_TRL",
|
||||
"file": "reference/trl_price.func.abap",
|
||||
"description": "Translation price 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