Stage 2 summary at 50 accepted trajectories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 18:02:52 +02:00
parent 332fb4601d
commit 5bcd1bf9cd
1230 changed files with 77563 additions and 33 deletions

View File

@@ -0,0 +1,37 @@
{
"id": "G1128",
"pool": "train",
"object_type": "DDLS",
"category": "B",
"attempts": [
{
"stage": "validate",
"oracle": 0,
"null": 0
},
{
"stage": "bundle",
"errors": [
"invalid JSON: Expecting value: line 1 column 1 (char 0)"
],
"by_check": {
"json": 1
}
},
{
"stage": "bundle",
"errors": [
"invalid JSON: Expecting value: line 1 column 1 (char 0)"
],
"by_check": {
"json": 1
}
},
{
"stage": "validate",
"oracle": 0,
"null": 0
}
],
"accepted": false
}

View File

@@ -0,0 +1,100 @@
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 all_routes FOR TESTING.
METHODS depot_data FOR TESTING.
METHODS route_without_depot FOR TESTING.
METHODS route_values FOR TESTING.
METHODS stops_of_route FOR TESTING.
METHODS stops_filtered FOR TESTING.
METHODS route_without_stops FOR TESTING.
ENDCLASS.
CLASS {{p}}t16_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ROUTE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_depot TYPE STANDARD TABLE OF {{p}}depot WITH EMPTY KEY.
DATA lt_route TYPE STANDARD TABLE OF {{p}}route WITH EMPTY KEY.
DATA lt_stop TYPE STANDARD TABLE OF {{p}}stop WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_depot = VALUE #( ( depot_id = 'D1' depot_name = 'North' city = 'Leeds' )
( depot_id = 'D2' depot_name = 'South' city = 'Bristol' ) ).
lt_route = VALUE #( ( route_id = 'R1' depot_id = 'D1' route_name = 'City Line' distance_km = '12.5' )
( route_id = 'R2' depot_id = 'D2' route_name = 'Coast Line' distance_km = '30.0' )
( route_id = 'R3' depot_id = 'D9' route_name = 'Hill Line' distance_km = '8.0' ) ).
lt_stop = VALUE #( ( route_id = 'R1' stop_no = 1 stop_name = 'Market' distance_km = '0.0' )
( route_id = 'R1' stop_no = 2 stop_name = 'Station' distance_km = '4.2' )
( route_id = 'R1' stop_no = 3 stop_name = 'Airport' distance_km = '12.5' )
( route_id = 'R2' stop_no = 1 stop_name = 'Harbour' distance_km = '0.0' )
( route_id = 'R2' stop_no = 2 stop_name = 'Beach' distance_km = '9.0' ) ).
go_env->insert_test_data( lt_depot ).
go_env->insert_test_data( lt_route ).
go_env->insert_test_data( lt_stop ).
ENDMETHOD.
METHOD all_routes.
SELECT COUNT(*) FROM {{p}}i_route INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_rows ).
ENDMETHOD.
METHOD depot_data.
SELECT SINGLE depot_name, city FROM {{p}}i_route WHERE route_id = 'R1' INTO @DATA(ls_route).
cl_abap_unit_assert=>assert_equals( exp = 'North' act = ls_route-depot_name ).
cl_abap_unit_assert=>assert_equals( exp = 'Leeds' act = ls_route-city ).
ENDMETHOD.
METHOD route_without_depot.
SELECT SINGLE depot_name, city FROM {{p}}i_route WHERE route_id = 'R3' INTO @DATA(ls_route).
cl_abap_unit_assert=>assert_initial( act = ls_route-depot_name ).
cl_abap_unit_assert=>assert_initial( act = ls_route-city ).
SELECT COUNT(*) FROM {{p}}i_route WHERE route_id = 'R3' INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rows ).
ENDMETHOD.
METHOD route_values.
SELECT SINGLE route_name, distance_km FROM {{p}}i_route WHERE route_id = 'R2'
INTO @DATA(ls_route).
cl_abap_unit_assert=>assert_equals( exp = 'Coast Line' act = ls_route-route_name ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '30.0' )
act = CONV decfloat34( ls_route-distance_km ) ).
ENDMETHOD.
METHOD stops_of_route.
SELECT FROM {{p}}i_route AS rt
INNER JOIN rt\_stop AS st ON st~route_id = rt~route_id
FIELDS rt~route_id, st~stop_no
WHERE rt~route_id = 'R1'
INTO TABLE @DATA(lt_stops).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lines( lt_stops ) ).
ENDMETHOD.
METHOD stops_filtered.
SELECT FROM {{p}}i_route AS rt
INNER JOIN rt\_stop AS st ON st~route_id = rt~route_id
FIELDS st~stop_name
WHERE st~distance_km > 5
INTO TABLE @DATA(lt_names).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_names ) ).
ENDMETHOD.
METHOD route_without_stops.
SELECT FROM {{p}}i_route AS rt
INNER JOIN rt\_stop AS st ON st~route_id = rt~route_id
FIELDS st~stop_no
WHERE rt~route_id = 'R3'
INTO TABLE @DATA(lt_stops).
cl_abap_unit_assert=>assert_initial( act = lt_stops ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,47 @@
{
"task": "T16",
"mutants": [
{
"object": "{{P}}I_ROUTE",
"mutant": "line 5: left outer join -> inner join (join)",
"status": "killed",
"hidden": "2/7",
"failed_tests": [
"ALL_ROUTES",
"ROUTE_WITHOUT_DEPOT"
]
},
{
"object": "{{P}}I_ROUTE",
"mutant": "line 5: d.depot_id = r.depot_id -> d.depot_id = r.route_id (eq)",
"status": "killed",
"hidden": "1/7",
"failed_tests": [
"DEPOT_DATA"
]
},
{
"object": "{{P}}I_ROUTE",
"mutant": "line 11: d.city as city -> d.depot_name as city (element)",
"status": "killed",
"hidden": "1/7",
"failed_tests": [
"DEPOT_DATA"
]
},
{
"object": "{{P}}I_ROUTE",
"mutant": "line 4: to {{P}}I_STOP as _stop -> to {{P}}I_STOP as _stops (assoc)",
"status": "killed",
"hidden": "2/7",
"failed_tests": [
"STOPS_OF_ROUTE",
"ROUTE_WITHOUT_STOPS"
]
}
],
"valid": 4,
"killed": 4,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Bus routes with depot and stops'
define view entity {{P}}I_ROUTE
as select from {{p}}route as r
left outer join {{p}}depot as d on d.depot_id = r.depot_id
association [0..*] to {{P}}I_STOP as _stop on $projection.route_id = _stop.route_id
{
key r.route_id as route_id,
r.route_name as route_name,
d.depot_name as depot_name,
d.city as city,
r.distance_km as distance_km,
_stop
}

View File

@@ -0,0 +1,10 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stops of a route'
define view entity {{P}}I_STOP
as select from {{p}}stop
{
key route_id as route_id,
key stop_no as stop_no,
stop_name as stop_name,
distance_km as distance_km
}

View File

@@ -0,0 +1,51 @@
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 route_with_stops FOR TESTING.
METHODS missing_depot FOR TESTING.
ENDCLASS.
CLASS {{p}}t16_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_ROUTE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_depot TYPE STANDARD TABLE OF {{p}}depot WITH EMPTY KEY.
DATA lt_route TYPE STANDARD TABLE OF {{p}}route WITH EMPTY KEY.
DATA lt_stop TYPE STANDARD TABLE OF {{p}}stop WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_depot = VALUE #( ( depot_id = 'D1' depot_name = 'North' city = 'Leeds' ) ).
lt_route = VALUE #( ( route_id = 'R1' depot_id = 'D1' route_name = 'City Line' distance_km = '12.5' ) ).
lt_stop = VALUE #( ( route_id = 'R1' stop_no = 1 stop_name = 'Market' distance_km = '0.0' )
( route_id = 'R1' stop_no = 2 stop_name = 'Station' distance_km = '4.2' ) ).
go_env->insert_test_data( lt_depot ).
go_env->insert_test_data( lt_route ).
go_env->insert_test_data( lt_stop ).
ENDMETHOD.
METHOD route_with_stops.
SELECT FROM {{p}}i_route AS rt
INNER JOIN rt\_stop AS st ON st~route_id = rt~route_id
FIELDS rt~depot_name, st~stop_name
INTO TABLE @DATA(lt_result).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_result ) ).
ENDMETHOD.
METHOD missing_depot.
DATA lt_route TYPE STANDARD TABLE OF {{p}}route WITH EMPTY KEY.
lt_route = VALUE #( ( route_id = 'R9' depot_id = 'D9' route_name = 'Hill Line' distance_km = '8.0' ) ).
go_env->insert_test_data( lt_route ).
SELECT SINGLE depot_name FROM {{p}}i_route WHERE route_id = 'R9' INTO @DATA(lv_name).
cl_abap_unit_assert=>assert_initial( act = lv_name ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Bus depot'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}depot {
key client : abap.clnt not null;
key depot_id : abap.char(4) not null;
depot_name : abap.char(30);
city : abap.char(20);
}

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Bus route'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}route {
key client : abap.clnt not null;
key route_id : abap.char(6) not null;
depot_id : abap.char(4);
route_name : abap.char(30);
distance_km : abap.dec(6,1);
}

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Stop of a route'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}stop {
key client : abap.clnt not null;
key route_id : abap.char(6) not null;
key stop_no : abap.int4 not null;
stop_name : abap.char(30);
distance_km : abap.dec(6,1);
}

