Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged
- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
24
tasks_gen/eval/G0018/generation.json
Normal file
24
tasks_gen/eval/G0018/generation.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"id": "G0018",
|
||||
"pool": "eval",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
79
tasks_gen/eval/G0018/hidden/t20_hidden.clas.abap
Normal file
79
tasks_gen/eval/G0018/hidden/t20_hidden.clas.abap
Normal file
@@ -0,0 +1,79 @@
|
||||
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 association_path FOR TESTING.
|
||||
METHODS closed_order_hidden FOR TESTING.
|
||||
METHODS customer_data_shown FOR TESTING.
|
||||
METHODS open_orders_only FOR TESTING.
|
||||
METHODS order_key_data FOR TESTING.
|
||||
METHODS order_without_customer FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ORDER' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_cust TYPE STANDARD TABLE OF {{p}}cust WITH EMPTY KEY.
|
||||
DATA lt_ord TYPE STANDARD TABLE OF {{p}}ord WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_cust = VALUE #(
|
||||
( cust_id = 'C001' cust_name = 'Alpha GmbH' country = 'DE' )
|
||||
( cust_id = 'C002' cust_name = 'Beta Ltd' country = 'GB' ) ).
|
||||
lt_ord = VALUE #(
|
||||
( order_id = 'O100' cust_id = 'C001' order_date = '20250110' status = 'O' )
|
||||
( order_id = 'O101' cust_id = 'C002' order_date = '20250111' status = 'O' )
|
||||
( order_id = 'O102' cust_id = 'C999' order_date = '20250112' status = 'O' )
|
||||
( order_id = 'O103' cust_id = 'C001' order_date = '20250113' status = 'C' ) ).
|
||||
go_env->insert_test_data( lt_cust ).
|
||||
go_env->insert_test_data( lt_ord ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD open_orders_only.
|
||||
SELECT COUNT(*) FROM {{p}}i_order INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD closed_order_hidden.
|
||||
SELECT SINGLE order_id FROM {{p}}i_order
|
||||
WHERE order_id = 'O103' INTO @DATA(lv_id).
|
||||
cl_abap_unit_assert=>assert_initial( act = lv_id ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_key_data.
|
||||
SELECT SINGLE cust_id, order_date FROM {{p}}i_order
|
||||
WHERE order_id = 'O100' INTO @DATA(ls_ord).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'C001' act = ls_ord-cust_id ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV d( '20250110' ) act = ls_ord-order_date ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD customer_data_shown.
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_order
|
||||
WHERE order_id = 'O101' INTO @DATA(ls_ord).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Beta Ltd' act = ls_ord-customer_name ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'GB' act = ls_ord-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_without_customer.
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_order
|
||||
WHERE order_id = 'O102' INTO @DATA(ls_ord).
|
||||
cl_abap_unit_assert=>assert_initial( act = ls_ord-customer_name ).
|
||||
cl_abap_unit_assert=>assert_initial( act = ls_ord-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD association_path.
|
||||
SELECT SINGLE \_customer-cust_name FROM {{p}}i_order
|
||||
WHERE order_id = 'O100' INTO @DATA(lv_name).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Alpha GmbH' act = lv_name ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
9
tasks_gen/eval/G0018/reference/i_customer.ddls.asddls
Normal file
9
tasks_gen/eval/G0018/reference/i_customer.ddls.asddls
Normal file
@@ -0,0 +1,9 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Customer master'
|
||||
define view entity {{P}}I_CUSTOMER
|
||||
as select from {{p}}cust
|
||||
{
|
||||
key cust_id,
|
||||
cust_name,
|
||||
country
|
||||
}
|
||||
15
tasks_gen/eval/G0018/reference/i_order.ddls.asddls
Normal file
15
tasks_gen/eval/G0018/reference/i_order.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Open orders with customer data'
|
||||
define view entity {{P}}I_ORDER
|
||||
as select from {{p}}ord as ord
|
||||
association [0..1] to {{p}}cust as _Customer
|
||||
on $projection.cust_id = _Customer.cust_id
|
||||
{
|
||||
key ord.order_id,
|
||||
ord.cust_id,
|
||||
ord.order_date,
|
||||
_Customer.cust_name as customer_name,
|
||||
_Customer.country as country,
|
||||
_Customer
|
||||
}
|
||||
where ord.status = 'O'
|
||||
48
tasks_gen/eval/G0018/reference/t20_test.clas.abap
Normal file
48
tasks_gen/eval/G0018/reference/t20_test.clas.abap
Normal file
@@ -0,0 +1,48 @@
|
||||
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 order_with_customer FOR TESTING.
|
||||
METHODS order_without_customer FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ORDER' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_cust TYPE STANDARD TABLE OF {{p}}cust WITH EMPTY KEY.
|
||||
DATA lt_ord TYPE STANDARD TABLE OF {{p}}ord WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_cust = VALUE #(
|
||||
( cust_id = 'C001' cust_name = 'Alpha' country = 'DE' ) ).
|
||||
lt_ord = VALUE #(
|
||||
( order_id = 'O1' cust_id = 'C001' order_date = '20250101' status = 'O' )
|
||||
( order_id = 'O2' cust_id = 'C999' order_date = '20250102' status = 'O' )
|
||||
( order_id = 'O3' cust_id = 'C001' order_date = '20250103' status = 'C' ) ).
|
||||
go_env->insert_test_data( lt_cust ).
|
||||
go_env->insert_test_data( lt_ord ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_with_customer.
|
||||
SELECT SINGLE customer_name, country FROM {{p}}i_order
|
||||
WHERE order_id = 'O1' INTO @DATA(ls_ord).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'Alpha' act = ls_ord-customer_name ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DE' act = ls_ord-country ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD order_without_customer.
|
||||
SELECT SINGLE customer_name FROM {{p}}i_order
|
||||
WHERE order_id = 'O2' INTO @DATA(lv_name).
|
||||
cl_abap_unit_assert=>assert_initial( act = lv_name ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
11
tasks_gen/eval/G0018/seed/cust.tabl.asabap
Normal file
11
tasks_gen/eval/G0018/seed/cust.tabl.asabap
Normal file
@@ -0,0 +1,11 @@
|
||||
@EndUserText.label : 'Customer master'
|
||||
@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 cust_id : abap.char(10) not null;
|
||||
cust_name : abap.char(40);
|
||||
country : abap.char(3);
|
||||
}
|
||||
12
tasks_gen/eval/G0018/seed/ord.tabl.asabap
Normal file
12
tasks_gen/eval/G0018/seed/ord.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Order header'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}ord {
|
||||
key client : abap.clnt not null;
|
||||
key order_id : abap.char(10) not null;
|
||||
cust_id : abap.char(10);
|
||||
order_date : abap.dats;
|
||||
status : abap.char(1);
|
||||
}
|
||||
22
tasks_gen/eval/G0018/seed/seed_data.clas.abap
Normal file
22
tasks_gen/eval/G0018/seed/seed_data.clas.abap
Normal file
@@ -0,0 +1,22 @@
|
||||
CLASS {{p}}seed_data DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_data IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DELETE FROM {{p}}ord.
|
||||
DELETE FROM {{p}}cust.
|
||||
INSERT {{p}}cust FROM TABLE @( VALUE #(
|
||||
( client = sy-mandt cust_id = 'C001' cust_name = 'Alpha GmbH' country = 'DE' )
|
||||
( client = sy-mandt cust_id = 'C002' cust_name = 'Beta Ltd' country = 'GB' )
|
||||
( client = sy-mandt cust_id = 'C003' cust_name = 'Gamma SA' country = 'FR' ) ) ).
|
||||
INSERT {{p}}ord FROM TABLE @( VALUE #(
|
||||
( client = sy-mandt order_id = 'O100' cust_id = 'C001' order_date = '20250110' status = 'O' )
|
||||
( client = sy-mandt order_id = 'O101' cust_id = 'C002' order_date = '20250111' status = 'O' )
|
||||
( client = sy-mandt order_id = 'O102' cust_id = 'C999' order_date = '20250112' status = 'O' )
|
||||
( client = sy-mandt order_id = 'O103' cust_id = 'C003' order_date = '20250113' status = 'C' ) ) ).
|
||||
out->write( 'Seed data written' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
46
tasks_gen/eval/G0018/spec.md
Normal file
46
tasks_gen/eval/G0018/spec.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# 1. Goal
|
||||
Show every open order together with the name and country of its customer. A
|
||||
list report and an OData service read this data, so the data must be prepared
|
||||
in the database, in a CDS view entity.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}CUST (customer master), package $TMP.
|
||||
Key: CUST_ID (CHAR 10). Further fields: CUST_NAME (CHAR 40), COUNTRY (CHAR 3).
|
||||
- Table {{P}}ORD (order header), package $TMP.
|
||||
Key: ORDER_ID (CHAR 10). Further fields: CUST_ID (CHAR 10), ORDER_DATE (DATS),
|
||||
STATUS (CHAR 1).
|
||||
STATUS is 'O' for an open order and 'C' for a closed order.
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_ORDER in package $TMP.
|
||||
- Elements, with these names: ORDER_ID (key), CUST_ID, ORDER_DATE,
|
||||
CUSTOMER_NAME, COUNTRY.
|
||||
- Define an association named _Customer in {{P}}I_ORDER. The association has
|
||||
cardinality [0..1] and points to the customer master table {{P}}CUST. The
|
||||
association condition compares the CUST_ID of the order with the CUST_ID of
|
||||
the customer.
|
||||
- Expose the association _Customer in the element list of {{P}}I_ORDER and read
|
||||
CUSTOMER_NAME and COUNTRY with path expressions through this association.
|
||||
- The view entity has no authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. {{P}}I_ORDER shows one row for each order with STATUS 'O'. An order with
|
||||
STATUS 'C' is not shown.
|
||||
2. CUSTOMER_NAME is the CUST_NAME and COUNTRY is the COUNTRY of the customer
|
||||
whose CUST_ID is the CUST_ID of the order.
|
||||
3. If an order has a CUST_ID for which no customer exists, the order is still
|
||||
shown. CUSTOMER_NAME and COUNTRY are then empty.
|
||||
4. ORDER_ID, CUST_ID and ORDER_DATE are the values of the order.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP.
|
||||
- Out of scope: do not change {{P}}CUST and {{P}}ORD.
|
||||
|
||||
# 7. Acceptance
|
||||
- The view entity 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/eval/G0018/task.json
Normal file
73
tasks_gen/eval/G0018/task.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"id": "G0018",
|
||||
"category": "B",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v758",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 40,
|
||||
"max_activations": 10
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}CUST",
|
||||
"file": "seed/cust.tabl.asabap",
|
||||
"description": "Customer master"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}ORD",
|
||||
"file": "seed/ord.tabl.asabap",
|
||||
"description": "Order header"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_DATA",
|
||||
"file": "seed/seed_data.clas.abap",
|
||||
"description": "Seed data for {{P}}CUST and {{P}}ORD",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_ORDER",
|
||||
"fields": [
|
||||
"ORDER_ID",
|
||||
"CUST_ID",
|
||||
"ORDER_DATE",
|
||||
"CUSTOMER_NAME",
|
||||
"COUNTRY"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}CUST",
|
||||
"{{P}}ORD"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_HIDDEN",
|
||||
"file": "hidden/t20_hidden.clas.abap",
|
||||
"description": "T20 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_ORDER",
|
||||
"file": "reference/i_order.ddls.asddls",
|
||||
"description": "Open orders with customer data"
|
||||
},
|
||||
{
|
||||
"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