Snapshot: new training tasks (balanced generation), docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
50
tasks_gen/train/G1933/faulty/m0_if_pyro_order.intf.abap
Normal file
50
tasks_gen/train/G1933/faulty/m0_if_pyro_order.intf.abap
Normal file
@@ -0,0 +1,50 @@
|
||||
INTERFACE {{p}}if_pyro_order PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 11.
|
||||
TYPES ty_zone TYPE c LENGTH 1.
|
||||
TYPES ty_amount TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
TYPES BEGIN OF ty_order.
|
||||
TYPES calibre_mm TYPE i.
|
||||
TYPES zone_code TYPE ty_zone.
|
||||
TYPES wind_kmh TYPE i.
|
||||
TYPES start_hour TYPE i.
|
||||
TYPES crowd_m TYPE i.
|
||||
TYPES duration_min TYPE i.
|
||||
TYPES END OF ty_order.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
calibre TYPE ty_reason VALUE 'CALIBRE',
|
||||
zone TYPE ty_reason VALUE 'ZONE',
|
||||
wind TYPE ty_reason VALUE 'WIND',
|
||||
time TYPE ty_reason VALUE 'TIME',
|
||||
distance TYPE ty_reason VALUE 'DISTANCE',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_limit,
|
||||
max_wind_kmh TYPE i VALUE 30,
|
||||
min_start_hour TYPE i VALUE 18,
|
||||
max_start_hour TYPE i VALUE 23,
|
||||
free_minutes TYPE i VALUE 10,
|
||||
max_fee_euro TYPE i VALUE 5000,
|
||||
END OF c_limit.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_distance,
|
||||
calibre_50 TYPE i VALUE 30,
|
||||
calibre_75 TYPE i VALUE 45,
|
||||
calibre_100 TYPE i VALUE 60,
|
||||
calibre_150 TYPE i VALUE 90,
|
||||
calibre_200 TYPE i VALUE 120,
|
||||
END OF c_distance.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
|
||||
METHODS calc_fee
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_fee) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
50
tasks_gen/train/G1933/faulty/m1_if_pyro_order.intf.abap
Normal file
50
tasks_gen/train/G1933/faulty/m1_if_pyro_order.intf.abap
Normal file
@@ -0,0 +1,50 @@
|
||||
INTERFACE {{p}}if_pyro_order PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 12.
|
||||
TYPES ty_zone TYPE c LENGTH 1.
|
||||
TYPES ty_amount TYPE p LENGTH 7 DECIMALS 2.
|
||||
|
||||
TYPES BEGIN OF ty_order.
|
||||
TYPES calibre_mm TYPE i.
|
||||
TYPES zone_code TYPE ty_zone.
|
||||
TYPES wind_kmh TYPE i.
|
||||
TYPES start_hour TYPE i.
|
||||
TYPES crowd_m TYPE i.
|
||||
TYPES duration_min TYPE i.
|
||||
TYPES END OF ty_order.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
calibre TYPE ty_reason VALUE 'CALIBRE',
|
||||
zone TYPE ty_reason VALUE 'ZONE',
|
||||
wind TYPE ty_reason VALUE 'WIND',
|
||||
time TYPE ty_reason VALUE 'TIME',
|
||||
distance TYPE ty_reason VALUE 'DISTANCE',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_limit,
|
||||
max_wind_kmh TYPE i VALUE 30,
|
||||
min_start_hour TYPE i VALUE 18,
|
||||
max_start_hour TYPE i VALUE 23,
|
||||
free_minutes TYPE i VALUE 10,
|
||||
max_fee_euro TYPE i VALUE 5000,
|
||||
END OF c_limit.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_distance,
|
||||
calibre_50 TYPE i VALUE 30,
|
||||
calibre_75 TYPE i VALUE 45,
|
||||
calibre_100 TYPE i VALUE 60,
|
||||
calibre_150 TYPE i VALUE 90,
|
||||
calibre_200 TYPE i VALUE 120,
|
||||
END OF c_distance.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
|
||||
METHODS calc_fee
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_fee) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
50
tasks_gen/train/G1933/faulty/m2_if_pyro_order.intf.abap
Normal file
50
tasks_gen/train/G1933/faulty/m2_if_pyro_order.intf.abap
Normal file
@@ -0,0 +1,50 @@
|
||||
INTERFACE {{p}}if_pyro_order PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 12.
|
||||
TYPES ty_zone TYPE c LENGTH 1.
|
||||
TYPES ty_amount TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
TYPES BEGIN OF ty_order.
|
||||
TYPES calibre_mm TYPE i.
|
||||
TYPES zone_code TYPE ty_zone.
|
||||
TYPES wind_kmh TYPE i.
|
||||
TYPES start_hour TYPE i.
|
||||
TYPES crowd_m TYPE i.
|
||||
TYPES duration_min TYPE i.
|
||||
TYPES END OF ty_order.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
calibre TYPE ty_reason VALUE 'CALIBRE',
|
||||
zone TYPE ty_reason VALUE 'YONE',
|
||||
wind TYPE ty_reason VALUE 'WIND',
|
||||
time TYPE ty_reason VALUE 'TIME',
|
||||
distance TYPE ty_reason VALUE 'DISTANCE',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_limit,
|
||||
max_wind_kmh TYPE i VALUE 30,
|
||||
min_start_hour TYPE i VALUE 18,
|
||||
max_start_hour TYPE i VALUE 23,
|
||||
free_minutes TYPE i VALUE 10,
|
||||
max_fee_euro TYPE i VALUE 5000,
|
||||
END OF c_limit.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_distance,
|
||||
calibre_50 TYPE i VALUE 30,
|
||||
calibre_75 TYPE i VALUE 45,
|
||||
calibre_100 TYPE i VALUE 60,
|
||||
calibre_150 TYPE i VALUE 90,
|
||||
calibre_200 TYPE i VALUE 120,
|
||||
END OF c_distance.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
|
||||
METHODS calc_fee
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_fee) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
50
tasks_gen/train/G1933/faulty/m3_if_pyro_order.intf.abap
Normal file
50
tasks_gen/train/G1933/faulty/m3_if_pyro_order.intf.abap
Normal file
@@ -0,0 +1,50 @@
|
||||
INTERFACE {{p}}if_pyro_order PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 12.
|
||||
TYPES ty_zone TYPE c LENGTH 1.
|
||||
TYPES ty_amount TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
TYPES BEGIN OF ty_order.
|
||||
TYPES calibre_mm TYPE i.
|
||||
TYPES zone_code TYPE ty_zone.
|
||||
TYPES wind_kmh TYPE i.
|
||||
TYPES start_hour TYPE i.
|
||||
TYPES crowd_m TYPE i.
|
||||
TYPES duration_min TYPE i.
|
||||
TYPES END OF ty_order.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
calibre TYPE ty_reason VALUE 'CALIBRE',
|
||||
zone TYPE ty_reason VALUE 'ZONE',
|
||||
wind TYPE ty_reason VALUE 'WIND',
|
||||
time TYPE ty_reason VALUE 'ZIME',
|
||||
distance TYPE ty_reason VALUE 'DISTANCE',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_limit,
|
||||
max_wind_kmh TYPE i VALUE 30,
|
||||
min_start_hour TYPE i VALUE 18,
|
||||
max_start_hour TYPE i VALUE 23,
|
||||
free_minutes TYPE i VALUE 10,
|
||||
max_fee_euro TYPE i VALUE 5000,
|
||||
END OF c_limit.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_distance,
|
||||
calibre_50 TYPE i VALUE 30,
|
||||
calibre_75 TYPE i VALUE 45,
|
||||
calibre_100 TYPE i VALUE 60,
|
||||
calibre_150 TYPE i VALUE 90,
|
||||
calibre_200 TYPE i VALUE 120,
|
||||
END OF c_distance.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
|
||||
METHODS calc_fee
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_fee) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
50
tasks_gen/train/G1933/faulty/m4_if_pyro_order.intf.abap
Normal file
50
tasks_gen/train/G1933/faulty/m4_if_pyro_order.intf.abap
Normal file
@@ -0,0 +1,50 @@
|
||||
INTERFACE {{p}}if_pyro_order PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 12.
|
||||
TYPES ty_zone TYPE c LENGTH 1.
|
||||
TYPES ty_amount TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
TYPES BEGIN OF ty_order.
|
||||
TYPES calibre_mm TYPE i.
|
||||
TYPES zone_code TYPE ty_zone.
|
||||
TYPES wind_kmh TYPE i.
|
||||
TYPES start_hour TYPE i.
|
||||
TYPES crowd_m TYPE i.
|
||||
TYPES duration_min TYPE i.
|
||||
TYPES END OF ty_order.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
calibre TYPE ty_reason VALUE 'CALIBRE',
|
||||
zone TYPE ty_reason VALUE 'ZONE',
|
||||
wind TYPE ty_reason VALUE 'WIND',
|
||||
time TYPE ty_reason VALUE 'TIME',
|
||||
distance TYPE ty_reason VALUE 'ZISTANCE',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_limit,
|
||||
max_wind_kmh TYPE i VALUE 30,
|
||||
min_start_hour TYPE i VALUE 18,
|
||||
max_start_hour TYPE i VALUE 23,
|
||||
free_minutes TYPE i VALUE 10,
|
||||
max_fee_euro TYPE i VALUE 5000,
|
||||
END OF c_limit.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_distance,
|
||||
calibre_50 TYPE i VALUE 30,
|
||||
calibre_75 TYPE i VALUE 45,
|
||||
calibre_100 TYPE i VALUE 60,
|
||||
calibre_150 TYPE i VALUE 90,
|
||||
calibre_200 TYPE i VALUE 120,
|
||||
END OF c_distance.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
|
||||
METHODS calc_fee
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_fee) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
55
tasks_gen/train/G1933/generation.json
Normal file
55
tasks_gen/train/G1933/generation.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"id": "G1933",
|
||||
"pool": "train",
|
||||
"object_type": "INTF",
|
||||
"category": "A",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 76.1,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"reference/pyro_order_test.clas.abap line 6: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 7: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 8: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 9: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 10: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 11: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 12: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"reference/pyro_order_test.clas.abap line 13: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 8: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 9: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 10: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 11: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 12: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 13: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 14: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 15: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 16: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\"",
|
||||
"hidden/pyro_hidden.clas.abap line 17: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"METHODS\""
|
||||
],
|
||||
"by_check": {
|
||||
"abaplint": 18
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
214
tasks_gen/train/G1933/hidden/pyro_hidden.clas.abap
Normal file
214
tasks_gen/train/G1933/hidden/pyro_hidden.clas.abap
Normal file
@@ -0,0 +1,214 @@
|
||||
CLASS {{p}}pyro_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES {{p}}if_pyro_order.
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}if_pyro_order.
|
||||
METHODS setup.
|
||||
METHODS reason_values FOR TESTING.
|
||||
METHODS reason_length FOR TESTING.
|
||||
METHODS zone_length FOR TESTING.
|
||||
METHODS amount_type FOR TESTING.
|
||||
METHODS order_structure FOR TESTING.
|
||||
METHODS reason_structure FOR TESTING.
|
||||
METHODS limit_values FOR TESTING.
|
||||
METHODS distance_values FOR TESTING.
|
||||
METHODS check_order_call FOR TESTING.
|
||||
METHODS calc_fee_call FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}pyro_hidden IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}pyro_hidden( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_pyro_order~check_order.
|
||||
rv_reason = {{p}}if_pyro_order=>c_reason-ok.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_pyro_order~calc_fee.
|
||||
rv_fee = 0.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_values.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
lv_exp = 'OK'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-ok ).
|
||||
lv_exp = 'CALIBRE'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-calibre ).
|
||||
lv_exp = 'ZONE'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-zone ).
|
||||
lv_exp = 'WIND'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-wind ).
|
||||
lv_exp = 'TIME'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-time ).
|
||||
lv_exp = 'DISTANCE'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_length.
|
||||
DATA lv_reason TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
DATA lv_long TYPE c LENGTH 13.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_len TYPE i.
|
||||
DATA(lo_descr) = cl_abap_typedescr=>describe_by_data( lv_reason ).
|
||||
lv_kind = 'C'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_descr->type_kind ).
|
||||
lv_long = 'ABCDEFGHIJKLM'.
|
||||
lv_reason = lv_long.
|
||||
lv_exp = 'ABCDEFGHIJKL'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_reason ).
|
||||
lv_len = 12.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_len act = strlen( lv_reason ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zone_length.
|
||||
DATA lv_zone TYPE {{p}}if_pyro_order=>ty_zone.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_zone.
|
||||
DATA lv_long TYPE c LENGTH 2.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_len TYPE i.
|
||||
DATA(lo_descr) = cl_abap_typedescr=>describe_by_data( lv_zone ).
|
||||
lv_kind = 'C'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_descr->type_kind ).
|
||||
lv_long = 'AB'.
|
||||
lv_zone = lv_long.
|
||||
lv_exp = 'A'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_zone ).
|
||||
lv_len = 1.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_len act = strlen( lv_zone ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD amount_type.
|
||||
DATA lv_amount TYPE {{p}}if_pyro_order=>ty_amount.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_amount.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_dec TYPE i.
|
||||
DATA lv_len TYPE i.
|
||||
DATA(lo_descr) = cl_abap_typedescr=>describe_by_data( lv_amount ).
|
||||
lv_kind = 'P'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_descr->type_kind ).
|
||||
lv_dec = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_dec act = lo_descr->decimals ).
|
||||
lv_len = 8.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_len act = lo_descr->length ).
|
||||
lv_amount = '1234.56'.
|
||||
lv_exp = '1234.56'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_amount ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_structure.
|
||||
DATA ls_order TYPE {{p}}if_pyro_order=>ty_order.
|
||||
DATA lv_count TYPE i.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_name TYPE c LENGTH 30.
|
||||
DATA lv_exp_name TYPE c LENGTH 30.
|
||||
DATA(lo_struct) = CAST cl_abap_structdescr(
|
||||
cl_abap_typedescr=>describe_by_data( ls_order ) ).
|
||||
DATA(lt_comp) = lo_struct->get_components( ).
|
||||
lv_count = 6.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_count act = lines( lt_comp ) ).
|
||||
lv_name = lt_comp[ 1 ]-name.
|
||||
lv_exp_name = 'CALIBRE_MM'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp_name act = lv_name ).
|
||||
lv_kind = 'I'.
|
||||
DATA(lo_elem) = cl_abap_typedescr=>describe_by_data( ls_order-calibre_mm ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-wind_kmh ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-start_hour ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-crowd_m ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-duration_min ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
DATA lv_zone_kind TYPE c LENGTH 1.
|
||||
lv_zone_kind = 'C'.
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-zone_code ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_zone_kind act = lo_elem->type_kind ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_structure.
|
||||
DATA(ls_reason) = {{p}}if_pyro_order=>c_reason.
|
||||
DATA lv_count TYPE i.
|
||||
DATA(lo_struct) = CAST cl_abap_structdescr(
|
||||
cl_abap_typedescr=>describe_by_data( ls_reason ) ).
|
||||
DATA(lt_comp) = lo_struct->get_components( ).
|
||||
lv_count = 6.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_count act = lines( lt_comp ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD limit_values.
|
||||
DATA lv_exp TYPE i.
|
||||
lv_exp = 30.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-max_wind_kmh ).
|
||||
lv_exp = 18.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-min_start_hour ).
|
||||
lv_exp = 23.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-max_start_hour ).
|
||||
lv_exp = 10.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-free_minutes ).
|
||||
lv_exp = 5000.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-max_fee_euro ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD distance_values.
|
||||
DATA lv_exp TYPE i.
|
||||
lv_exp = 30.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_50 ).
|
||||
lv_exp = 45.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_75 ).
|
||||
lv_exp = 60.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_100 ).
|
||||
lv_exp = 90.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_150 ).
|
||||
lv_exp = 120.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_200 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD check_order_call.
|
||||
DATA ls_order TYPE {{p}}if_pyro_order=>ty_order.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
ls_order = VALUE #( calibre_mm = 100
|
||||
zone_code = 'A'
|
||||
wind_kmh = 10
|
||||
start_hour = 20
|
||||
crowd_m = 60
|
||||
duration_min = 15 ).
|
||||
DATA(lv_reason) = mo_cut->check_order( ls_order ).
|
||||
lv_exp = 'OK'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_reason ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD calc_fee_call.
|
||||
DATA ls_order TYPE {{p}}if_pyro_order=>ty_order.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_amount.
|
||||
ls_order = VALUE #( calibre_mm = 100
|
||||
zone_code = 'A'
|
||||
wind_kmh = 10
|
||||
start_hour = 20
|
||||
crowd_m = 60
|
||||
duration_min = 15 ).
|
||||
DATA(lv_fee) = mo_cut->calc_fee( ls_order ).
|
||||
lv_exp = 0.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
54
tasks_gen/train/G1933/mutation.json
Normal file
54
tasks_gen/train/G1933/mutation.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"task": "G1933",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}IF_PYRO_ORDER",
|
||||
"mutant": "line 2: LENGTH 12 -> LENGTH 11 (length)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"REASON_LENGTH"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_PYRO_ORDER",
|
||||
"mutant": "line 4: LENGTH 8 -> LENGTH 7 (length)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"AMOUNT_TYPE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_PYRO_ORDER",
|
||||
"mutant": "line 19: VALUE 'ZONE' -> VALUE 'YONE' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"REASON_VALUES"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_PYRO_ORDER",
|
||||
"mutant": "line 21: VALUE 'TIME' -> VALUE 'ZIME' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"REASON_VALUES"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_PYRO_ORDER",
|
||||
"mutant": "line 22: VALUE 'DISTANCE' -> VALUE 'ZISTANCE' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"REASON_VALUES"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
50
tasks_gen/train/G1933/reference/if_pyro_order.intf.abap
Normal file
50
tasks_gen/train/G1933/reference/if_pyro_order.intf.abap
Normal file
@@ -0,0 +1,50 @@
|
||||
INTERFACE {{p}}if_pyro_order PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 12.
|
||||
TYPES ty_zone TYPE c LENGTH 1.
|
||||
TYPES ty_amount TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
TYPES BEGIN OF ty_order.
|
||||
TYPES calibre_mm TYPE i.
|
||||
TYPES zone_code TYPE ty_zone.
|
||||
TYPES wind_kmh TYPE i.
|
||||
TYPES start_hour TYPE i.
|
||||
TYPES crowd_m TYPE i.
|
||||
TYPES duration_min TYPE i.
|
||||
TYPES END OF ty_order.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
calibre TYPE ty_reason VALUE 'CALIBRE',
|
||||
zone TYPE ty_reason VALUE 'ZONE',
|
||||
wind TYPE ty_reason VALUE 'WIND',
|
||||
time TYPE ty_reason VALUE 'TIME',
|
||||
distance TYPE ty_reason VALUE 'DISTANCE',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_limit,
|
||||
max_wind_kmh TYPE i VALUE 30,
|
||||
min_start_hour TYPE i VALUE 18,
|
||||
max_start_hour TYPE i VALUE 23,
|
||||
free_minutes TYPE i VALUE 10,
|
||||
max_fee_euro TYPE i VALUE 5000,
|
||||
END OF c_limit.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_distance,
|
||||
calibre_50 TYPE i VALUE 30,
|
||||
calibre_75 TYPE i VALUE 45,
|
||||
calibre_100 TYPE i VALUE 60,
|
||||
calibre_150 TYPE i VALUE 90,
|
||||
calibre_200 TYPE i VALUE 120,
|
||||
END OF c_distance.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
|
||||
METHODS calc_fee
|
||||
IMPORTING is_order TYPE ty_order
|
||||
RETURNING VALUE(rv_fee) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
182
tasks_gen/train/G1933/reference/pyro_order_test.clas.abap
Normal file
182
tasks_gen/train/G1933/reference/pyro_order_test.clas.abap
Normal file
@@ -0,0 +1,182 @@
|
||||
CLASS {{p}}pyro_order_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES {{p}}if_pyro_order.
|
||||
PRIVATE SECTION.
|
||||
METHODS reason_values FOR TESTING.
|
||||
METHODS reason_length FOR TESTING.
|
||||
METHODS zone_length FOR TESTING.
|
||||
METHODS amount_type FOR TESTING.
|
||||
METHODS order_structure FOR TESTING.
|
||||
METHODS limit_values FOR TESTING.
|
||||
METHODS distance_values FOR TESTING.
|
||||
METHODS check_order_call FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}pyro_order_test IMPLEMENTATION.
|
||||
METHOD {{p}}if_pyro_order~check_order.
|
||||
rv_reason = {{p}}if_pyro_order=>c_reason-ok.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD {{p}}if_pyro_order~calc_fee.
|
||||
rv_fee = 0.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_values.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
lv_exp = 'OK'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-ok ).
|
||||
lv_exp = 'CALIBRE'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-calibre ).
|
||||
lv_exp = 'ZONE'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-zone ).
|
||||
lv_exp = 'WIND'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-wind ).
|
||||
lv_exp = 'TIME'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-time ).
|
||||
lv_exp = 'DISTANCE'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_reason-distance ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_length.
|
||||
DATA lv_reason TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
DATA lv_long TYPE c LENGTH 13.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_len TYPE i.
|
||||
DATA(lo_descr) = cl_abap_typedescr=>describe_by_data( lv_reason ).
|
||||
lv_kind = 'C'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_descr->type_kind ).
|
||||
lv_long = 'ABCDEFGHIJKLM'.
|
||||
lv_reason = lv_long.
|
||||
lv_exp = 'ABCDEFGHIJKL'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_reason ).
|
||||
lv_len = 12.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_len act = strlen( lv_reason ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zone_length.
|
||||
DATA lv_zone TYPE {{p}}if_pyro_order=>ty_zone.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_zone.
|
||||
DATA lv_long TYPE c LENGTH 2.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_len TYPE i.
|
||||
DATA(lo_descr) = cl_abap_typedescr=>describe_by_data( lv_zone ).
|
||||
lv_kind = 'C'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_descr->type_kind ).
|
||||
lv_long = 'AB'.
|
||||
lv_zone = lv_long.
|
||||
lv_exp = 'A'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_zone ).
|
||||
lv_len = 1.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_len act = strlen( lv_zone ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD amount_type.
|
||||
DATA lv_amount TYPE {{p}}if_pyro_order=>ty_amount.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_amount.
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
DATA lv_dec TYPE i.
|
||||
DATA lv_len TYPE i.
|
||||
DATA(lo_descr) = cl_abap_typedescr=>describe_by_data( lv_amount ).
|
||||
lv_kind = 'P'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_descr->type_kind ).
|
||||
lv_dec = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_dec act = lo_descr->decimals ).
|
||||
lv_len = 8.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_len act = lo_descr->length ).
|
||||
lv_amount = '1234.56'.
|
||||
lv_exp = '1234.56'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_amount ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_structure.
|
||||
DATA ls_order TYPE {{p}}if_pyro_order=>ty_order.
|
||||
DATA lv_count TYPE i.
|
||||
DATA lv_name TYPE c LENGTH 30.
|
||||
DATA lv_exp_name TYPE c LENGTH 30.
|
||||
DATA(lo_struct) = CAST cl_abap_structdescr(
|
||||
cl_abap_typedescr=>describe_by_data( ls_order ) ).
|
||||
DATA(lt_comp) = lo_struct->get_components( ).
|
||||
lv_count = 6.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_count act = lines( lt_comp ) ).
|
||||
lv_name = lt_comp[ 1 ]-name.
|
||||
lv_exp_name = 'CALIBRE_MM'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp_name act = lv_name ).
|
||||
DATA lv_kind TYPE c LENGTH 1.
|
||||
lv_kind = 'I'.
|
||||
DATA(lo_elem) = cl_abap_typedescr=>describe_by_data( ls_order-calibre_mm ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-wind_kmh ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-start_hour ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-crowd_m ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-duration_min ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_kind act = lo_elem->type_kind ).
|
||||
DATA lv_zone_kind TYPE c LENGTH 1.
|
||||
lv_zone_kind = 'C'.
|
||||
lo_elem = cl_abap_typedescr=>describe_by_data( ls_order-zone_code ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_zone_kind act = lo_elem->type_kind ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD limit_values.
|
||||
DATA lv_exp TYPE i.
|
||||
lv_exp = 30.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-max_wind_kmh ).
|
||||
lv_exp = 18.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-min_start_hour ).
|
||||
lv_exp = 23.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-max_start_hour ).
|
||||
lv_exp = 10.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-free_minutes ).
|
||||
lv_exp = 5000.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_limit-max_fee_euro ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD distance_values.
|
||||
DATA lv_exp TYPE i.
|
||||
lv_exp = 30.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_50 ).
|
||||
lv_exp = 45.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_75 ).
|
||||
lv_exp = 60.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_100 ).
|
||||
lv_exp = 90.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_150 ).
|
||||
lv_exp = 120.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp
|
||||
act = {{p}}if_pyro_order=>c_distance-calibre_200 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD check_order_call.
|
||||
DATA ls_order TYPE {{p}}if_pyro_order=>ty_order.
|
||||
DATA lv_exp TYPE {{p}}if_pyro_order=>ty_reason.
|
||||
ls_order = VALUE #( calibre_mm = 100
|
||||
zone_code = 'A'
|
||||
wind_kmh = 10
|
||||
start_hour = 20
|
||||
crowd_m = 60
|
||||
duration_min = 15 ).
|
||||
DATA(lv_reason) = {{p}}if_pyro_order~check_order( ls_order ).
|
||||
lv_exp = 'OK'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_reason ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
67
tasks_gen/train/G1933/spec.md
Normal file
67
tasks_gen/train/G1933/spec.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# 1. Goal
|
||||
A fireworks display company plans displays for its clients. The order desk calls
|
||||
one contract for the check of a display plan and for the fee of the display.
|
||||
Create the interface that carries this contract.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- The order desk of the fireworks display company receives one display plan for
|
||||
each order. A plan has the calibre of the shells in millimetres, the zone of the
|
||||
firing site, the wind speed in kilometres per hour, the start hour, the distance
|
||||
to the crowd in metres and the duration of the display in minutes.
|
||||
- The desk checks the plan before it confirms the order. The check stops at the
|
||||
first rule that fails and returns one reason code.
|
||||
- The desk calculates the fee of the display in euro after the check.
|
||||
- The interface {{P}}IF_PYRO_ORDER does not exist yet. Create it in package
|
||||
$TMP. The interface is the only object that the order desk needs.
|
||||
|
||||
# 4. Contract
|
||||
- Create the interface {{P}}IF_PYRO_ORDER in package $TMP.
|
||||
- The interface has the types TY_REASON, TY_ZONE, TY_AMOUNT and TY_ORDER.
|
||||
- The interface has the constant structures C_REASON, C_LIMIT and C_DISTANCE.
|
||||
- The interface has the methods CHECK_ORDER and CALC_FEE.
|
||||
- The interface has no other types, constants or methods.
|
||||
|
||||
# 5. Business rules
|
||||
1. TY_REASON is a character type of length 12. It holds the reason code of the
|
||||
check.
|
||||
2. TY_ZONE is a character type of length 1. It holds the zone of the firing
|
||||
site.
|
||||
3. TY_AMOUNT is a packed type of length 8 with 2 decimal places. It holds an
|
||||
amount in euro.
|
||||
4. TY_ORDER is a structure with exactly these six components, in this sequence:
|
||||
CALIBRE_MM of type i, ZONE_CODE of type TY_ZONE, WIND_KMH of type i,
|
||||
START_HOUR of type i, CROWD_M of type i and DURATION_MIN of type i.
|
||||
5. C_REASON is a constant structure with exactly six components of type
|
||||
TY_REASON:
|
||||
OK = 'OK' for an accepted plan,
|
||||
CALIBRE = 'CALIBRE' for a calibre that the company does not use,
|
||||
ZONE = 'ZONE' for a zone that is not A, B or C,
|
||||
WIND = 'WIND' for a wind that is stronger than the wind limit,
|
||||
TIME = 'TIME' for a start hour outside the start window,
|
||||
DISTANCE = 'DISTANCE' for a crowd distance below the safety distance.
|
||||
6. C_LIMIT is a constant structure with exactly five components of type i:
|
||||
MAX_WIND_KMH = 30, MIN_START_HOUR = 18, MAX_START_HOUR = 23,
|
||||
FREE_MINUTES = 10 and MAX_FEE_EURO = 5000.
|
||||
7. C_DISTANCE is a constant structure with exactly five components of type i:
|
||||
CALIBRE_50 = 30, CALIBRE_75 = 45, CALIBRE_100 = 60, CALIBRE_150 = 90 and
|
||||
CALIBRE_200 = 120. A component holds the safety distance in metres for the
|
||||
calibre of the same name in millimetres. The company uses only these five
|
||||
calibres.
|
||||
8. CHECK_ORDER has the importing parameter IS_ORDER of type TY_ORDER and the
|
||||
returning parameter RV_REASON of type TY_REASON.
|
||||
9. CALC_FEE has the importing parameter IS_ORDER of type TY_ORDER and the
|
||||
returning parameter RV_FEE of type TY_AMOUNT.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Coding standards: Clean ABAP. Upper case for the names of the types, the
|
||||
constants and the methods. No comment that restates the code.
|
||||
- Out of scope: do not create other objects in package $TMP.
|
||||
|
||||
# 7. Acceptance
|
||||
- The interface is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write your own ABAP Unit tests for the interface.
|
||||
48
tasks_gen/train/G1933/task.json
Normal file
48
tasks_gen/train/G1933/task.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"id": "G1933",
|
||||
"category": "A",
|
||||
"object_type": "INTF",
|
||||
"difficulty": 3,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [],
|
||||
"contract": [
|
||||
{
|
||||
"type": "INTF",
|
||||
"name": "{{P}}IF_PYRO_ORDER"
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"Do not create other objects in package $TMP."
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}PYRO_HIDDEN",
|
||||
"file": "hidden/pyro_hidden.clas.abap",
|
||||
"description": "Hidden tests for the interface {{P}}IF_PYRO_ORDER. The global test class itself implements the interface, therefore it only compiles when every signature matches. The tests read the constants, check the type kinds and the lengths of the types, check the components of the structures, and call both methods through the interface."
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "INTF",
|
||||
"name": "{{P}}IF_PYRO_ORDER",
|
||||
"file": "reference/if_pyro_order.intf.abap",
|
||||
"description": "Contract of the fireworks display order desk"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}PYRO_ORDER_TEST",
|
||||
"file": "reference/pyro_order_test.clas.abap",
|
||||
"description": "Own ABAP Unit tests for the interface (global test class)"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length",
|
||||
"db_operation_in_loop"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user