Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
59
tasks_gen/train/G1137/faulty/m0_tattoo_fee.func.abap
Normal file
59
tasks_gen/train/G1137/faulty/m0_tattoo_fee.func.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
FUNCTION {{p}}tattoo_fee
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
CONSTANTS lc_first_line TYPE decfloat34 VALUE '133.33'.
|
||||
CONSTANTS lc_first_shade TYPE decfloat34 VALUE '97.77'.
|
||||
CONSTANTS lc_min_line TYPE decfloat34 VALUE '150.00'.
|
||||
CONSTANTS lc_max_line TYPE decfloat34 VALUE '800.00'.
|
||||
CONSTANTS lc_min_shade TYPE decfloat34 VALUE '110.00'.
|
||||
CONSTANTS lc_max_shade TYPE decfloat34 VALUE '600.00'.
|
||||
CONSTANTS lc_long_project TYPE i VALUE 6.
|
||||
|
||||
DATA lv_first TYPE decfloat34.
|
||||
DATA lv_minimum TYPE decfloat34.
|
||||
DATA lv_maximum TYPE decfloat34.
|
||||
DATA lv_further TYPE decfloat34.
|
||||
|
||||
ev_deposit = abap_true.
|
||||
|
||||
IF iv_sessions < 1.
|
||||
RAISE invalid_sessions.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_style.
|
||||
WHEN 'LINE'.
|
||||
lv_first = lc_first_line.
|
||||
lv_minimum = lc_min_line.
|
||||
lv_maximum = lc_max_line.
|
||||
WHEN 'SHADE'.
|
||||
lv_first = lc_first_shade.
|
||||
lv_minimum = lc_min_shade.
|
||||
lv_maximum = lc_max_shade.
|
||||
WHEN OTHERS.
|
||||
lv_first = 0.
|
||||
lv_minimum = 0.
|
||||
lv_maximum = 0.
|
||||
ENDCASE.
|
||||
|
||||
lv_further = round( val = lv_first / 2 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
cv_fee = lv_first + ( iv_sessions - 1 ) * lv_further.
|
||||
|
||||
IF cv_fee < lv_minimum.
|
||||
cv_fee = lv_minimum.
|
||||
ELSEIF cv_fee > lv_maximum.
|
||||
cv_fee = lv_maximum.
|
||||
ENDIF.
|
||||
|
||||
IF iv_sessions > lc_long_project.
|
||||
ev_deposit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
59
tasks_gen/train/G1137/faulty/m1_tattoo_fee.func.abap
Normal file
59
tasks_gen/train/G1137/faulty/m1_tattoo_fee.func.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
FUNCTION {{p}}tattoo_fee
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
CONSTANTS lc_first_line TYPE decfloat34 VALUE '133.33'.
|
||||
CONSTANTS lc_first_shade TYPE decfloat34 VALUE '97.77'.
|
||||
CONSTANTS lc_min_line TYPE decfloat34 VALUE '150.00'.
|
||||
CONSTANTS lc_max_line TYPE decfloat34 VALUE '800.00'.
|
||||
CONSTANTS lc_min_shade TYPE decfloat34 VALUE '110.00'.
|
||||
CONSTANTS lc_max_shade TYPE decfloat34 VALUE '600.00'.
|
||||
CONSTANTS lc_long_project TYPE i VALUE 6.
|
||||
|
||||
DATA lv_first TYPE decfloat34.
|
||||
DATA lv_minimum TYPE decfloat34.
|
||||
DATA lv_maximum TYPE decfloat34.
|
||||
DATA lv_further TYPE decfloat34.
|
||||
|
||||
ev_deposit = abap_false.
|
||||
|
||||
IF iv_sessions < 1.
|
||||
RAISE invalid_sessions.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_style.
|
||||
WHEN 'LINE'.
|
||||
lv_first = lc_first_line.
|
||||
lv_minimum = lc_min_line.
|
||||
lv_maximum = lc_max_line.
|
||||
WHEN 'SHADE'.
|
||||
lv_first = lc_first_shade.
|
||||
lv_minimum = lc_min_shade.
|
||||
lv_maximum = lc_max_shade.
|
||||
WHEN OTHERS.
|
||||
lv_first = 0.
|
||||
lv_minimum = 0.
|
||||
lv_maximum = 0.
|
||||
ENDCASE.
|
||||
|
||||
lv_further = round( val = lv_first / 3 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
cv_fee = lv_first + ( iv_sessions - 1 ) * lv_further.
|
||||
|
||||
IF cv_fee < lv_minimum.
|
||||
cv_fee = lv_minimum.
|
||||
ELSEIF cv_fee > lv_maximum.
|
||||
cv_fee = lv_maximum.
|
||||
ENDIF.
|
||||
|
||||
IF iv_sessions > lc_long_project.
|
||||
ev_deposit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
59
tasks_gen/train/G1137/faulty/m2_tattoo_fee.func.abap
Normal file
59
tasks_gen/train/G1137/faulty/m2_tattoo_fee.func.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
FUNCTION {{p}}tattoo_fee
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
CONSTANTS lc_first_line TYPE decfloat34 VALUE '133.33'.
|
||||
CONSTANTS lc_first_shade TYPE decfloat34 VALUE '97.77'.
|
||||
CONSTANTS lc_min_line TYPE decfloat34 VALUE '150.00'.
|
||||
CONSTANTS lc_max_line TYPE decfloat34 VALUE '800.00'.
|
||||
CONSTANTS lc_min_shade TYPE decfloat34 VALUE '110.00'.
|
||||
CONSTANTS lc_max_shade TYPE decfloat34 VALUE '600.00'.
|
||||
CONSTANTS lc_long_project TYPE i VALUE 6.
|
||||
|
||||
DATA lv_first TYPE decfloat34.
|
||||
DATA lv_minimum TYPE decfloat34.
|
||||
DATA lv_maximum TYPE decfloat34.
|
||||
DATA lv_further TYPE decfloat34.
|
||||
|
||||
ev_deposit = abap_false.
|
||||
|
||||
IF iv_sessions < 1.
|
||||
RAISE invalid_sessions.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_style.
|
||||
WHEN 'LINE'.
|
||||
lv_first = lc_first_line.
|
||||
lv_minimum = lc_min_line.
|
||||
lv_maximum = lc_max_line.
|
||||
WHEN 'SHADE'.
|
||||
lv_first = lc_first_shade.
|
||||
lv_minimum = lc_min_shade.
|
||||
lv_maximum = lc_max_shade.
|
||||
WHEN OTHERS.
|
||||
lv_first = 0.
|
||||
lv_minimum = 0.
|
||||
lv_maximum = 0.
|
||||
ENDCASE.
|
||||
|
||||
lv_further = round( val = lv_first / 2 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
cv_fee = lv_first + ( iv_sessions + 1 ) * lv_further.
|
||||
|
||||
IF cv_fee < lv_minimum.
|
||||
cv_fee = lv_minimum.
|
||||
ELSEIF cv_fee > lv_maximum.
|
||||
cv_fee = lv_maximum.
|
||||
ENDIF.
|
||||
|
||||
IF iv_sessions > lc_long_project.
|
||||
ev_deposit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
59
tasks_gen/train/G1137/faulty/m3_tattoo_fee.func.abap
Normal file
59
tasks_gen/train/G1137/faulty/m3_tattoo_fee.func.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
FUNCTION {{p}}tattoo_fee
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
CONSTANTS lc_first_line TYPE decfloat34 VALUE '133.33'.
|
||||
CONSTANTS lc_first_shade TYPE decfloat34 VALUE '97.77'.
|
||||
CONSTANTS lc_min_line TYPE decfloat34 VALUE '150.00'.
|
||||
CONSTANTS lc_max_line TYPE decfloat34 VALUE '800.00'.
|
||||
CONSTANTS lc_min_shade TYPE decfloat34 VALUE '110.00'.
|
||||
CONSTANTS lc_max_shade TYPE decfloat34 VALUE '600.00'.
|
||||
CONSTANTS lc_long_project TYPE i VALUE 6.
|
||||
|
||||
DATA lv_first TYPE decfloat34.
|
||||
DATA lv_minimum TYPE decfloat34.
|
||||
DATA lv_maximum TYPE decfloat34.
|
||||
DATA lv_further TYPE decfloat34.
|
||||
|
||||
ev_deposit = abap_false.
|
||||
|
||||
IF iv_sessions < 1.
|
||||
RAISE invalid_sessions.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_style.
|
||||
WHEN 'LINE'.
|
||||
lv_first = lc_first_line.
|
||||
lv_minimum = lc_min_line.
|
||||
lv_maximum = lc_max_line.
|
||||
WHEN 'SHADE'.
|
||||
lv_first = lc_first_shade.
|
||||
lv_minimum = lc_min_shade.
|
||||
lv_maximum = lc_max_shade.
|
||||
WHEN OTHERS.
|
||||
lv_first = 0.
|
||||
lv_minimum = 0.
|
||||
lv_maximum = 0.
|
||||
ENDCASE.
|
||||
|
||||
lv_further = round( val = lv_first / 2 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
cv_fee = lv_first + ( iv_sessions - 1 ) / lv_further.
|
||||
|
||||
IF cv_fee < lv_minimum.
|
||||
cv_fee = lv_minimum.
|
||||
ELSEIF cv_fee > lv_maximum.
|
||||
cv_fee = lv_maximum.
|
||||
ENDIF.
|
||||
|
||||
IF iv_sessions > lc_long_project.
|
||||
ev_deposit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
59
tasks_gen/train/G1137/faulty/m4_tattoo_fee.func.abap
Normal file
59
tasks_gen/train/G1137/faulty/m4_tattoo_fee.func.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
FUNCTION {{p}}tattoo_fee
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
CONSTANTS lc_first_line TYPE decfloat34 VALUE '133.33'.
|
||||
CONSTANTS lc_first_shade TYPE decfloat34 VALUE '97.77'.
|
||||
CONSTANTS lc_min_line TYPE decfloat34 VALUE '150.00'.
|
||||
CONSTANTS lc_max_line TYPE decfloat34 VALUE '800.00'.
|
||||
CONSTANTS lc_min_shade TYPE decfloat34 VALUE '110.00'.
|
||||
CONSTANTS lc_max_shade TYPE decfloat34 VALUE '600.00'.
|
||||
CONSTANTS lc_long_project TYPE i VALUE 6.
|
||||
|
||||
DATA lv_first TYPE decfloat34.
|
||||
DATA lv_minimum TYPE decfloat34.
|
||||
DATA lv_maximum TYPE decfloat34.
|
||||
DATA lv_further TYPE decfloat34.
|
||||
|
||||
ev_deposit = abap_false.
|
||||
|
||||
IF iv_sessions < 1.
|
||||
RAISE invalid_sessions.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_style.
|
||||
WHEN 'LINE'.
|
||||
lv_first = lc_first_line.
|
||||
lv_minimum = lc_min_line.
|
||||
lv_maximum = lc_max_line.
|
||||
WHEN 'SHADE'.
|
||||
lv_first = lc_first_shade.
|
||||
lv_minimum = lc_min_shade.
|
||||
lv_maximum = lc_max_shade.
|
||||
WHEN OTHERS.
|
||||
lv_first = 0.
|
||||
lv_minimum = 0.
|
||||
lv_maximum = 0.
|
||||
ENDCASE.
|
||||
|
||||
lv_further = round( val = lv_first / 2 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
cv_fee = lv_first + ( iv_sessions - 1 ) * lv_further.
|
||||
|
||||
IF cv_fee >= lv_minimum.
|
||||
cv_fee = lv_minimum.
|
||||
ELSEIF cv_fee > lv_maximum.
|
||||
cv_fee = lv_maximum.
|
||||
ENDIF.
|
||||
|
||||
IF iv_sessions > lc_long_project.
|
||||
ev_deposit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
28
tasks_gen/train/G1137/generation.json
Normal file
28
tasks_gen/train/G1137/generation.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"id": "G1137",
|
||||
"pool": "train",
|
||||
"object_type": "FUNC",
|
||||
"category": "F",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"Too close to task G0156 (similarity spec 0.71, rules 0.64, names 0.33). Choose a different business topic and different object names."
|
||||
],
|
||||
"by_check": {
|
||||
"extra": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
102
tasks_gen/train/G1137/hidden/t42_hidden.clas.abap
Normal file
102
tasks_gen/train/G1137/hidden/t42_hidden.clas.abap
Normal file
@@ -0,0 +1,102 @@
|
||||
CLASS {{p}}t42_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
iv_fee TYPE decfloat34 DEFAULT 0
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
ev_fee TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS line_minimum FOR TESTING.
|
||||
METHODS line_two_sessions FOR TESTING.
|
||||
METHODS line_three_sessions FOR TESTING.
|
||||
METHODS line_maximum FOR TESTING.
|
||||
METHODS shade_minimum FOR TESTING.
|
||||
METHODS shade_two_sessions FOR TESTING.
|
||||
METHODS shade_maximum FOR TESTING.
|
||||
METHODS other_style_zero FOR TESTING.
|
||||
METHODS invalid_sessions FOR TESTING.
|
||||
METHODS deposit_long_project FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t42_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
ev_fee = iv_fee.
|
||||
CALL FUNCTION '{{P}}TATTOO_FEE'
|
||||
EXPORTING
|
||||
iv_style = iv_style
|
||||
iv_sessions = iv_sessions
|
||||
IMPORTING
|
||||
ev_deposit = ev_deposit
|
||||
CHANGING
|
||||
cv_fee = ev_fee
|
||||
EXCEPTIONS
|
||||
invalid_sessions = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD line_minimum.
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 1 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '150.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD line_two_sessions.
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 2 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '200.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD line_three_sessions.
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 3 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '266.67' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD line_maximum.
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 12 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '800.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD shade_minimum.
|
||||
call( EXPORTING iv_style = `SHADE` iv_sessions = 1 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '110.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD shade_two_sessions.
|
||||
call( EXPORTING iv_style = `SHADE` iv_sessions = 2 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '146.66' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD shade_maximum.
|
||||
call( EXPORTING iv_style = `SHADE` iv_sessions = 12 IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '600.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD other_style_zero.
|
||||
call( EXPORTING iv_style = `XX` iv_sessions = 3
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_deposit = DATA(lv_deposit) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_deposit ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_sessions.
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 0 IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD deposit_long_project.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_deposit TYPE abap_bool.
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 6
|
||||
IMPORTING ev_fee = lv_fee ev_deposit = lv_deposit ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_deposit ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '466.68' ) act = lv_fee ).
|
||||
call( EXPORTING iv_style = `LINE` iv_sessions = 7
|
||||
IMPORTING ev_fee = lv_fee ev_deposit = lv_deposit ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_deposit ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '533.35' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
78
tasks_gen/train/G1137/mutation.json
Normal file
78
tasks_gen/train/G1137/mutation.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"task": "G1137",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}TATTOO_FEE",
|
||||
"mutant": "line 25: abap_false -> abap_true (bool)",
|
||||
"status": "killed",
|
||||
"hidden": "8/10",
|
||||
"failed_tests": [
|
||||
"DEPOSIT_LONG_PROJECT",
|
||||
"OTHER_STYLE_ZERO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TATTOO_FEE",
|
||||
"mutant": "line 46: 2 -> 3 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "4/10",
|
||||
"failed_tests": [
|
||||
"DEPOSIT_LONG_PROJECT",
|
||||
"LINE_MAXIMUM",
|
||||
"LINE_THREE_SESSIONS",
|
||||
"LINE_TWO_SESSIONS",
|
||||
"SHADE_MAXIMUM",
|
||||
"SHADE_TWO_SESSIONS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TATTOO_FEE",
|
||||
"mutant": "line 47: - -> + (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "4/10",
|
||||
"failed_tests": [
|
||||
"DEPOSIT_LONG_PROJECT",
|
||||
"LINE_MINIMUM",
|
||||
"LINE_THREE_SESSIONS",
|
||||
"LINE_TWO_SESSIONS",
|
||||
"SHADE_MINIMUM",
|
||||
"SHADE_TWO_SESSIONS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TATTOO_FEE",
|
||||
"mutant": "line 47: * -> / (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "3/10",
|
||||
"failed_tests": [
|
||||
"DEPOSIT_LONG_PROJECT",
|
||||
"LINE_MAXIMUM",
|
||||
"LINE_THREE_SESSIONS",
|
||||
"LINE_TWO_SESSIONS",
|
||||
"OTHER_STYLE_ZERO",
|
||||
"SHADE_MAXIMUM",
|
||||
"SHADE_TWO_SESSIONS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}TATTOO_FEE",
|
||||
"mutant": "line 49: < -> >= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "2/10",
|
||||
"failed_tests": [
|
||||
"DEPOSIT_LONG_PROJECT",
|
||||
"LINE_MAXIMUM",
|
||||
"LINE_MINIMUM",
|
||||
"LINE_THREE_SESSIONS",
|
||||
"LINE_TWO_SESSIONS",
|
||||
"SHADE_MAXIMUM",
|
||||
"SHADE_MINIMUM",
|
||||
"SHADE_TWO_SESSIONS"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
79
tasks_gen/train/G1137/reference/t42_test.clas.abap
Normal file
79
tasks_gen/train/G1137/reference/t42_test.clas.abap
Normal file
@@ -0,0 +1,79 @@
|
||||
CLASS {{p}}t42_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS fee_for
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
RETURNING
|
||||
VALUE(rv_fee) TYPE decfloat34.
|
||||
METHODS line_fee FOR TESTING.
|
||||
METHODS shade_fee FOR TESTING.
|
||||
METHODS fee_limits FOR TESTING.
|
||||
METHODS deposit_flag FOR TESTING.
|
||||
METHODS invalid_sessions FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t42_test IMPLEMENTATION.
|
||||
METHOD fee_for.
|
||||
DATA lv_deposit TYPE abap_bool.
|
||||
CALL FUNCTION '{{P}}TATTOO_FEE'
|
||||
EXPORTING
|
||||
iv_style = iv_style
|
||||
iv_sessions = iv_sessions
|
||||
IMPORTING
|
||||
ev_deposit = lv_deposit
|
||||
CHANGING
|
||||
cv_fee = rv_fee
|
||||
EXCEPTIONS
|
||||
invalid_sessions = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD line_fee.
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '200.00' )
|
||||
act = fee_for( iv_style = `LINE` iv_sessions = 2 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD shade_fee.
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '146.66' )
|
||||
act = fee_for( iv_style = `SHADE` iv_sessions = 2 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD fee_limits.
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '150.00' )
|
||||
act = fee_for( iv_style = `LINE` iv_sessions = 1 ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '800.00' )
|
||||
act = fee_for( iv_style = `LINE` iv_sessions = 20 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD deposit_flag.
|
||||
DATA lv_deposit TYPE abap_bool.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
CALL FUNCTION '{{P}}TATTOO_FEE'
|
||||
EXPORTING
|
||||
iv_style = `LINE`
|
||||
iv_sessions = 7
|
||||
IMPORTING
|
||||
ev_deposit = lv_deposit
|
||||
CHANGING
|
||||
cv_fee = lv_fee.
|
||||
cl_abap_unit_assert=>assert_true( lv_deposit ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_sessions.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
CALL FUNCTION '{{P}}TATTOO_FEE'
|
||||
EXPORTING
|
||||
iv_style = `LINE`
|
||||
iv_sessions = 0
|
||||
CHANGING
|
||||
cv_fee = lv_fee
|
||||
EXCEPTIONS
|
||||
invalid_sessions = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
59
tasks_gen/train/G1137/reference/tattoo_fee.func.abap
Normal file
59
tasks_gen/train/G1137/reference/tattoo_fee.func.abap
Normal file
@@ -0,0 +1,59 @@
|
||||
FUNCTION {{p}}tattoo_fee
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
CONSTANTS lc_first_line TYPE decfloat34 VALUE '133.33'.
|
||||
CONSTANTS lc_first_shade TYPE decfloat34 VALUE '97.77'.
|
||||
CONSTANTS lc_min_line TYPE decfloat34 VALUE '150.00'.
|
||||
CONSTANTS lc_max_line TYPE decfloat34 VALUE '800.00'.
|
||||
CONSTANTS lc_min_shade TYPE decfloat34 VALUE '110.00'.
|
||||
CONSTANTS lc_max_shade TYPE decfloat34 VALUE '600.00'.
|
||||
CONSTANTS lc_long_project TYPE i VALUE 6.
|
||||
|
||||
DATA lv_first TYPE decfloat34.
|
||||
DATA lv_minimum TYPE decfloat34.
|
||||
DATA lv_maximum TYPE decfloat34.
|
||||
DATA lv_further TYPE decfloat34.
|
||||
|
||||
ev_deposit = abap_false.
|
||||
|
||||
IF iv_sessions < 1.
|
||||
RAISE invalid_sessions.
|
||||
ENDIF.
|
||||
|
||||
CASE iv_style.
|
||||
WHEN 'LINE'.
|
||||
lv_first = lc_first_line.
|
||||
lv_minimum = lc_min_line.
|
||||
lv_maximum = lc_max_line.
|
||||
WHEN 'SHADE'.
|
||||
lv_first = lc_first_shade.
|
||||
lv_minimum = lc_min_shade.
|
||||
lv_maximum = lc_max_shade.
|
||||
WHEN OTHERS.
|
||||
lv_first = 0.
|
||||
lv_minimum = 0.
|
||||
lv_maximum = 0.
|
||||
ENDCASE.
|
||||
|
||||
lv_further = round( val = lv_first / 2 dec = 2 mode = cl_abap_math=>round_half_up ).
|
||||
cv_fee = lv_first + ( iv_sessions - 1 ) * lv_further.
|
||||
|
||||
IF cv_fee < lv_minimum.
|
||||
cv_fee = lv_minimum.
|
||||
ELSEIF cv_fee > lv_maximum.
|
||||
cv_fee = lv_maximum.
|
||||
ENDIF.
|
||||
|
||||
IF iv_sessions > lc_long_project.
|
||||
ev_deposit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDFUNCTION.
|
||||
14
tasks_gen/train/G1137/seed/tattoo_sample.func.abap
Normal file
14
tasks_gen/train/G1137/seed/tattoo_sample.func.abap
Normal file
@@ -0,0 +1,14 @@
|
||||
FUNCTION {{p}}tattoo_sample
|
||||
IMPORTING
|
||||
iv_style TYPE string
|
||||
iv_sessions TYPE i
|
||||
EXPORTING
|
||||
ev_deposit TYPE abap_bool
|
||||
CHANGING
|
||||
cv_fee TYPE decfloat34
|
||||
EXCEPTIONS
|
||||
invalid_sessions.
|
||||
|
||||
ev_deposit = abap_false.
|
||||
|
||||
ENDFUNCTION.
|
||||
47
tasks_gen/train/G1137/spec.md
Normal file
47
tasks_gen/train/G1137/spec.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# 1. Goal
|
||||
A tattoo studio prices tattoo projects. The reception desk calls one function
|
||||
module for each project. The function module calculates the studio fee.
|
||||
The function module must use the same interface as the sample pricing module,
|
||||
because the reception desk calls all pricing modules in the same way.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Function group {{P}}FG_TATTOO exists in package $TMP.
|
||||
- Function module {{P}}TATTOO_SAMPLE exists in this group. It is the sample
|
||||
pricing module. Its interface is the interface that every pricing module must
|
||||
use. Read the interface of {{P}}TATTOO_SAMPLE before you write code.
|
||||
- A project has a style code and a number of sessions. A project has one
|
||||
session or many sessions.
|
||||
|
||||
# 4. Contract
|
||||
- Create the function module {{P}}TATTOO_FEE in function group {{P}}FG_TATTOO.
|
||||
- Use exactly the interface of {{P}}TATTOO_SAMPLE: the same parameter names,
|
||||
the same parameter kinds, the same types, and the same exceptions.
|
||||
|
||||
# 5. Business rules
|
||||
1. If the number of sessions is less than 1, raise the exception
|
||||
INVALID_SESSIONS. The sample module declares this exception.
|
||||
2. Set the deposit flag to false, except in rule 6.
|
||||
3. Style code LINE: the first session costs 133.33. Every further session
|
||||
costs half of 133.33, rounded half up to 2 decimals. The fee is the sum of
|
||||
the first session and all further sessions. Then apply the minimum fee
|
||||
150.00 and the maximum fee 800.00.
|
||||
4. Style code SHADE: the first session costs 97.77. Every further session
|
||||
costs half of 97.77, rounded half up to 2 decimals. The fee is the sum of
|
||||
the first session and all further sessions. Then apply the minimum fee
|
||||
110.00 and the maximum fee 600.00.
|
||||
5. Other style codes: the fee is 0.
|
||||
6. If the number of sessions is greater than 6, set the deposit flag to true.
|
||||
This rule applies to every style code. The fee does not change.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Use Clean ABAP. Keep the code short and readable.
|
||||
- Out of scope: do not change {{P}}TATTOO_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.
|
||||
80
tasks_gen/train/G1137/task.json
Normal file
80
tasks_gen/train/G1137/task.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"id": "G1137",
|
||||
"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_TATTOO",
|
||||
"description": "Tattoo studio pricing modules"
|
||||
},
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}TATTOO_SAMPLE",
|
||||
"functionGroup": "{{P}}FG_TATTOO",
|
||||
"file": "seed/tattoo_sample.func.abap",
|
||||
"description": "Sample pricing module"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}TATTOO_FEE",
|
||||
"functionGroup": "{{P}}FG_TATTOO",
|
||||
"params": [
|
||||
{
|
||||
"name": "iv_style",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "iv_sessions",
|
||||
"type": "i"
|
||||
},
|
||||
{
|
||||
"name": "ev_deposit",
|
||||
"type": "abap_bool"
|
||||
},
|
||||
{
|
||||
"name": "cv_fee",
|
||||
"type": "decfloat34"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}TATTOO_SAMPLE"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T42_HIDDEN",
|
||||
"file": "hidden/t42_hidden.clas.abap",
|
||||
"description": "T42 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "FUNC",
|
||||
"name": "{{P}}TATTOO_FEE",
|
||||
"functionGroup": "{{P}}FG_TATTOO",
|
||||
"file": "reference/tattoo_fee.func.abap",
|
||||
"description": "Tattoo studio pricing module"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T42_TEST",
|
||||
"file": "reference/t42_test.clas.abap",
|
||||
"description": "T42 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user