Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
15
tasks_gen/eval/G0146/faulty/m0_i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/faulty/m0_i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on so.customer_id <> _Customer.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
_Customer.name as customer_name,
|
||||
_Customer.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount >= 1000 then 'H'
|
||||
when so.net_amount >= 100 then 'M'
|
||||
else 'L' end as amount_class
|
||||
}
|
||||
15
tasks_gen/eval/G0146/faulty/m1_i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/faulty/m1_i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on so.customer_id = _Customer.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
_Customer.name as customer_name,
|
||||
_Customer.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount < 1000 then 'H'
|
||||
when so.net_amount >= 100 then 'M'
|
||||
else 'L' end as amount_class
|
||||
}
|
||||
15
tasks_gen/eval/G0146/faulty/m2_i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/faulty/m2_i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on so.customer_id = _Customer.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
_Customer.name as customer_name,
|
||||
_Customer.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount >= 1001 then 'H'
|
||||
when so.net_amount >= 100 then 'M'
|
||||
else 'L' end as amount_class
|
||||
}
|
||||
15
tasks_gen/eval/G0146/faulty/m3_i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/faulty/m3_i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on so.customer_id = _Customer.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
_Customer.name as customer_name,
|
||||
_Customer.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount >= 1000 then 'H'
|
||||
when so.net_amount < 100 then 'M'
|
||||
else 'L' end as amount_class
|
||||
}
|
||||
15
tasks_gen/eval/G0146/faulty/m4_i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/faulty/m4_i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on so.customer_id = _Customer.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
_Customer.name as customer_name,
|
||||
_Customer.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount >= 1000 then 'H'
|
||||
when so.net_amount >= 100 then 'M'
|
||||
else 'Z' end as amount_class
|
||||
}
|
||||
44
tasks_gen/eval/G0146/generation.json
Normal file
44
tasks_gen/eval/G0146/generation.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "G0146",
|
||||
"pool": "eval",
|
||||
"object_type": "DDLS",
|
||||
"category": "E",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 1,
|
||||
"killed": 1,
|
||||
"ok": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 1,
|
||||
"killed": 1,
|
||||
"ok": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
157
tasks_gen/eval/G0146/hidden/t41_hidden.clas.abap
Normal file
157
tasks_gen/eval/G0146/hidden/t41_hidden.clas.abap
Normal file
@@ -0,0 +1,157 @@
|
||||
CLASS {{p}}t41_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 order_with_customer FOR TESTING.
|
||||
METHODS order_no_customer FOR TESTING.
|
||||
METHODS all_orders FOR TESTING.
|
||||
METHODS country_shown FOR TESTING.
|
||||
METHODS amount_shown FOR TESTING.
|
||||
METHODS key_stable FOR TESTING.
|
||||
METHODS empty_name_kept FOR TESTING.
|
||||
METHODS empty_country_kept FOR TESTING.
|
||||
METHODS shared_customer FOR TESTING.
|
||||
METHODS class_high FOR TESTING.
|
||||
METHODS class_medium FOR TESTING.
|
||||
METHODS class_low FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t41_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SO_CUST' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_so TYPE STANDARD TABLE OF {{p}}so WITH EMPTY KEY.
|
||||
DATA lt_cust TYPE STANDARD TABLE OF {{p}}cust WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_cust = VALUE #(
|
||||
( customer_id = 'C1' name = 'Alpha Corp' country = 'DE' )
|
||||
( customer_id = 'C2' name = 'Beta Inc' country = 'US' )
|
||||
( customer_id = 'C3' name = '' country = 'FR' )
|
||||
( customer_id = 'C4' name = 'Delta Ltd' country = '' ) ).
|
||||
lt_so = VALUE #(
|
||||
( order_id = 'O1' customer_id = 'C1' order_date = '20240101' net_amount = '1000.00' )
|
||||
( order_id = 'O2' customer_id = 'C2' order_date = '20240102' net_amount = '200.00' )
|
||||
( order_id = 'O3' customer_id = '' order_date = '20240103' net_amount = '300.00' )
|
||||
( order_id = 'O4' customer_id = 'C1' order_date = '20240104' net_amount = '123.45' )
|
||||
( order_id = 'O5' customer_id = 'C3' order_date = '20240105' net_amount = '500.00' )
|
||||
( order_id = 'O6' customer_id = 'C4' order_date = '20240106' net_amount = '600.00' )
|
||||
( order_id = 'O7' customer_id = 'C1' order_date = '20240107' net_amount = '100.00' )
|
||||
( order_id = 'O8' customer_id = 'C2' order_date = '20240108' net_amount = '99.99' )
|
||||
( order_id = 'O9' customer_id = 'C1' order_date = '20240109' net_amount = '999.99' ) ).
|
||||
go_env->insert_test_data( lt_cust ).
|
||||
go_env->insert_test_data( lt_so ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_with_customer.
|
||||
SELECT SINGLE customer_name, country, net_amount, amount_class
|
||||
FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O1'
|
||||
INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Alpha Corp' act = ls_row-customer_name ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DE' act = ls_row-country ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '1000.00' )
|
||||
act = CONV decfloat34( ls_row-net_amount ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'H' act = ls_row-amount_class ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_no_customer.
|
||||
SELECT COUNT(*) FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O3' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count ).
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O3' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_initial( ls_row-customer_name ).
|
||||
cl_abap_unit_assert=>assert_initial( ls_row-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD all_orders.
|
||||
SELECT COUNT(*) FROM {{p}}i_so_cust INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 9 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD country_shown.
|
||||
SELECT SINGLE country FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O2' INTO @DATA(lv_country).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'US' act = lv_country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD amount_shown.
|
||||
SELECT SINGLE net_amount FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O2' INTO @DATA(lv_amount).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '200.00' )
|
||||
act = CONV decfloat34( lv_amount ) ).
|
||||
SELECT SINGLE net_amount FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O4' INTO @DATA(lv_dec).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '123.45' )
|
||||
act = CONV decfloat34( lv_dec ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD key_stable.
|
||||
SELECT SINGLE order_id FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O1' INTO @DATA(lv_id).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'O1' act = lv_id ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD empty_name_kept.
|
||||
SELECT COUNT(*) FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O5' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count ).
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O5' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_initial( ls_row-customer_name ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'FR' act = ls_row-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD empty_country_kept.
|
||||
SELECT COUNT(*) FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O6' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count ).
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O6' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Delta Ltd' act = ls_row-customer_name ).
|
||||
cl_abap_unit_assert=>assert_initial( ls_row-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD shared_customer.
|
||||
SELECT COUNT(*) FROM {{p}}i_so_cust
|
||||
WHERE customer_name = 'Alpha Corp' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_count ).
|
||||
SELECT SINGLE country FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O4' INTO @DATA(lv_country).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DE' act = lv_country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_high.
|
||||
SELECT SINGLE amount_class FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O1' INTO @DATA(lv_class).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'H' act = lv_class ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_medium.
|
||||
SELECT SINGLE amount_class FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O7' INTO @DATA(lv_lo).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'M' act = lv_lo ).
|
||||
SELECT SINGLE amount_class FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O9' INTO @DATA(lv_hi).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'M' act = lv_hi ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_low.
|
||||
SELECT SINGLE amount_class FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O8' INTO @DATA(lv_class).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'L' act = lv_class ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
64
tasks_gen/eval/G0146/mutation.json
Normal file
64
tasks_gen/eval/G0146/mutation.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"task": "G0146",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}I_SO_CUST",
|
||||
"mutant": "line 6: = -> <> (eq)",
|
||||
"status": "killed",
|
||||
"hidden": "6/12",
|
||||
"failed_tests": [
|
||||
"COUNTRY_SHOWN",
|
||||
"EMPTY_COUNTRY_KEPT",
|
||||
"EMPTY_NAME_KEPT",
|
||||
"ORDER_NO_CUSTOMER",
|
||||
"ORDER_WITH_CUSTOMER",
|
||||
"SHARED_CUSTOMER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SO_CUST",
|
||||
"mutant": "line 12: >= -> < (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "8/12",
|
||||
"failed_tests": [
|
||||
"CLASS_HIGH",
|
||||
"CLASS_LOW",
|
||||
"CLASS_MEDIUM",
|
||||
"ORDER_WITH_CUSTOMER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SO_CUST",
|
||||
"mutant": "line 12: 1000 -> 1001 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "10/12",
|
||||
"failed_tests": [
|
||||
"CLASS_HIGH",
|
||||
"ORDER_WITH_CUSTOMER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SO_CUST",
|
||||
"mutant": "line 13: >= -> < (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "10/12",
|
||||
"failed_tests": [
|
||||
"CLASS_LOW",
|
||||
"CLASS_MEDIUM"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SO_CUST",
|
||||
"mutant": "line 14: 'L' -> 'Z' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "11/12",
|
||||
"failed_tests": [
|
||||
"CLASS_LOW"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
15
tasks_gen/eval/G0146/reference/i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/reference/i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on so.customer_id = _Customer.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
_Customer.name as customer_name,
|
||||
_Customer.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount >= 1000 then 'H'
|
||||
when so.net_amount >= 100 then 'M'
|
||||
else 'L' end as amount_class
|
||||
}
|
||||
56
tasks_gen/eval/G0146/reference/t41_test.clas.abap
Normal file
56
tasks_gen/eval/G0146/reference/t41_test.clas.abap
Normal file
@@ -0,0 +1,56 @@
|
||||
CLASS {{p}}t41_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 customer_is_joined FOR TESTING.
|
||||
METHODS order_without_cust FOR TESTING.
|
||||
METHODS class_boundary FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t41_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SO_CUST' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_so TYPE STANDARD TABLE OF {{p}}so WITH EMPTY KEY.
|
||||
DATA lt_cust TYPE STANDARD TABLE OF {{p}}cust WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_cust = VALUE #(
|
||||
( customer_id = 'C1' name = 'Alpha Corp' country = 'DE' ) ).
|
||||
lt_so = VALUE #(
|
||||
( order_id = 'O1' customer_id = 'C1'
|
||||
order_date = '20240101' net_amount = '100.00' )
|
||||
( order_id = 'O9' customer_id = 'C9'
|
||||
order_date = '20240109' net_amount = '900.00' ) ).
|
||||
go_env->insert_test_data( lt_cust ).
|
||||
go_env->insert_test_data( lt_so ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD customer_is_joined.
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O1' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Alpha Corp' act = ls_row-customer_name ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DE' act = ls_row-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_without_cust.
|
||||
SELECT COUNT(*) FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O9' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_boundary.
|
||||
SELECT SINGLE amount_class FROM {{p}}i_so_cust
|
||||
WHERE order_id = 'O1' INTO @DATA(lv_class).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'M' act = lv_class ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
11
tasks_gen/eval/G0146/seed/cust.tabl.asabap
Normal file
11
tasks_gen/eval/G0146/seed/cust.tabl.asabap
Normal file
@@ -0,0 +1,11 @@
|
||||
@EndUserText.label : 'Customer'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}cust {
|
||||
key client : abap.clnt not null;
|
||||
key customer_id : abap.char(10) not null;
|
||||
name : abap.char(40);
|
||||
country : abap.char(3);
|
||||
}
|
||||
15
tasks_gen/eval/G0146/seed/i_so_cust.ddls.asddls
Normal file
15
tasks_gen/eval/G0146/seed/i_so_cust.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales order with customer'
|
||||
define view entity {{P}}I_SO_CUST
|
||||
as select from {{p}}so as so
|
||||
left outer join {{p}}cust as cust1 on cust1.customer_id = so.customer_id
|
||||
left outer join {{p}}cust as cust2 on cust2.customer_id = so.customer_id
|
||||
{
|
||||
key so.order_id as order_id,
|
||||
cust1.name as customer_name,
|
||||
cust2.country as country,
|
||||
so.net_amount as net_amount,
|
||||
case when so.net_amount >= 1000 then 'H'
|
||||
when so.net_amount >= 100 then 'M'
|
||||
else 'L' end as amount_class
|
||||
}
|
||||
22
tasks_gen/eval/G0146/seed/seed_so_cust.clas.abap
Normal file
22
tasks_gen/eval/G0146/seed/seed_so_cust.clas.abap
Normal file
@@ -0,0 +1,22 @@
|
||||
CLASS {{p}}seed_so_cust DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS {{p}}seed_so_cust IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DATA lt_cust TYPE STANDARD TABLE OF {{p}}cust WITH EMPTY KEY.
|
||||
DATA lt_so TYPE STANDARD TABLE OF {{p}}so WITH EMPTY KEY.
|
||||
lt_cust = VALUE #(
|
||||
( client = sy-mandt customer_id = 'C1' name = 'Alpha Corp' country = 'DE' )
|
||||
( client = sy-mandt customer_id = 'C2' name = 'Beta Inc' country = 'US' ) ).
|
||||
lt_so = VALUE #(
|
||||
( client = sy-mandt order_id = 'O1' customer_id = 'C1'
|
||||
order_date = '20240101' net_amount = '100.00' )
|
||||
( client = sy-mandt order_id = 'O2' customer_id = 'C2'
|
||||
order_date = '20240102' net_amount = '200.00' ) ).
|
||||
INSERT {{p}}cust FROM TABLE @lt_cust.
|
||||
INSERT {{p}}so FROM TABLE @lt_so.
|
||||
out->write( 'Seed data inserted.' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
12
tasks_gen/eval/G0146/seed/so.tabl.asabap
Normal file
12
tasks_gen/eval/G0146/seed/so.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Sales order'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}so {
|
||||
key client : abap.clnt not null;
|
||||
key order_id : abap.char(10) not null;
|
||||
customer_id : abap.char(10);
|
||||
order_date : abap.dats;
|
||||
net_amount : abap.dec(15,2);
|
||||
}
|
||||
34
tasks_gen/eval/G0146/spec.md
Normal file
34
tasks_gen/eval/G0146/spec.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# 1. Goal
|
||||
The CDS view entity {{P}}I_SO_CUST in package $TMP contains duplicate join logic.
|
||||
Refactor the view in place. Replace the duplicate join logic with one association.
|
||||
The behavior of the view must stay the same.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- {{P}}I_SO_CUST is a legacy CDS view entity in package $TMP. Read its source code.
|
||||
- The base tables are {{P}}SO (sales order) and {{P}}CUST (customer), package $TMP.
|
||||
- Other programs and services read the view. The public interface must not change.
|
||||
|
||||
# 4. Contract
|
||||
- The view entity {{P}}I_SO_CUST keeps these elements: ORDER_ID (key), CUSTOMER_NAME,
|
||||
COUNTRY, NET_AMOUNT, AMOUNT_CLASS.
|
||||
- Do not change the element names or the element types.
|
||||
- The view stays in package $TMP.
|
||||
|
||||
# 5. Business rules
|
||||
The behavior of the view must stay the same. Read the legacy source code to learn the
|
||||
behavior. Every row that the view returns today must be returned after the refactoring,
|
||||
with the same values. This includes orders that have no matching customer.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Out of scope: do not change {{P}}SO and {{P}}CUST.
|
||||
- Coding standards: Clean ABAP, no ATC priority 1 or 2 findings.
|
||||
|
||||
# 7. Acceptance
|
||||
- The view is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- The duplicate join logic is replaced by one association.
|
||||
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.
|
||||
79
tasks_gen/eval/G0146/task.json
Normal file
79
tasks_gen/eval/G0146/task.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"id": "G0146",
|
||||
"category": "E",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}SO",
|
||||
"file": "seed/so.tabl.asabap",
|
||||
"description": "Sales order"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}CUST",
|
||||
"file": "seed/cust.tabl.asabap",
|
||||
"description": "Customer"
|
||||
},
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SO_CUST",
|
||||
"file": "seed/i_so_cust.ddls.asddls",
|
||||
"description": "Legacy view with duplicate join logic"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_SO_CUST",
|
||||
"file": "seed/seed_so_cust.clas.abap",
|
||||
"description": "Seed data for sales orders and customers",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SO_CUST",
|
||||
"fields": [
|
||||
"ORDER_ID",
|
||||
"CUSTOMER_NAME",
|
||||
"COUNTRY",
|
||||
"NET_AMOUNT",
|
||||
"AMOUNT_CLASS"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}SO",
|
||||
"{{P}}CUST"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T41_HIDDEN",
|
||||
"file": "hidden/t41_hidden.clas.abap",
|
||||
"description": "Hidden tests for the refactored view"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SO_CUST",
|
||||
"file": "reference/i_so_cust.ddls.asddls",
|
||||
"description": "Refactored view with one association"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T41_TEST",
|
||||
"file": "reference/t41_test.clas.abap",
|
||||
"description": "Own tests for the view"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user