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:
29
tasks_gen/eval/G0021/generation.json
Normal file
29
tasks_gen/eval/G0021/generation.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"id": "G0021",
|
||||
"pool": "eval",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
93
tasks_gen/eval/G0021/hidden/t16_hidden.clas.abap
Normal file
93
tasks_gen/eval/G0021/hidden/t16_hidden.clas.abap
Normal file
@@ -0,0 +1,93 @@
|
||||
CLASS {{p}}t16_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 road_rows FOR TESTING.
|
||||
METHODS rail_rows FOR TESTING.
|
||||
METHODS row_count FOR TESTING.
|
||||
METHODS road_customer FOR TESTING.
|
||||
METHODS rail_customer FOR TESTING.
|
||||
METHODS road_weight FOR TESTING.
|
||||
METHODS rail_cost FOR TESTING.
|
||||
METHODS light_shipments_hidden FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_hidden IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SHIPMENT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_road TYPE STANDARD TABLE OF {{p}}road WITH EMPTY KEY.
|
||||
DATA lt_rail TYPE STANDARD TABLE OF {{p}}rail WITH EMPTY KEY.
|
||||
|
||||
go_env->clear_doubles( ).
|
||||
|
||||
lt_road = VALUE #(
|
||||
( ship_id = 'R1' cust = 'ALPHA' kg = '10.500' cost = '100.00' )
|
||||
( ship_id = 'R2' cust = 'BETA' kg = '2.000' cost = '50.00' )
|
||||
( ship_id = 'R3' cust = 'GAMMA' kg = '0.000' cost = '10.00' ) ).
|
||||
lt_rail = VALUE #(
|
||||
( ship_id = 'L1' customer = 'DELTA' weight = '20.000' fee = '300.00' )
|
||||
( ship_id = 'L2' customer = 'ALPHA' weight = '5.000' fee = '75.00' )
|
||||
( ship_id = 'L3' customer = 'EPSILON' weight = '-1.000' fee = '5.00' ) ).
|
||||
|
||||
go_env->insert_test_data( lt_road ).
|
||||
go_env->insert_test_data( lt_rail ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD road_rows.
|
||||
SELECT SINGLE ship_mode FROM {{p}}i_shipment WHERE ship_id = 'R1' INTO @DATA(lv_ship_mode).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ROAD' act = lv_ship_mode ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rail_rows.
|
||||
SELECT SINGLE ship_mode FROM {{p}}i_shipment WHERE ship_id = 'L1' INTO @DATA(lv_ship_mode).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'RAIL' act = lv_ship_mode ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD row_count.
|
||||
SELECT COUNT(*) FROM {{p}}i_shipment INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD road_customer.
|
||||
SELECT SINGLE customer FROM {{p}}i_shipment WHERE ship_id = 'R2' INTO @DATA(lv_customer).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BETA' act = lv_customer ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rail_customer.
|
||||
SELECT SINGLE customer FROM {{p}}i_shipment WHERE ship_id = 'L2' INTO @DATA(lv_customer).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ALPHA' act = lv_customer ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD road_weight.
|
||||
SELECT SINGLE weight FROM {{p}}i_shipment WHERE ship_id = 'R1' INTO @DATA(lv_weight).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.5' )
|
||||
act = CONV decfloat34( lv_weight ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rail_cost.
|
||||
SELECT SINGLE cost FROM {{p}}i_shipment WHERE ship_id = 'L1' INTO @DATA(lv_cost).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '300' )
|
||||
act = CONV decfloat34( lv_cost ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD light_shipments_hidden.
|
||||
DATA lv_count TYPE i.
|
||||
SELECT COUNT(*) FROM {{p}}i_shipment WHERE ship_id = 'R3' INTO @lv_count.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
|
||||
SELECT COUNT(*) FROM {{p}}i_shipment WHERE ship_id = 'L3' INTO @lv_count.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
23
tasks_gen/eval/G0021/reference/i_shipment.ddls.asddls
Normal file
23
tasks_gen/eval/G0021/reference/i_shipment.ddls.asddls
Normal file
@@ -0,0 +1,23 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@Metadata.ignorePropagatedAnnotations: true
|
||||
@EndUserText.label: 'Shipment overview'
|
||||
define view entity {{P}}I_SHIPMENT
|
||||
as select from {{p}}road as road
|
||||
{
|
||||
key road.ship_id as ship_id,
|
||||
road.cust as customer,
|
||||
'ROAD' as ship_mode,
|
||||
road.kg as weight,
|
||||
road.cost as cost
|
||||
}
|
||||
where road.kg > 0
|
||||
union all
|
||||
select from {{p}}rail as rail
|
||||
{
|
||||
key rail.ship_id as ship_id,
|
||||
rail.customer as customer,
|
||||
'RAIL' as ship_mode,
|
||||
rail.weight as weight,
|
||||
rail.fee as cost
|
||||
}
|
||||
where rail.weight > 0
|
||||
46
tasks_gen/eval/G0021/reference/t16_test.clas.abap
Normal file
46
tasks_gen/eval/G0021/reference/t16_test.clas.abap
Normal file
@@ -0,0 +1,46 @@
|
||||
CLASS {{p}}t16_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 both_sources FOR TESTING.
|
||||
METHODS mode_literal FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_test IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SHIPMENT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_road TYPE STANDARD TABLE OF {{p}}road WITH EMPTY KEY.
|
||||
DATA lt_rail TYPE STANDARD TABLE OF {{p}}rail WITH EMPTY KEY.
|
||||
|
||||
go_env->clear_doubles( ).
|
||||
|
||||
lt_road = VALUE #( ( ship_id = 'R1' cust = 'C1' kg = '1.000' cost = '10.00' ) ).
|
||||
lt_rail = VALUE #( ( ship_id = 'L1' customer = 'C2' weight = '2.000' fee = '20.00' ) ).
|
||||
|
||||
go_env->insert_test_data( lt_road ).
|
||||
go_env->insert_test_data( lt_rail ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD both_sources.
|
||||
SELECT COUNT(*) FROM {{p}}i_shipment INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD mode_literal.
|
||||
SELECT SINGLE ship_mode FROM {{p}}i_shipment WHERE ship_id = 'L1' INTO @DATA(lv_ship_mode).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'RAIL' act = lv_ship_mode ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
12
tasks_gen/eval/G0021/seed/rail.tabl.asabap
Normal file
12
tasks_gen/eval/G0021/seed/rail.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Rail shipment'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}rail {
|
||||
key client : abap.clnt not null;
|
||||
key ship_id : abap.char(10) not null;
|
||||
customer : abap.char(10);
|
||||
weight : abap.dec(15,3);
|
||||
fee : abap.dec(15,2);
|
||||
}
|
||||
12
tasks_gen/eval/G0021/seed/road.tabl.asabap
Normal file
12
tasks_gen/eval/G0021/seed/road.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Road shipment'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}road {
|
||||
key client : abap.clnt not null;
|
||||
key ship_id : abap.char(10) not null;
|
||||
cust : abap.char(10);
|
||||
kg : abap.dec(15,3);
|
||||
cost : abap.dec(15,2);
|
||||
}
|
||||
31
tasks_gen/eval/G0021/seed/seed_ship.clas.abap
Normal file
31
tasks_gen/eval/G0021/seed/seed_ship.clas.abap
Normal file
@@ -0,0 +1,31 @@
|
||||
CLASS {{p}}seed_ship DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_ship IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DATA lt_road TYPE STANDARD TABLE OF {{p}}road WITH EMPTY KEY.
|
||||
DATA lt_rail TYPE STANDARD TABLE OF {{p}}rail WITH EMPTY KEY.
|
||||
|
||||
DELETE FROM {{p}}road.
|
||||
DELETE FROM {{p}}rail.
|
||||
|
||||
lt_road = VALUE #(
|
||||
( client = sy-mandt ship_id = 'R1' cust = 'ALPHA' kg = '10.500' cost = '100.00' )
|
||||
( client = sy-mandt ship_id = 'R2' cust = 'BETA' kg = '2.000' cost = '50.00' )
|
||||
( client = sy-mandt ship_id = 'R3' cust = 'GAMMA' kg = '0.000' cost = '10.00' )
|
||||
( client = sy-mandt ship_id = 'R4' cust = 'DELTA' kg = '7.250' cost = '80.00' ) ).
|
||||
INSERT {{p}}road FROM TABLE @lt_road.
|
||||
|
||||
lt_rail = VALUE #(
|
||||
( client = sy-mandt ship_id = 'L1' customer = 'DELTA' weight = '20.000' fee = '300.00' )
|
||||
( client = sy-mandt ship_id = 'L2' customer = 'ALPHA' weight = '5.000' fee = '75.00' )
|
||||
( client = sy-mandt ship_id = 'L3' customer = 'EPSILON' weight = '-1.000' fee = '5.00' )
|
||||
( client = sy-mandt ship_id = 'L4' customer = 'BETA' weight = '12.000' fee = '150.00' ) ).
|
||||
INSERT {{p}}rail FROM TABLE @lt_rail.
|
||||
|
||||
out->write( 'Seed data inserted' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
42
tasks_gen/eval/G0021/spec.md
Normal file
42
tasks_gen/eval/G0021/spec.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# 1. Goal
|
||||
Show all shipments in one list. The shipments come from two tables: road shipments
|
||||
and rail shipments. The list must also show the transport mode as text. A report
|
||||
and an OData service will read the list, so the union must be in the database, in
|
||||
a CDS view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}ROAD (road shipments), package $TMP. Key: SHIP_ID (CHAR 10).
|
||||
Fields: CUST (CHAR 10, customer), KG (DEC 15,3, weight), COST (DEC 15,2).
|
||||
- Table {{P}}RAIL (rail shipments), package $TMP. Key: SHIP_ID (CHAR 10).
|
||||
Fields: CUSTOMER (CHAR 10, customer), WEIGHT (DEC 15,3, weight),
|
||||
FEE (DEC 15,2).
|
||||
- The two tables use different column names for the same content.
|
||||
- Both tables have data. A seed class fills them.
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_SHIPMENT in package $TMP.
|
||||
- The elements have these names: SHIP_ID, CUSTOMER, SHIP_MODE, WEIGHT, COST.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. The view is the union of {{P}}ROAD and {{P}}RAIL. Each row of {{P}}ROAD gives
|
||||
one row of the view, and each row of {{P}}RAIL gives one row of the view.
|
||||
2. SHIP_MODE is the literal 'ROAD' for a row that comes from {{P}}ROAD.
|
||||
SHIP_MODE is the literal 'RAIL' for a row that comes from {{P}}RAIL.
|
||||
3. CUSTOMER is CUST for a road shipment and CUSTOMER for a rail shipment.
|
||||
4. WEIGHT is KG for a road shipment and WEIGHT for a rail shipment.
|
||||
5. COST is COST for a road shipment and FEE for a rail shipment.
|
||||
6. A shipment with a weight that is not positive (0 or less) is not in the view.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP.
|
||||
- Out of scope: do not change {{P}}ROAD and {{P}}RAIL.
|
||||
|
||||
# 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/eval/G0021/task.json
Normal file
73
tasks_gen/eval/G0021/task.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"id": "G0021",
|
||||
"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}}ROAD",
|
||||
"file": "seed/road.tabl.asabap",
|
||||
"description": "Road shipments"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}RAIL",
|
||||
"file": "seed/rail.tabl.asabap",
|
||||
"description": "Rail shipments"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_SHIP",
|
||||
"file": "seed/seed_ship.clas.abap",
|
||||
"description": "Seed data for both shipment tables",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SHIPMENT",
|
||||
"fields": [
|
||||
"SHIP_ID",
|
||||
"CUSTOMER",
|
||||
"SHIP_MODE",
|
||||
"WEIGHT",
|
||||
"COST"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}ROAD",
|
||||
"{{P}}RAIL"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T16_HIDDEN",
|
||||
"file": "hidden/t16_hidden.clas.abap",
|
||||
"description": "T16 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SHIPMENT",
|
||||
"file": "reference/i_shipment.ddls.asddls",
|
||||
"description": "Union view of road and rail shipments with a literal mode"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T16_TEST",
|
||||
"file": "reference/t16_test.clas.abap",
|
||||
"description": "T16 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user