Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
22
tasks_gen/train/G1100/faulty/m0_i_berth_fee.ddls.asddls
Normal file
22
tasks_gen/train/G1100/faulty/m0_i_berth_fee.ddls.asddls
Normal file
@@ -0,0 +1,22 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Berth fee'
|
||||
define view entity {{P}}I_BERTH_FEE
|
||||
as select from {{p}}berth as berth
|
||||
left outer join {{p}}pier as pier on pier.pier_code = berth.pier_code
|
||||
{
|
||||
key berth.berth_id as berth_id,
|
||||
berth.boat_name as boat_name,
|
||||
case
|
||||
when berth.length_m < 8 then 'SMALL'
|
||||
when berth.length_m <= 15 then 'MEDIUM'
|
||||
else 'LARGE'
|
||||
end as size_class,
|
||||
cast( berth.length_m * 100 as abap.int4 ) as length_cm,
|
||||
cast( round( ( pier.base_fee + berth.length_m * pier.rate_per_m
|
||||
+ case when berth.shore_power = 'Y'
|
||||
then pier.power_fee
|
||||
else cast( 0 as abap.dec( 10, 2 ) )
|
||||
end )
|
||||
* berth.stay_days, 2 )
|
||||
as abap.dec( 15, 2 ) ) as total_fee
|
||||
}
|
||||
22
tasks_gen/train/G1100/faulty/m1_i_berth_fee.ddls.asddls
Normal file
22
tasks_gen/train/G1100/faulty/m1_i_berth_fee.ddls.asddls
Normal file
@@ -0,0 +1,22 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Berth fee'
|
||||
define view entity {{P}}I_BERTH_FEE
|
||||
as select from {{p}}berth as berth
|
||||
inner join {{p}}pier as pier on pier.pier_code = berth.pier_code
|
||||
{
|
||||
key berth.berth_id as berth_id,
|
||||
berth.boat_name as boat_name,
|
||||
case
|
||||
when berth.length_m >= 8 then 'SMALL'
|
||||
when berth.length_m <= 15 then 'MEDIUM'
|
||||
else 'LARGE'
|
||||
end as size_class,
|
||||
cast( berth.length_m * 100 as abap.int4 ) as length_cm,
|
||||
cast( round( ( pier.base_fee + berth.length_m * pier.rate_per_m
|
||||
+ case when berth.shore_power = 'Y'
|
||||
then pier.power_fee
|
||||
else cast( 0 as abap.dec( 10, 2 ) )
|
||||
end )
|
||||
* berth.stay_days, 2 )
|
||||
as abap.dec( 15, 2 ) ) as total_fee
|
||||
}
|
||||
22
tasks_gen/train/G1100/faulty/m2_i_berth_fee.ddls.asddls
Normal file
22
tasks_gen/train/G1100/faulty/m2_i_berth_fee.ddls.asddls
Normal file
@@ -0,0 +1,22 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Berth fee'
|
||||
define view entity {{P}}I_BERTH_FEE
|
||||
as select from {{p}}berth as berth
|
||||
inner join {{p}}pier as pier on pier.pier_code = berth.pier_code
|
||||
{
|
||||
key berth.berth_id as berth_id,
|
||||
berth.boat_name as boat_name,
|
||||
case
|
||||
when berth.length_m < 8 then 'SMALL'
|
||||
when berth.length_m <= 16 then 'MEDIUM'
|
||||
else 'LARGE'
|
||||
end as size_class,
|
||||
cast( berth.length_m * 100 as abap.int4 ) as length_cm,
|
||||
cast( round( ( pier.base_fee + berth.length_m * pier.rate_per_m
|
||||
+ case when berth.shore_power = 'Y'
|
||||
then pier.power_fee
|
||||
else cast( 0 as abap.dec( 10, 2 ) )
|
||||
end )
|
||||
* berth.stay_days, 2 )
|
||||
as abap.dec( 15, 2 ) ) as total_fee
|
||||
}
|
||||
22
tasks_gen/train/G1100/faulty/m3_i_berth_fee.ddls.asddls
Normal file
22
tasks_gen/train/G1100/faulty/m3_i_berth_fee.ddls.asddls
Normal file
@@ -0,0 +1,22 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Berth fee'
|
||||
define view entity {{P}}I_BERTH_FEE
|
||||
as select from {{p}}berth as berth
|
||||
inner join {{p}}pier as pier on pier.pier_code = berth.pier_code
|
||||
{
|
||||
key berth.berth_id as berth_id,
|
||||
berth.boat_name as boat_name,
|
||||
case
|
||||
when berth.length_m < 8 then 'SMALL'
|
||||
when berth.length_m <= 15 then 'MEDIUM'
|
||||
else 'LARGE'
|
||||
end as size_class,
|
||||
cast( berth.length_m * 100 as abap.int4 ) as length_cm,
|
||||
cast( round( ( pier.base_fee - berth.length_m * pier.rate_per_m
|
||||
+ case when berth.shore_power = 'Y'
|
||||
then pier.power_fee
|
||||
else cast( 0 as abap.dec( 10, 2 ) )
|
||||
end )
|
||||
* berth.stay_days, 2 )
|
||||
as abap.dec( 15, 2 ) ) as total_fee
|
||||
}
|
||||
22
tasks_gen/train/G1100/faulty/m4_i_berth_fee.ddls.asddls
Normal file
22
tasks_gen/train/G1100/faulty/m4_i_berth_fee.ddls.asddls
Normal file
@@ -0,0 +1,22 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Berth fee'
|
||||
define view entity {{P}}I_BERTH_FEE
|
||||
as select from {{p}}berth as berth
|
||||
inner join {{p}}pier as pier on pier.pier_code = berth.pier_code
|
||||
{
|
||||
key berth.berth_id as berth_id,
|
||||
berth.boat_name as boat_name,
|
||||
case
|
||||
when berth.length_m < 8 then 'SMALL'
|
||||
when berth.length_m <= 15 then 'MEDIUM'
|
||||
else 'LARGE'
|
||||
end as size_class,
|
||||
cast( berth.length_m * 100 as abap.int4 ) as length_cm,
|
||||
cast( round( ( pier.base_fee + berth.length_m * pier.rate_per_m
|
||||
+ case when berth.shore_power <> 'Y'
|
||||
then pier.power_fee
|
||||
else cast( 0 as abap.dec( 10, 2 ) )
|
||||
end )
|
||||
* berth.stay_days, 2 )
|
||||
as abap.dec( 15, 2 ) ) as total_fee
|
||||
}
|
||||
37
tasks_gen/train/G1100/generation.json
Normal file
37
tasks_gen/train/G1100/generation.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"id": "G1100",
|
||||
"pool": "train",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"Too close to task G0005 (similarity spec 0.57, rules 0.64, names 0.00). Choose a different business topic and different object names."
|
||||
],
|
||||
"by_check": {
|
||||
"extra": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"seed/berth.tabl.asabap: field name days is a reserved word; choose another name"
|
||||
],
|
||||
"by_check": {
|
||||
"static": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
129
tasks_gen/train/G1100/hidden/t42_hidden.clas.abap
Normal file
129
tasks_gen/train/G1100/hidden/t42_hidden.clas.abap
Normal file
@@ -0,0 +1,129 @@
|
||||
CLASS {{p}}t42_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS small_class FOR TESTING.
|
||||
METHODS medium_class FOR TESTING.
|
||||
METHODS large_class FOR TESTING.
|
||||
METHODS length_in_centimetres FOR TESTING.
|
||||
METHODS fee_without_power FOR TESTING.
|
||||
METHODS power_surcharge FOR TESTING.
|
||||
METHODS rounds_after_days FOR TESTING.
|
||||
METHODS large_boat_fee FOR TESTING.
|
||||
METHODS unknown_pier_ignored FOR TESTING.
|
||||
METHODS boat_name_shown FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t42_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BERTH_FEE' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_pier TYPE STANDARD TABLE OF {{p}}pier WITH EMPTY KEY.
|
||||
DATA lt_berth TYPE STANDARD TABLE OF {{p}}berth WITH EMPTY KEY.
|
||||
|
||||
go_env->clear_doubles( ).
|
||||
|
||||
lt_pier = VALUE #( ( pier_code = 'A' base_fee = '20.00' rate_per_m = '3.00' power_fee = '5.00' )
|
||||
( pier_code = 'B' base_fee = '10.00' rate_per_m = '1.55' power_fee = '2.00' )
|
||||
( pier_code = 'C' base_fee = '40.00' rate_per_m = '5.00' power_fee = '8.00' ) ).
|
||||
|
||||
lt_berth = VALUE #( ( berth_id = 'H1' boat_name = 'SEAGULL' length_m = '7.50' pier_code = 'A' shore_power = 'N' stay_days = 2 )
|
||||
( berth_id = 'H2' boat_name = 'MARLIN' length_m = '8.00' pier_code = 'A' shore_power = 'Y' stay_days = 3 )
|
||||
( berth_id = 'H3' boat_name = 'OTTER' length_m = '15.00' pier_code = 'B' shore_power = 'N' stay_days = 1 )
|
||||
( berth_id = 'H4' boat_name = 'PELICAN' length_m = '15.01' pier_code = 'B' shore_power = 'Y' stay_days = 2 )
|
||||
( berth_id = 'H5' boat_name = 'DOLPHIN' length_m = '9.99' pier_code = 'B' shore_power = 'N' stay_days = 3 )
|
||||
( berth_id = 'H6' boat_name = 'SKUA' length_m = '9.99' pier_code = 'B' shore_power = 'Y' stay_days = 3 )
|
||||
( berth_id = 'H7' boat_name = 'TERN' length_m = '12.34' pier_code = 'C' shore_power = 'N' stay_days = 4 )
|
||||
( berth_id = 'H8' boat_name = 'GULL' length_m = '6.00' pier_code = 'Z' shore_power = 'N' stay_days = 1 )
|
||||
( berth_id = 'H9' boat_name = 'HERON' length_m = '20.00' pier_code = 'C' shore_power = 'Y' stay_days = 1 ) ).
|
||||
|
||||
go_env->insert_test_data( lt_pier ).
|
||||
go_env->insert_test_data( lt_berth ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD small_class.
|
||||
SELECT SINGLE size_class FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H1' INTO @DATA(lv_class).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'SMALL' act = condense( val = lv_class ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD medium_class.
|
||||
SELECT SINGLE size_class FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H2' INTO @DATA(lv_lower).
|
||||
SELECT SINGLE size_class FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H3' INTO @DATA(lv_upper).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'MEDIUM' act = condense( val = lv_lower ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'MEDIUM' act = condense( val = lv_upper ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD large_class.
|
||||
SELECT SINGLE size_class FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H4' INTO @DATA(lv_class).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LARGE' act = condense( val = lv_class ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD length_in_centimetres.
|
||||
SELECT SINGLE length_cm FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H1' INTO @DATA(lv_small).
|
||||
SELECT SINGLE length_cm FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H5' INTO @DATA(lv_medium).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 750 )
|
||||
act = CONV decfloat34( lv_small ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 999 )
|
||||
act = CONV decfloat34( lv_medium ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD fee_without_power.
|
||||
SELECT SINGLE total_fee FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H1' INTO @DATA(lv_fee).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '85.00' )
|
||||
act = CONV decfloat34( lv_fee ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD power_surcharge.
|
||||
SELECT SINGLE total_fee FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H2' INTO @DATA(lv_fee).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '147.00' )
|
||||
act = CONV decfloat34( lv_fee ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rounds_after_days.
|
||||
SELECT SINGLE total_fee FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H5' INTO @DATA(lv_plain).
|
||||
SELECT SINGLE total_fee FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H6' INTO @DATA(lv_power).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '76.45' )
|
||||
act = CONV decfloat34( lv_plain ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '82.45' )
|
||||
act = CONV decfloat34( lv_power ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD large_boat_fee.
|
||||
SELECT SINGLE total_fee FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H9' INTO @DATA(lv_fee).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '148.00' )
|
||||
act = CONV decfloat34( lv_fee ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_pier_ignored.
|
||||
SELECT COUNT(*) FROM {{p}}i_berth_fee INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 8 )
|
||||
act = CONV decfloat34( lv_rows ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD boat_name_shown.
|
||||
SELECT SINGLE boat_name FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'H3' INTO @DATA(lv_name).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'OTTER' act = condense( val = lv_name ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
62
tasks_gen/train/G1100/mutation.json
Normal file
62
tasks_gen/train/G1100/mutation.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"task": "G1100",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}I_BERTH_FEE",
|
||||
"mutant": "line 5: inner join -> left outer join (join)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"UNKNOWN_PIER_IGNORED"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_BERTH_FEE",
|
||||
"mutant": "line 10: < -> >= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "7/10",
|
||||
"failed_tests": [
|
||||
"LARGE_CLASS",
|
||||
"MEDIUM_CLASS",
|
||||
"SMALL_CLASS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_BERTH_FEE",
|
||||
"mutant": "line 11: 15 -> 16 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"LARGE_CLASS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_BERTH_FEE",
|
||||
"mutant": "line 15: + -> - (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "6/10",
|
||||
"failed_tests": [
|
||||
"FEE_WITHOUT_POWER",
|
||||
"LARGE_BOAT_FEE",
|
||||
"POWER_SURCHARGE",
|
||||
"ROUNDS_AFTER_DAYS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_BERTH_FEE",
|
||||
"mutant": "line 16: = -> <> (eq)",
|
||||
"status": "killed",
|
||||
"hidden": "6/10",
|
||||
"failed_tests": [
|
||||
"FEE_WITHOUT_POWER",
|
||||
"LARGE_BOAT_FEE",
|
||||
"POWER_SURCHARGE",
|
||||
"ROUNDS_AFTER_DAYS"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
22
tasks_gen/train/G1100/reference/i_berth_fee.ddls.asddls
Normal file
22
tasks_gen/train/G1100/reference/i_berth_fee.ddls.asddls
Normal file
@@ -0,0 +1,22 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Berth fee'
|
||||
define view entity {{P}}I_BERTH_FEE
|
||||
as select from {{p}}berth as berth
|
||||
inner join {{p}}pier as pier on pier.pier_code = berth.pier_code
|
||||
{
|
||||
key berth.berth_id as berth_id,
|
||||
berth.boat_name as boat_name,
|
||||
case
|
||||
when berth.length_m < 8 then 'SMALL'
|
||||
when berth.length_m <= 15 then 'MEDIUM'
|
||||
else 'LARGE'
|
||||
end as size_class,
|
||||
cast( berth.length_m * 100 as abap.int4 ) as length_cm,
|
||||
cast( round( ( pier.base_fee + berth.length_m * pier.rate_per_m
|
||||
+ case when berth.shore_power = 'Y'
|
||||
then pier.power_fee
|
||||
else cast( 0 as abap.dec( 10, 2 ) )
|
||||
end )
|
||||
* berth.stay_days, 2 )
|
||||
as abap.dec( 15, 2 ) ) as total_fee
|
||||
}
|
||||
45
tasks_gen/train/G1100/reference/t42_test.clas.abap
Normal file
45
tasks_gen/train/G1100/reference/t42_test.clas.abap
Normal file
@@ -0,0 +1,45 @@
|
||||
CLASS {{p}}t42_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS fee_of_one_berth FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t42_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BERTH_FEE' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_pier TYPE STANDARD TABLE OF {{p}}pier WITH EMPTY KEY.
|
||||
DATA lt_berth TYPE STANDARD TABLE OF {{p}}berth WITH EMPTY KEY.
|
||||
|
||||
go_env->clear_doubles( ).
|
||||
|
||||
lt_pier = VALUE #( ( pier_code = 'A' base_fee = '20.00' rate_per_m = '3.00' power_fee = '5.00' ) ).
|
||||
lt_berth = VALUE #( ( berth_id = 'A' boat_name = 'TEST BOAT' length_m = '8.00'
|
||||
pier_code = 'A' shore_power = 'N' stay_days = 2 ) ).
|
||||
|
||||
go_env->insert_test_data( lt_pier ).
|
||||
go_env->insert_test_data( lt_berth ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD fee_of_one_berth.
|
||||
SELECT SINGLE size_class, length_cm, total_fee FROM {{p}}i_berth_fee
|
||||
WHERE berth_id = 'A' INTO @DATA(ls_result).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'MEDIUM'
|
||||
act = condense( val = ls_result-size_class ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 800 )
|
||||
act = CONV decfloat34( ls_result-length_cm ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '88.00' )
|
||||
act = CONV decfloat34( ls_result-total_fee ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
14
tasks_gen/train/G1100/seed/berth.tabl.asabap
Normal file
14
tasks_gen/train/G1100/seed/berth.tabl.asabap
Normal file
@@ -0,0 +1,14 @@
|
||||
@EndUserText.label : 'Berth booking'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}berth {
|
||||
key client : abap.clnt not null;
|
||||
key berth_id : abap.char(10) not null;
|
||||
boat_name : abap.char(12);
|
||||
length_m : abap.dec(6,2);
|
||||
pier_code : abap.char(1);
|
||||
shore_power : abap.char(1);
|
||||
stay_days : abap.int4;
|
||||
}
|
||||
12
tasks_gen/train/G1100/seed/pier.tabl.asabap
Normal file
12
tasks_gen/train/G1100/seed/pier.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Pier rate'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}pier {
|
||||
key client : abap.clnt not null;
|
||||
key pier_code : abap.char(1) not null;
|
||||
base_fee : abap.dec(10,2);
|
||||
rate_per_m : abap.dec(10,2);
|
||||
power_fee : abap.dec(10,2);
|
||||
}
|
||||
36
tasks_gen/train/G1100/seed/seed_berth.clas.abap
Normal file
36
tasks_gen/train/G1100/seed/seed_berth.clas.abap
Normal file
@@ -0,0 +1,36 @@
|
||||
CLASS {{p}}seed_berth DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_berth IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DATA lt_pier TYPE STANDARD TABLE OF {{p}}pier WITH EMPTY KEY.
|
||||
DATA lt_berth TYPE STANDARD TABLE OF {{p}}berth WITH EMPTY KEY.
|
||||
|
||||
DELETE FROM {{p}}berth.
|
||||
DELETE FROM {{p}}pier.
|
||||
|
||||
lt_pier = VALUE #( ( pier_code = 'A' base_fee = '20.00' rate_per_m = '3.00' power_fee = '5.00' )
|
||||
( pier_code = 'B' base_fee = '10.00' rate_per_m = '1.55' power_fee = '2.00' )
|
||||
( pier_code = 'C' base_fee = '40.00' rate_per_m = '5.00' power_fee = '8.00' ) ).
|
||||
|
||||
lt_berth = VALUE #( ( berth_id = 'B1' boat_name = 'SEAGULL' length_m = '7.50' pier_code = 'A' shore_power = 'N' stay_days = 2 )
|
||||
( berth_id = 'B2' boat_name = 'MARLIN' length_m = '8.00' pier_code = 'A' shore_power = 'Y' stay_days = 3 )
|
||||
( berth_id = 'B3' boat_name = 'OTTER' length_m = '15.00' pier_code = 'B' shore_power = 'N' stay_days = 1 )
|
||||
( berth_id = 'B4' boat_name = 'PELICAN' length_m = '15.01' pier_code = 'B' shore_power = 'Y' stay_days = 2 )
|
||||
( berth_id = 'B5' boat_name = 'DOLPHIN' length_m = '9.99' pier_code = 'B' shore_power = 'N' stay_days = 3 )
|
||||
( berth_id = 'B6' boat_name = 'SKUA' length_m = '9.99' pier_code = 'B' shore_power = 'Y' stay_days = 3 )
|
||||
( berth_id = 'B7' boat_name = 'TERN' length_m = '12.34' pier_code = 'C' shore_power = 'N' stay_days = 4 )
|
||||
( berth_id = 'B8' boat_name = 'GULL' length_m = '6.00' pier_code = 'Z' shore_power = 'N' stay_days = 1 )
|
||||
( berth_id = 'B9' boat_name = 'HERON' length_m = '20.00' pier_code = 'C' shore_power = 'Y' stay_days = 1 ) ).
|
||||
|
||||
INSERT {{p}}pier FROM TABLE @lt_pier.
|
||||
INSERT {{p}}berth FROM TABLE @lt_berth.
|
||||
|
||||
out->write( |Seed data inserted: { lines( lt_berth ) } berth bookings| ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
47
tasks_gen/train/G1100/spec.md
Normal file
47
tasks_gen/train/G1100/spec.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# 1. Goal
|
||||
A marina rents berths to boat owners. The fee of a berth depends on the pier
|
||||
and on the length of the boat. A report and an OData service will read the
|
||||
fees. Therefore the calculation must be in the database, in a CDS view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}BERTH (berth booking), package $TMP. Key: BERTH_ID (CHAR 10).
|
||||
Fields: BOAT_NAME (CHAR 12), LENGTH_M (DEC 6,2, the length of the boat in
|
||||
metres), PIER_CODE (CHAR 1), SHORE_POWER (CHAR 1, 'Y' = the boat uses shore
|
||||
power, 'N' = it does not), STAY_DAYS (INT4, the number of days of the
|
||||
booking).
|
||||
- Table {{P}}PIER (pier rate), package $TMP. Key: PIER_CODE (CHAR 1).
|
||||
Fields: BASE_FEE (DEC 10,2, for one day), RATE_PER_M (DEC 10,2, for one metre
|
||||
and one day), POWER_FEE (DEC 10,2, for one day of shore power).
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_BERTH_FEE in package $TMP.
|
||||
- Elements, with these names: BERTH_ID (key), BOAT_NAME, SIZE_CLASS, LENGTH_CM,
|
||||
TOTAL_FEE.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. Show one row for each berth booking that has a pier in {{P}}PIER. Do not show
|
||||
a booking whose PIER_CODE is not in {{P}}PIER.
|
||||
2. SIZE_CLASS is 'SMALL' if LENGTH_M is less than 8.00. SIZE_CLASS is 'MEDIUM'
|
||||
if LENGTH_M is 8.00 or more and 15.00 or less. SIZE_CLASS is 'LARGE' if
|
||||
LENGTH_M is more than 15.00.
|
||||
3. LENGTH_CM is the length of the boat in whole centimetres.
|
||||
4. The fee for one day is the base fee of the pier plus LENGTH_M multiplied by
|
||||
the rate per metre of the pier. If SHORE_POWER is 'Y', add the power fee of
|
||||
the pier. Do not round this value yet.
|
||||
5. TOTAL_FEE is the fee for one day multiplied by STAY_DAYS, rounded to 2
|
||||
decimals.
|
||||
6. BOAT_NAME is the name of the boat.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Use Clean ABAP. Keep every method below 40 statements.
|
||||
- Out of scope: do not change {{P}}BERTH and {{P}}PIER.
|
||||
|
||||
# 7. Acceptance
|
||||
- The view is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.
|
||||
73
tasks_gen/train/G1100/task.json
Normal file
73
tasks_gen/train/G1100/task.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"id": "G1100",
|
||||
"category": "B",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v758",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}BERTH",
|
||||
"file": "seed/berth.tabl.asabap",
|
||||
"description": "Berth booking"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}PIER",
|
||||
"file": "seed/pier.tabl.asabap",
|
||||
"description": "Pier rate"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_BERTH",
|
||||
"file": "seed/seed_berth.clas.abap",
|
||||
"description": "Seed data for both tables",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_BERTH_FEE",
|
||||
"fields": [
|
||||
"BERTH_ID",
|
||||
"BOAT_NAME",
|
||||
"SIZE_CLASS",
|
||||
"LENGTH_CM",
|
||||
"TOTAL_FEE"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}BERTH",
|
||||
"{{P}}PIER"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T42_HIDDEN",
|
||||
"file": "hidden/t42_hidden.clas.abap",
|
||||
"description": "T42 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_BERTH_FEE",
|
||||
"file": "reference/i_berth_fee.ddls.asddls",
|
||||
"description": "Berth fee"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T42_TEST",
|
||||
"file": "reference/t42_test.clas.abap",
|
||||
"description": "T42 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user