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,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Truck with depot'
define view entity {{P}}I_TRUCK
as select from {{p}}truck as truck
left outer join {{p}}depot as depot on depot.depot_id = truck.depot_id
association [0..1] to {{p}}depot as _Depot on truck.depot_id = _Depot.depot_id
{
key truck.truck_id as truck_id,
truck.depot_id as depot_id,
truck.capacity_kg as capacity_kg,
truck.truck_type as truck_type,
_Depot
}
where truck.capacity_kg > 0

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Truck with depot'
define view entity {{P}}I_TRUCK
as select from {{p}}truck as truck
inner join {{p}}depot as depot on depot.depot_id <> truck.depot_id
association [0..1] to {{p}}depot as _Depot on truck.depot_id = _Depot.depot_id
{
key truck.truck_id as truck_id,
truck.depot_id as depot_id,
truck.capacity_kg as capacity_kg,
truck.truck_type as truck_type,
_Depot
}
where truck.capacity_kg > 0

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Truck with depot'
define view entity {{P}}I_TRUCK
as select from {{p}}truck as truck
inner join {{p}}depot as depot on depot.depot_id = truck.depot_id
association [0..1] to {{p}}depot as _Depot on truck.depot_id <> _Depot.depot_id
{
key truck.truck_id as truck_id,
truck.depot_id as depot_id,
truck.capacity_kg as capacity_kg,
truck.truck_type as truck_type,
_Depot
}
where truck.capacity_kg > 0

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Truck with depot'
define view entity {{P}}I_TRUCK
as select from {{p}}truck as truck
inner join {{p}}depot as depot on depot.depot_id = truck.depot_id
association [0..1] to {{p}}depot as _Depot on truck.depot_id = _Depot.depot_id
{
key truck.truck_id as truck_id,
truck.depot_id as depot_id,
truck.capacity_kg as capacity_kg,
truck.truck_type as truck_type,
_Depot
}
where truck.capacity_kg <= 0

View File