View File

@@ -0,0 +1,51 @@
# 1. Goal
A regional bus company operates depots and routes. Show each route together
with the depot that operates it. A report and an OData service read the routes.
The OData service also reads the stops of a route. It uses the association of
the view in an ABAP SQL path expression.
# 2. Open questions
None.
# 3. Context
- Table {{P}}DEPOT (bus depot), package $TMP. Key: DEPOT_ID (CHAR 4).
Fields: DEPOT_NAME (CHAR 30), CITY (CHAR 20).
- Table {{P}}ROUTE (bus route), package $TMP. Key: ROUTE_ID (CHAR 6).
Fields: DEPOT_ID (CHAR 4), ROUTE_NAME (CHAR 30), DISTANCE_KM (DEC 6,1).
- Table {{P}}STOP (stop of a route), package $TMP. Key: ROUTE_ID (CHAR 6),
STOP_NO (INT4). Fields: STOP_NAME (CHAR 30), DISTANCE_KM (DEC 6,1).
# 4. Contract
- Create the CDS view entity {{P}}I_STOP in package $TMP.
Elements, with these names: ROUTE_ID (key), STOP_NO (key), STOP_NAME,
DISTANCE_KM.
- Create the CDS view entity {{P}}I_ROUTE in package $TMP.
Elements, with these names: ROUTE_ID (key), ROUTE_NAME, DEPOT_NAME, CITY,
DISTANCE_KM, _STOP.
- {{P}}I_ROUTE has the association _STOP. The target of _STOP is the view
entity {{P}}I_STOP. _STOP is an element of {{P}}I_ROUTE, so that ABAP SQL
can use a path expression on _STOP.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. {{P}}I_ROUTE shows one row for each route in {{P}}ROUTE.
2. ROUTE_NAME and DISTANCE_KM are the values of the route.
3. DEPOT_NAME and CITY are the values of the depot of the route. The depot of
a route is the depot with the same DEPOT_ID as the route.
4. A route whose DEPOT_ID is not in {{P}}DEPOT still appears in the view. In
this row DEPOT_NAME and CITY are empty.
5. _STOP links a route to the rows of {{P}}I_STOP that have the same ROUTE_ID
as the route. A route without stops still appears in the view.
6. {{P}}I_STOP shows one row for each row of {{P}}STOP, with the same element
values.
# 6. Constraints
- Release target: SAP_BASIS 816.
- Out of scope: do not change {{P}}DEPOT, {{P}}ROUTE and {{P}}STOP.
- A consumer reads the stops of a route with an ABAP SQL path expression that
uses the association _STOP.
# 7. Acceptance
- The views are active and have no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,90 @@
{
"id": "G1128",
"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}}DEPOT",
"file": "seed/depot.tabl.asabap",
"description": "Bus depot"
},
{
"type": "TABL",
"name": "{{P}}ROUTE",
"file": "seed/route.tabl.asabap",
"description": "Bus route"
},
{
"type": "TABL",
"name": "{{P}}STOP",
"file": "seed/stop.tabl.asabap",
"description": "Stop of a route"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_STOP",
"fields": [
"ROUTE_ID",
"STOP_NO",
"STOP_NAME",
"DISTANCE_KM"
]
},
{
"type": "DDLS",
"name": "{{P}}I_ROUTE",
"fields": [
"ROUTE_ID",
"ROUTE_NAME",
"DEPOT_NAME",
"CITY",
"DISTANCE_KM",
"_STOP"
]
}
],
"out_of_scope": [
"{{P}}DEPOT",
"{{P}}ROUTE",
"{{P}}STOP"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T16_HIDDEN",
"file": "hidden/t16_hidden.clas.abap",
"description": "T16 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_STOP",
"file": "reference/i_stop.ddls.asddls",
"description": "Stops of a route"
},
{
"type": "DDLS",
"name": "{{P}}I_ROUTE",
"file": "reference/i_route.ddls.asddls",
"description": "Bus routes with depot data and the stop association"
},
{
"type": "CLAS",
"name": "{{P}}T16_TEST",
"file": "reference/t16_test.clas.abap",
"description": "T16 own tests"
}
],
"craft_checks": []
}