Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
18
tasks_gen/train/G1000/faulty/m0_i_cont_weight.ddls.asddls
Normal file
18
tasks_gen/train/G1000/faulty/m0_i_cont_weight.ddls.asddls
Normal file
@@ -0,0 +1,18 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Container weight check'
|
||||
define view entity {{P}}I_CONT_WEIGHT
|
||||
as select from {{p}}cont as cont
|
||||
inner join {{p}}weigh as weigh on weigh.cont_id <> cont.cont_id
|
||||
{
|
||||
key cont.cont_id as cont_id,
|
||||
cont.customer as customer,
|
||||
cont.decl_kg as decl_kg,
|
||||
weigh.meas_kg as meas_kg,
|
||||
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
|
||||
division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
|
||||
case
|
||||
when weigh.meas_kg > cont.max_kg then 'HOLD'
|
||||
when division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) > 5 then 'WARN'
|
||||
else 'LOAD'
|
||||
end as status
|
||||
}
|
||||
18
tasks_gen/train/G1000/faulty/m1_i_cont_weight.ddls.asddls
Normal file
18
tasks_gen/train/G1000/faulty/m1_i_cont_weight.ddls.asddls
Normal file
@@ -0,0 +1,18 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Container weight check'
|
||||
define view entity {{P}}I_CONT_WEIGHT
|
||||
as select from {{p}}cont as cont
|
||||
inner join {{p}}weigh as weigh on weigh.cont_id = cont.cont_id
|
||||
{
|
||||
key cont.cont_id as cont_id,
|
||||
cont.customer as customer,
|
||||
cont.decl_kg as decl_kg,
|
||||
weigh.meas_kg as meas_kg,
|
||||
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
|
||||
division( abs( weigh.meas_kg + cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
|
||||
case
|
||||
when weigh.meas_kg > cont.max_kg then 'HOLD'
|
||||
when division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) > 5 then 'WARN'
|
||||
else 'LOAD'
|
||||
end as status
|
||||
}
|
||||
18
tasks_gen/train/G1000/faulty/m2_i_cont_weight.ddls.asddls
Normal file
18
tasks_gen/train/G1000/faulty/m2_i_cont_weight.ddls.asddls
Normal file
@@ -0,0 +1,18 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Container weight check'
|
||||
define view entity {{P}}I_CONT_WEIGHT
|
||||
as select from {{p}}cont as cont
|
||||
inner join {{p}}weigh as weigh on weigh.cont_id = cont.cont_id
|
||||
{
|
||||
key cont.cont_id as cont_id,
|
||||
cont.customer as customer,
|
||||
cont.decl_kg as decl_kg,
|
||||
weigh.meas_kg as meas_kg,
|
||||
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
|
||||
division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
|
||||
case
|
||||
when weigh.meas_kg <= cont.max_kg then 'HOLD'
|
||||
when division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) > 5 then 'WARN'
|
||||
else 'LOAD'
|
||||
end as status
|
||||
}
|
||||
18
tasks_gen/train/G1000/faulty/m3_i_cont_weight.ddls.asddls
Normal file
18
tasks_gen/train/G1000/faulty/m3_i_cont_weight.ddls.asddls
Normal file
@@ -0,0 +1,18 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Container weight check'
|
||||
define view entity {{P}}I_CONT_WEIGHT
|
||||
as select from {{p}}cont as cont
|
||||
inner join {{p}}weigh as weigh on weigh.cont_id = cont.cont_id
|
||||
{
|
||||
key cont.cont_id as cont_id,
|
||||
cont.customer as customer,
|
||||
cont.decl_kg as decl_kg,
|
||||
weigh.meas_kg as meas_kg,
|
||||
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
|
||||
division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
|
||||
case
|
||||
when weigh.meas_kg > cont.max_kg then 'HOLD'
|
||||
when division( abs( weigh.meas_kg - cont.decl_kg ) * 101, cont.decl_kg, 2 ) > 5 then 'WARN'
|
||||
else 'LOAD'
|
||||
end as status
|
||||
}
|
||||
18
tasks_gen/train/G1000/faulty/m4_i_cont_weight.ddls.asddls
Normal file
18
tasks_gen/train/G1000/faulty/m4_i_cont_weight.ddls.asddls
Normal file
@@ -0,0 +1,18 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Container weight check'
|
||||
define view entity {{P}}I_CONT_WEIGHT
|
||||
as select from {{p}}cont as cont
|
||||
inner join {{p}}weigh as weigh on weigh.cont_id = cont.cont_id
|
||||
{
|
||||
key cont.cont_id as cont_id,
|
||||
cont.customer as customer,
|
||||
cont.decl_kg as decl_kg,
|
||||
weigh.meas_kg as meas_kg,
|
||||
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
|
||||
division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
|
||||
case
|
||||
when weigh.meas_kg > cont.max_kg then 'HOLD'
|
||||
when division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) > 5 then 'WARN'
|
||||
else 'ZOAD'
|
||||
end as status
|
||||
}
|
||||
19
tasks_gen/train/G1000/generation.json
Normal file
19
tasks_gen/train/G1000/generation.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "G1000",
|
||||
"pool": "train",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
108
tasks_gen/train/G1000/hidden/t20_hidden.clas.abap
Normal file
108
tasks_gen/train/G1000/hidden/t20_hidden.clas.abap
Normal file
@@ -0,0 +1,108 @@
|
||||
CLASS {{p}}t20_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 deviation_below FOR TESTING.
|
||||
METHODS deviation_zero FOR TESTING.
|
||||
METHODS deviation_above FOR TESTING.
|
||||
METHODS percent_rounded FOR TESTING.
|
||||
METHODS status_hold FOR TESTING.
|
||||
METHODS status_warn FOR TESTING.
|
||||
METHODS status_load FOR TESTING.
|
||||
METHODS status_at_five_pct FOR TESTING.
|
||||
METHODS unweighed_hidden FOR TESTING.
|
||||
METHODS customer_shown FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_CONT_WEIGHT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_cont TYPE STANDARD TABLE OF {{p}}cont WITH EMPTY KEY.
|
||||
DATA lt_weigh TYPE STANDARD TABLE OF {{p}}weigh WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_cont = VALUE #(
|
||||
( cont_id = 'C1' customer = 'ALPHA' decl_kg = '1000.00' max_kg = '1200.00' )
|
||||
( cont_id = 'C2' customer = 'BETA' decl_kg = '1000.00' max_kg = '1200.00' )
|
||||
( cont_id = 'C3' customer = 'GAMMA' decl_kg = '1000.00' max_kg = '1200.00' )
|
||||
( cont_id = 'C4' customer = 'DELTA' decl_kg = '500.00' max_kg = '600.00' )
|
||||
( cont_id = 'C5' customer = 'EPSILON' decl_kg = '1000.00' max_kg = '1200.00' )
|
||||
( cont_id = 'C6' customer = 'ZETA' decl_kg = '1000.00' max_kg = '1200.00' )
|
||||
( cont_id = 'C7' customer = 'ETA' decl_kg = '800.00' max_kg = '900.00' )
|
||||
( cont_id = 'C8' customer = 'THETA' decl_kg = '300.00' max_kg = '400.00' ) ).
|
||||
lt_weigh = VALUE #(
|
||||
( cont_id = 'C1' meas_kg = '1020.00' )
|
||||
( cont_id = 'C2' meas_kg = '1100.00' )
|
||||
( cont_id = 'C3' meas_kg = '1300.00' )
|
||||
( cont_id = 'C4' meas_kg = '450.00' )
|
||||
( cont_id = 'C5' meas_kg = '950.00' )
|
||||
( cont_id = 'C7' meas_kg = '800.00' )
|
||||
( cont_id = 'C8' meas_kg = '310.00' ) ).
|
||||
go_env->insert_test_data( lt_cont ).
|
||||
go_env->insert_test_data( lt_weigh ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD deviation_below.
|
||||
SELECT SINGLE deviation_kg FROM {{p}}i_cont_weight WHERE cont_id = 'C4' INTO @DATA(lv_dev).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '50.00' )
|
||||
act = CONV decfloat34( lv_dev ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD deviation_zero.
|
||||
SELECT SINGLE deviation_kg FROM {{p}}i_cont_weight WHERE cont_id = 'C7' INTO @DATA(lv_dev).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '0.00' )
|
||||
act = CONV decfloat34( lv_dev ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD deviation_above.
|
||||
SELECT SINGLE deviation_kg FROM {{p}}i_cont_weight WHERE cont_id = 'C1' INTO @DATA(lv_dev).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' )
|
||||
act = CONV decfloat34( lv_dev ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD percent_rounded.
|
||||
SELECT SINGLE deviation_pct FROM {{p}}i_cont_weight WHERE cont_id = 'C8' INTO @DATA(lv_pct).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.33' )
|
||||
act = CONV decfloat34( lv_pct ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD status_hold.
|
||||
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C3' INTO @DATA(lv_status).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'HOLD' act = lv_status ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD status_warn.
|
||||
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C2' INTO @DATA(lv_status).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'WARN' act = lv_status ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD status_load.
|
||||
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C1' INTO @DATA(lv_status).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = lv_status ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD status_at_five_pct.
|
||||
SELECT SINGLE status FROM {{p}}i_cont_weight WHERE cont_id = 'C5' INTO @DATA(lv_status).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = lv_status ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unweighed_hidden.
|
||||
SELECT COUNT(*) FROM {{p}}i_cont_weight INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 7 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD customer_shown.
|
||||
SELECT SINGLE customer FROM {{p}}i_cont_weight WHERE cont_id = 'C4' INTO @DATA(lv_cust).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DELTA' act = lv_cust ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
65
tasks_gen/train/G1000/mutation.json
Normal file
65
tasks_gen/train/G1000/mutation.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"task": "G1000",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}I_CONT_WEIGHT",
|
||||
"mutant": "line 5: = -> <> (eq)",
|
||||
"status": "killed",
|
||||
"hidden": "2/10",
|
||||
"failed_tests": [
|
||||
"DEVIATION_ABOVE",
|
||||
"DEVIATION_BELOW",
|
||||
"DEVIATION_ZERO",
|
||||
"PERCENT_ROUNDED",
|
||||
"STATUS_HOLD",
|
||||
"STATUS_LOAD",
|
||||
"STATUS_WARN",
|
||||
"UNWEIGHED_HIDDEN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_CONT_WEIGHT",
|
||||
"mutant": "line 12: - -> + (arith)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"PERCENT_ROUNDED"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_CONT_WEIGHT",
|
||||
"mutant": "line 14: > -> <= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "6/10",
|
||||
"failed_tests": [
|
||||
"STATUS_AT_FIVE_PCT",
|
||||
"STATUS_HOLD",
|
||||
"STATUS_LOAD",
|
||||
"STATUS_WARN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_CONT_WEIGHT",
|
||||
"mutant": "line 15: 100 -> 101 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "9/10",
|
||||
"failed_tests": [
|
||||
"STATUS_AT_FIVE_PCT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_CONT_WEIGHT",
|
||||
"mutant": "line 16: 'LOAD' -> 'ZOAD' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "8/10",
|
||||
"failed_tests": [
|
||||
"STATUS_AT_FIVE_PCT",
|
||||
"STATUS_LOAD"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
18
tasks_gen/train/G1000/reference/i_cont_weight.ddls.asddls
Normal file
18
tasks_gen/train/G1000/reference/i_cont_weight.ddls.asddls
Normal file
@@ -0,0 +1,18 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Container weight check'
|
||||
define view entity {{P}}I_CONT_WEIGHT
|
||||
as select from {{p}}cont as cont
|
||||
inner join {{p}}weigh as weigh on weigh.cont_id = cont.cont_id
|
||||
{
|
||||
key cont.cont_id as cont_id,
|
||||
cont.customer as customer,
|
||||
cont.decl_kg as decl_kg,
|
||||
weigh.meas_kg as meas_kg,
|
||||
cast( abs( weigh.meas_kg - cont.decl_kg ) as abap.dec(15,2) ) as deviation_kg,
|
||||
division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) as deviation_pct,
|
||||
case
|
||||
when weigh.meas_kg > cont.max_kg then 'HOLD'
|
||||
when division( abs( weigh.meas_kg - cont.decl_kg ) * 100, cont.decl_kg, 2 ) > 5 then 'WARN'
|
||||
else 'LOAD'
|
||||
end as status
|
||||
}
|
||||
53
tasks_gen/train/G1000/reference/t20_test.clas.abap
Normal file
53
tasks_gen/train/G1000/reference/t20_test.clas.abap
Normal file
@@ -0,0 +1,53 @@
|
||||
CLASS {{p}}t20_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 hold_for_heavy FOR TESTING.
|
||||
METHODS load_for_light FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_CONT_WEIGHT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_cont TYPE STANDARD TABLE OF {{p}}cont WITH EMPTY KEY.
|
||||
DATA lt_weigh TYPE STANDARD TABLE OF {{p}}weigh WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_cont = VALUE #( ( cont_id = 'A' customer = 'CUST_A' decl_kg = '1000.00' max_kg = '1100.00' )
|
||||
( cont_id = 'B' customer = 'CUST_B' decl_kg = '1000.00' max_kg = '1100.00' ) ).
|
||||
lt_weigh = VALUE #( ( cont_id = 'A' meas_kg = '1150.00' )
|
||||
( cont_id = 'B' meas_kg = '1010.00' ) ).
|
||||
go_env->insert_test_data( lt_cont ).
|
||||
go_env->insert_test_data( lt_weigh ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD hold_for_heavy.
|
||||
SELECT SINGLE deviation_kg, deviation_pct, status FROM {{p}}i_cont_weight
|
||||
WHERE cont_id = 'A' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '150.00' )
|
||||
act = CONV decfloat34( ls_row-deviation_kg ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '15.00' )
|
||||
act = CONV decfloat34( ls_row-deviation_pct ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'HOLD' act = ls_row-status ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD load_for_light.
|
||||
SELECT SINGLE deviation_kg, deviation_pct, status FROM {{p}}i_cont_weight
|
||||
WHERE cont_id = 'B' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' )
|
||||
act = CONV decfloat34( ls_row-deviation_kg ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1.00' )
|
||||
act = CONV decfloat34( ls_row-deviation_pct ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LOAD' act = ls_row-status ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
12
tasks_gen/train/G1000/seed/cont.tabl.asabap
Normal file
12
tasks_gen/train/G1000/seed/cont.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Container'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}cont {
|
||||
key client : abap.clnt not null;
|
||||
key cont_id : abap.char(10) not null;
|
||||
customer : abap.char(10);
|
||||
decl_kg : abap.dec(15,2);
|
||||
max_kg : abap.dec(15,2);
|
||||
}
|
||||
10
tasks_gen/train/G1000/seed/weigh.tabl.asabap
Normal file
10
tasks_gen/train/G1000/seed/weigh.tabl.asabap
Normal file
@@ -0,0 +1,10 @@
|
||||
@EndUserText.label : 'Weighbridge record'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}weigh {
|
||||
key client : abap.clnt not null;
|
||||
key cont_id : abap.char(10) not null;
|
||||
meas_kg : abap.dec(15,2);
|
||||
}
|
||||
41
tasks_gen/train/G1000/spec.md
Normal file
41
tasks_gen/train/G1000/spec.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# 1. Goal
|
||||
Show the weight check of each container at a container terminal. A report and an
|
||||
OData service will read the check, so the calculation must be in the database,
|
||||
in a CDS view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}CONT (container master), package $TMP. Key: CONT_ID (CHAR 10).
|
||||
Fields: CUSTOMER (CHAR 10), DECL_KG (DEC 15,2, declared weight in kilograms),
|
||||
MAX_KG (DEC 15,2, maximum permitted weight in kilograms).
|
||||
- Table {{P}}WEIGH (weighbridge record), package $TMP. Key: CONT_ID (CHAR 10).
|
||||
Field: MEAS_KG (DEC 15,2, measured weight in kilograms).
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_CONT_WEIGHT in package $TMP.
|
||||
- Elements, with these names: CONT_ID (key), CUSTOMER, DECL_KG, MEAS_KG,
|
||||
DEVIATION_KG, DEVIATION_PCT, STATUS.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. Show one row for each container that has a weighbridge record. Do not show a
|
||||
container without a weighbridge record.
|
||||
2. DEVIATION_KG is the difference between MEAS_KG and DECL_KG, without a sign.
|
||||
It is always positive or zero and it has 2 decimals.
|
||||
3. DEVIATION_PCT is DEVIATION_KG as a percentage of DECL_KG. It has 2 decimals.
|
||||
4. STATUS is 'HOLD' if MEAS_KG is greater than MAX_KG.
|
||||
5. STATUS is 'WARN' if rule 4 is not true and DEVIATION_PCT is greater than 5.
|
||||
6. STATUS is 'LOAD' in all other cases.
|
||||
7. DECL_KG is always greater than zero.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Use Clean ABAP. Keep every method below 40 statements.
|
||||
- Out of scope: do not change {{P}}CONT and {{P}}WEIGH.
|
||||
|
||||
# 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.
|
||||
68
tasks_gen/train/G1000/task.json
Normal file
68
tasks_gen/train/G1000/task.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"id": "G1000",
|
||||
"category": "B",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}CONT",
|
||||
"file": "seed/cont.tabl.asabap",
|
||||
"description": "Container master"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}WEIGH",
|
||||
"file": "seed/weigh.tabl.asabap",
|
||||
"description": "Weighbridge record"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_CONT_WEIGHT",
|
||||
"fields": [
|
||||
"CONT_ID",
|
||||
"CUSTOMER",
|
||||
"DECL_KG",
|
||||
"MEAS_KG",
|
||||
"DEVIATION_KG",
|
||||
"DEVIATION_PCT",
|
||||
"STATUS"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}CONT",
|
||||
"{{P}}WEIGH"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_HIDDEN",
|
||||
"file": "hidden/t20_hidden.clas.abap",
|
||||
"description": "T20 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_CONT_WEIGHT",
|
||||
"file": "reference/i_cont_weight.ddls.asddls",
|
||||
"description": "Container weight check"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_TEST",
|
||||
"file": "reference/t20_test.clas.abap",
|
||||
"description": "T20 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user