@@ -0,0 +1,29 @@
{
"id": "G1048",
"pool": "train",
"object_type": "DDLS",
"category": "B",
"attempts": [
{
"stage": "validate",
"oracle": 0,
"null": 0
},
{
"stage": "validate",
"oracle": 85.0,
"null": 0
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 4,
"killed": 4,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,95 @@
CLASS {{p}}t21_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 one_row_per_truck FOR TESTING.
METHODS depot_name_via_path FOR TESTING.
METHODS city_via_path FOR TESTING.
METHODS depot_names_of_all FOR TESTING.
METHODS zero_capacity_hidden FOR TESTING.
METHODS unknown_depot_hidden FOR TESTING.
METHODS truck_type_shown FOR TESTING.
METHODS capacity_shown FOR TESTING.
ENDCLASS.
CLASS {{p}}t21_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_TRUCK' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_depot TYPE STANDARD TABLE OF {{p}}depot WITH EMPTY KEY.
DATA lt_truck TYPE STANDARD TABLE OF {{p}}truck WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_depot = VALUE #(
( client = sy-mandt depot_id = 'D1' depot_name = 'North Depot' city = 'HAMBURG' )
( client = sy-mandt depot_id = 'D2' depot_name = 'South Depot' city = 'MUNICH' ) ).
lt_truck = VALUE #(
( client = sy-mandt truck_id = 'T1' depot_id = 'D1' capacity_kg = 12000 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T2' depot_id = 'D1' capacity_kg = 7500 truck_type = 'FLAT' )
( client = sy-mandt truck_id = 'T3' depot_id = 'D2' capacity_kg = 20000 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T4' depot_id = 'D2' capacity_kg = 0 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T5' depot_id = 'D9' capacity_kg = 5000 truck_type = 'BOX' ) ).
go_env->insert_test_data( lt_depot ).
go_env->insert_test_data( lt_truck ).
ENDMETHOD.
METHOD one_row_per_truck.
SELECT COUNT(*) FROM {{p}}i_truck INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_rows ).
ENDMETHOD.
METHOD depot_name_via_path.
SELECT SINGLE t~\_depot-depot_name FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T1' INTO @DATA(lv_name).
cl_abap_unit_assert=>assert_equals( exp = 'North Depot' act = lv_name ).
ENDMETHOD.
METHOD city_via_path.
SELECT SINGLE t~\_depot-city FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T3' INTO @DATA(lv_city).
cl_abap_unit_assert=>assert_equals( exp = 'MUNICH' act = lv_city ).
ENDMETHOD.
METHOD depot_names_of_all.
SELECT t~truck_id, t~\_depot-depot_name AS depot_name
FROM {{p}}i_truck AS t INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lines( lt_rows ) ).
READ TABLE lt_rows INTO DATA(ls_row) WITH KEY truck_id = 'T3'.
cl_abap_unit_assert=>assert_equals( exp = 'South Depot' act = ls_row-depot_name ).
ENDMETHOD.
METHOD zero_capacity_hidden.
SELECT SINGLE t~truck_id FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T4' INTO @DATA(lv_id).
cl_abap_unit_assert=>assert_equals( exp = 4 act = sy-subrc ).
cl_abap_unit_assert=>assert_initial( act = lv_id ).
ENDMETHOD.
METHOD unknown_depot_hidden.
SELECT SINGLE t~truck_id FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T5' INTO @DATA(lv_id).
cl_abap_unit_assert=>assert_equals( exp = 4 act = sy-subrc ).
cl_abap_unit_assert=>assert_initial( act = lv_id ).
ENDMETHOD.
METHOD truck_type_shown.
SELECT SINGLE t~truck_type FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T2' INTO @DATA(lv_type).
cl_abap_unit_assert=>assert_equals( exp = 'FLAT' act = lv_type ).
ENDMETHOD.
METHOD capacity_shown.
SELECT SINGLE t~capacity_kg FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T3' INTO @DATA(lv_capacity).
cl_abap_unit_assert=>assert_equals( exp = 20000 act = lv_capacity ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,57 @@
{
"task": "G1048",
"mutants": [
{
"object": "{{P}}I_TRUCK",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "killed",
"hidden": "5/8",
"failed_tests": [
"DEPOT_NAMES_OF_ALL",
"ONE_ROW_PER_TRUCK",
"UNKNOWN_DEPOT_HIDDEN"
]
},
{
"object": "{{P}}I_TRUCK",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "5/8",
"failed_tests": [
"DEPOT_NAMES_OF_ALL",
"ONE_ROW_PER_TRUCK",
"UNKNOWN_DEPOT_HIDDEN"
]
},
{
"object": "{{P}}I_TRUCK",
"mutant": "line 6: = -> <> (eq)",
"status": "killed",
"hidden": "5/8",
"failed_tests": [
"CITY_VIA_PATH",
"DEPOT_NAMES_OF_ALL",
"DEPOT_NAME_VIA_PATH"
]
},
{
"object": "{{P}}I_TRUCK",
"mutant": "line 14: > -> <= (rel)",
"status": "killed",
"hidden": "1/8",
"failed_tests": [
"CAPACITY_SHOWN",
"CITY_VIA_PATH",
"DEPOT_NAMES_OF_ALL",
"DEPOT_NAME_VIA_PATH",
"ONE_ROW_PER_TRUCK",
"TRUCK_TYPE_SHOWN",
"ZERO_CAPACITY_HIDDEN"
]
}
],
"valid": 4,
"killed": 4,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Truck with depot'
define view entity {{P}}I_TRUCK
as select from {{p}}truck as truck
inner join {{p}}depot as depot on depot.depot_id = truck.depot_id
association [0..1] to {{p}}depot as _Depot on truck.depot_id = _Depot.depot_id
{
key truck.truck_id as truck_id,
truck.depot_id as depot_id,
truck.capacity_kg as capacity_kg,
truck.truck_type as truck_type,
_Depot
}
where truck.capacity_kg > 0

View File

@@ -0,0 +1,51 @@
CLASS {{p}}t21_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 depot_of_truck FOR TESTING.
METHODS zero_capacity_absent FOR TESTING.
ENDCLASS.
CLASS {{p}}t21_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_TRUCK' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_depot TYPE STANDARD TABLE OF {{p}}depot WITH EMPTY KEY.
DATA lt_truck TYPE STANDARD TABLE OF {{p}}truck WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_depot = VALUE #(
( client = sy-mandt depot_id = 'D1' depot_name = 'North Depot' city = 'HAMBURG' )
( client = sy-mandt depot_id = 'D2' depot_name = 'South Depot' city = 'MUNICH' ) ).
lt_truck = VALUE #(
( client = sy-mandt truck_id = 'T1' depot_id = 'D1' capacity_kg = 12000 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T2' depot_id = 'D1' capacity_kg = 7500 truck_type = 'FLAT' )
( client = sy-mandt truck_id = 'T3' depot_id = 'D2' capacity_kg = 20000 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T4' depot_id = 'D2' capacity_kg = 0 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T5' depot_id = 'D9' capacity_kg = 5000 truck_type = 'BOX' ) ).
go_env->insert_test_data( lt_depot ).
go_env->insert_test_data( lt_truck ).
ENDMETHOD.
METHOD depot_of_truck.
SELECT SINGLE t~\_depot-city FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T1' INTO @DATA(lv_city).
cl_abap_unit_assert=>assert_equals( exp = 'HAMBURG' act = lv_city ).
ENDMETHOD.
METHOD zero_capacity_absent.
SELECT SINGLE t~truck_id FROM {{p}}i_truck AS t
WHERE t~truck_id = 'T4' INTO @DATA(lv_id).
cl_abap_unit_assert=>assert_equals( exp = 4 act = sy-subrc ).
cl_abap_unit_assert=>assert_initial( act = lv_id ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : '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(10) not null;
depot_name : abap.char(30);
city : abap.char(20);
}

View File

@@ -0,0 +1,25 @@
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}}truck.
DELETE FROM {{p}}depot.
INSERT {{p}}depot FROM TABLE @( VALUE #(
( client = sy-mandt depot_id = 'D1' depot_name = 'North Depot' city = 'HAMBURG' )
( client = sy-mandt depot_id = 'D2' depot_name = 'South Depot' city = 'MUNICH' ) ) ).
INSERT {{p}}truck FROM TABLE @( VALUE #(
( client = sy-mandt truck_id = 'T1' depot_id = 'D1' capacity_kg = 12000 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T2' depot_id = 'D1' capacity_kg = 7500 truck_type = 'FLAT' )
( client = sy-mandt truck_id = 'T3' depot_id = 'D2' capacity_kg = 20000 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T4' depot_id = 'D2' capacity_kg = 0 truck_type = 'BOX' )
( client = sy-mandt truck_id = 'T5' depot_id = 'D9' capacity_kg = 5000 truck_type = 'BOX' ) ) ).
out->write( 'Seed data written' ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Truck'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}truck {
key client : abap.clnt not null;
key truck_id : abap.char(10) not null;
depot_id : abap.char(10);
capacity_kg : abap.int4;
truck_type : abap.char(4);
}

View File

@@ -0,0 +1,53 @@
# 1. Goal
Show each truck of the fleet together with the depot that it belongs to. A
planning program and an OData service read the data. The join must be in the
database, in a CDS view. The consumers read the depot data with a path
expression over the association of the view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}DEPOT (depot), package $TMP. Key: DEPOT_ID (CHAR 10).
Fields: DEPOT_NAME (CHAR 30), CITY (CHAR 20).
- Table {{P}}TRUCK (truck), package $TMP. Key: TRUCK_ID (CHAR 10).
Fields: DEPOT_ID (CHAR 10), CAPACITY_KG (INT4, payload in kilograms),
TRUCK_TYPE (CHAR 4).
- A truck belongs to one depot. The depot is in {{P}}DEPOT.
# 4. Contract
- Create the CDS view entity {{P}}I_TRUCK in package $TMP.
- Elements, with these names: TRUCK_ID (key), DEPOT_ID, CAPACITY_KG,
TRUCK_TYPE.
- The view exposes the association `_Depot` to {{P}}DEPOT. The association is
an element of the view and its name is `_Depot`.
- An ABAP SQL consumer reads the depot with the path expression
`\_Depot-DEPOT_NAME` and `\_Depot-CITY`.
- The authorization check is not required (#NOT_REQUIRED).
# 5. Business rules
1. The view has one row for each truck with a CAPACITY_KG greater than zero.
A truck with a capacity of zero or less is not in the view.
2. The view has one row for each truck whose depot exists in {{P}}DEPOT.
A truck with a DEPOT_ID that is not in {{P}}DEPOT is not in the view.
3. TRUCK_ID, DEPOT_ID, CAPACITY_KG and TRUCK_TYPE are the values of the
truck.
4. The association `_Depot` points from a truck to the depot with the same
DEPOT_ID. The cardinality is to-one.
# 6. Constraints
- Release target: ABAP Platform 2025, SAP_BASIS 816.
- Coding standards: Clean ABAP. No ATC findings of priority 1 or 2.
- Out of scope: do not change {{P}}DEPOT and {{P}}TRUCK.
# 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.

View File

@@ -0,0 +1,72 @@
{
"id": "G1048",
"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": "Depot"
},
{
"type": "TABL",
"name": "{{P}}TRUCK",
"file": "seed/truck.tabl.asabap",
"description": "Truck"
},
{
"type": "CLAS",
"name": "{{P}}SEED_DATA",
"file": "seed/seed_data.clas.abap",
"description": "Seed data for depot and truck",
"run": true
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_TRUCK",
"fields": [
"TRUCK_ID",
"DEPOT_ID",
"CAPACITY_KG",
"TRUCK_TYPE"
]
}
],
"out_of_scope": [
"{{P}}DEPOT",
"{{P}}TRUCK"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T21_HIDDEN",
"file": "hidden/t21_hidden.clas.abap",
"description": "T21 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_TRUCK",
"file": "reference/i_truck.ddls.asddls",
"description": "Truck with exposed depot association"
},
{
"type": "CLAS",
"name": "{{P}}T21_TEST",
"file": "reference/t21_test.clas.abap",
"description": "T21 own tests"
}
],
"craft_checks": []
}