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,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Dive stats'
define view entity {{P}}I_DIVE_STATS
as select from {{p}}diver as diver
left outer join {{p}}dive as dive on dive.diver_id = diver.diver_id
left outer join {{p}}site as site on site.site_id = dive.site_id
{
key diver.diver_id as diver_id,
diver.diver_name as diver_name,
count( * ) as dive_count,
max( site.depth_m ) as deepest_m
}
group by
diver.diver_id,
diver.diver_name

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Dive stats'
define view entity {{P}}I_DIVE_STATS
as select from {{p}}diver as diver
inner join {{p}}dive as dive on dive.diver_id <> diver.diver_id
left outer join {{p}}site as site on site.site_id = dive.site_id
{
key diver.diver_id as diver_id,
diver.diver_name as diver_name,
count( * ) as dive_count,
max( site.depth_m ) as deepest_m
}
group by
diver.diver_id,
diver.diver_name

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Dive stats'
define view entity {{P}}I_DIVE_STATS
as select from {{p}}diver as diver
inner join {{p}}dive as dive on dive.diver_id = diver.diver_id
left outer join {{p}}site as site on site.site_id <> dive.site_id
{
key diver.diver_id as diver_id,
diver.diver_name as diver_name,
count( * ) as dive_count,
max( site.depth_m ) as deepest_m
}
group by
diver.diver_id,
diver.diver_name

View File

@@ -0,0 +1,40 @@
{
"id": "G1071",
"pool": "train",
"object_type": "DDLS",
"category": "I",
"attempts": [
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 5,
"killed": 3,
"ok": false
}
},
{
"stage": "bundle",
"errors": [
"Too close to task T15 (similarity spec 0.77, rules 0.63, names 0.00). Choose a different business topic and different object names.",
"Too close to task G0018 (similarity spec 0.78, rules 0.64, names 0.00). Choose a different business topic and different object names.",
"Too close to task T15 (similarity spec 0.77, rules 0.63, names 0.00). Choose a different business topic and different object names."
],
"by_check": {
"extra": 3
}
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 3,
"killed": 3,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,78 @@
CLASS {{p}}t_dive_stats_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_diver FOR TESTING.
METHODS dive_count_all_dives FOR TESTING.
METHODS deepest_of_diver FOR TESTING.
METHODS diver_without_dives FOR TESTING.
METHODS dive_without_site_counts FOR TESTING.
METHODS diver_name_shown FOR TESTING.
ENDCLASS.
CLASS {{p}}t_dive_stats_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_DIVE_STATS' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_diver TYPE STANDARD TABLE OF {{p}}diver WITH EMPTY KEY.
DATA lt_site TYPE STANDARD TABLE OF {{p}}site WITH EMPTY KEY.
DATA lt_dive TYPE STANDARD TABLE OF {{p}}dive WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_diver = VALUE #(
( diver_id = 'D1' diver_name = 'Alice' )
( diver_id = 'D2' diver_name = 'Bob' )
( diver_id = 'D3' diver_name = 'Carol' ) ).
lt_site = VALUE #(
( site_id = 'S1' site_name = 'Reef' depth_m = 10 )
( site_id = 'S2' site_name = 'Wreck' depth_m = 30 )
( site_id = 'S3' site_name = 'Cave' depth_m = 20 ) ).
lt_dive = VALUE #(
( dive_id = 'V1' diver_id = 'D1' site_id = 'S1' dive_date = '20250101' )
( dive_id = 'V2' diver_id = 'D1' site_id = 'S2' dive_date = '20250102' )
( dive_id = 'V3' diver_id = 'D1' site_id = 'S3' dive_date = '20250103' )
( dive_id = 'V4' diver_id = 'D2' site_id = 'S1' dive_date = '20250104' )
( dive_id = 'V5' diver_id = 'D2' site_id = 'S9' dive_date = '20250105' ) ).
go_env->insert_test_data( lt_diver ).
go_env->insert_test_data( lt_site ).
go_env->insert_test_data( lt_dive ).
ENDMETHOD.
METHOD one_row_per_diver.
SELECT COUNT(*) FROM {{p}}i_dive_stats INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rows ).
ENDMETHOD.
METHOD dive_count_all_dives.
SELECT SINGLE dive_count FROM {{p}}i_dive_stats WHERE diver_id = 'D1' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_count ).
ENDMETHOD.
METHOD deepest_of_diver.
SELECT SINGLE deepest_m FROM {{p}}i_dive_stats WHERE diver_id = 'D1' INTO @DATA(lv_depth).
cl_abap_unit_assert=>assert_equals( exp = 30 act = lv_depth ).
ENDMETHOD.
METHOD diver_without_dives.
SELECT COUNT(*) FROM {{p}}i_dive_stats WHERE diver_id = 'D3' INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD dive_without_site_counts.
SELECT SINGLE dive_count FROM {{p}}i_dive_stats WHERE diver_id = 'D2' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
ENDMETHOD.
METHOD diver_name_shown.
SELECT SINGLE diver_name FROM {{p}}i_dive_stats WHERE diver_id = 'D1' INTO @DATA(lv_name).
cl_abap_unit_assert=>assert_equals( exp = 'Alice' act = lv_name ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,42 @@
{
"task": "G1071",
"mutants": [
{
"object": "{{P}}I_DIVE_STATS",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "killed",
"hidden": "4/6",
"failed_tests": [
"DIVER_WITHOUT_DIVES",
"ONE_ROW_PER_DIVER"
]
},
{
"object": "{{P}}I_DIVE_STATS",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "1/6",
"failed_tests": [
"DEEPEST_OF_DIVER",
"DIVER_WITHOUT_DIVES",
"DIVE_COUNT_ALL_DIVES",
"DIVE_WITHOUT_SITE_COUNTS",
"ONE_ROW_PER_DIVER"
]
},
{
"object": "{{P}}I_DIVE_STATS",
"mutant": "line 6: = -> <> (eq)",
"status": "killed",
"hidden": "4/6",
"failed_tests": [
"DIVE_COUNT_ALL_DIVES",
"DIVE_WITHOUT_SITE_COUNTS"
]
}
],
"valid": 3,
"killed": 3,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Dive stats'
define view entity {{P}}I_DIVE_STATS
as select from {{p}}diver as diver
inner join {{p}}dive as dive on dive.diver_id = diver.diver_id
left outer join {{p}}site as site on site.site_id = dive.site_id
{
key diver.diver_id as diver_id,
diver.diver_name as diver_name,
count( * ) as dive_count,
max( site.depth_m ) as deepest_m
}
group by
diver.diver_id,
diver.diver_name

View File

@@ -0,0 +1,41 @@
CLASS {{p}}t_dive_stats_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 stats_of_one_diver FOR TESTING.
ENDCLASS.
CLASS {{p}}t_dive_stats_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_DIVE_STATS' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_diver TYPE STANDARD TABLE OF {{p}}diver WITH EMPTY KEY.
DATA lt_site TYPE STANDARD TABLE OF {{p}}site WITH EMPTY KEY.
DATA lt_dive TYPE STANDARD TABLE OF {{p}}dive WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_diver = VALUE #( ( diver_id = 'X1' diver_name = 'Test' ) ).
lt_site = VALUE #( ( site_id = 'S1' site_name = 'Reef' depth_m = 12 ) ).
lt_dive = VALUE #(
( dive_id = 'V1' diver_id = 'X1' site_id = 'S1' dive_date = '20250101' )
( dive_id = 'V2' diver_id = 'X1' site_id = 'S1' dive_date = '20250102' ) ).
go_env->insert_test_data( lt_diver ).
go_env->insert_test_data( lt_site ).
go_env->insert_test_data( lt_dive ).
ENDMETHOD.
METHOD stats_of_one_diver.
SELECT SINGLE dive_count, deepest_m FROM {{p}}i_dive_stats WHERE diver_id = 'X1'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-dive_count ).
cl_abap_unit_assert=>assert_equals( exp = 12 act = ls_row-deepest_m ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Dive'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}dive {
key client : abap.clnt not null;
key dive_id : abap.char(10) not null;
diver_id : abap.char(10);
site_id : abap.char(10);
dive_date : abap.dats;
}

View File

@@ -0,0 +1,10 @@
@EndUserText.label : 'Diver'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}diver {
key client : abap.clnt not null;
key diver_id : abap.char(10) not null;
diver_name : abap.char(40);
}

View File

@@ -0,0 +1,19 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Dive stats'
define view entity {{P}}I_DIVE_STATS
as select from {{p}}diver as diver
inner join {{p}}dive as dive on dive.diver_id = diver.diver_id
left outer join {{p}}site as site on site.site_id = dive.site_id
{
key diver.diver_id as diver_id,
diver.diver_name as diver_name,
dive.dive_id as dive_id,
site.site_id as site_id,
count( * ) as dive_count,
max( site.depth_m ) as deepest_m
}
group by
diver.diver_id,
diver.diver_name,
dive.dive_id,
site.site_id

View File

@@ -0,0 +1,34 @@
CLASS {{p}}seed_dive DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS {{p}}seed_dive IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DELETE FROM {{p}}diver.
DELETE FROM {{p}}site.
DELETE FROM {{p}}dive.
INSERT {{p}}diver FROM TABLE @( VALUE #(
( diver_id = 'D1' diver_name = 'Alice' )
( diver_id = 'D2' diver_name = 'Bob' )
( diver_id = 'D3' diver_name = 'Carol' ) ) ).
INSERT {{p}}site FROM TABLE @( VALUE #(
( site_id = 'S1' site_name = 'Reef' depth_m = 10 )
( site_id = 'S2' site_name = 'Wreck' depth_m = 30 )
( site_id = 'S3' site_name = 'Cave' depth_m = 20 ) ) ).
INSERT {{p}}dive FROM TABLE @( VALUE #(
( dive_id = 'V1' diver_id = 'D1' site_id = 'S1' dive_date = '20250101' )
( dive_id = 'V2' diver_id = 'D1' site_id = 'S2' dive_date = '20250102' )
( dive_id = 'V3' diver_id = 'D1' site_id = 'S3' dive_date = '20250103' )
( dive_id = 'V4' diver_id = 'D2' site_id = 'S1' dive_date = '20250104' )
( dive_id = 'V5' diver_id = 'D2' site_id = 'S9' dive_date = '20250105' ) ) ).
SELECT * FROM {{p}}i_dive_stats INTO TABLE @DATA(lt_result).
out->write( lt_result ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Dive site'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}site {
key client : abap.clnt not null;
key site_id : abap.char(10) not null;
site_name : abap.char(40);
depth_m : abap.int4;
}

View File

@@ -0,0 +1,47 @@
# 1. Goal
Fix the CDS view entity {{P}}I_DIVE_STATS in package $TMP. The view shows the
diving activity of each diver. The operations team reports two symptoms:
- The view shows one row for each dive of a diver, not one row for each diver.
- DIVE_COUNT is always 1.
The view must show one row for each diver, and DIVE_COUNT must show the number of
dives of the diver.
# 2. Open questions
None.
# 3. Context
- Table {{P}}DIVER (diver), package $TMP. Key: DIVER_ID (CHAR 10).
Field: DIVER_NAME (CHAR 40).
- Table {{P}}SITE (dive site), package $TMP. Key: SITE_ID (CHAR 10).
Fields: SITE_NAME (CHAR 40), DEPTH_M (INT4, depth of the site in metres).
- Table {{P}}DIVE (dive), package $TMP. Key: DIVE_ID (CHAR 10).
Fields: DIVER_ID (CHAR 10), SITE_ID (CHAR 10), DIVE_DATE (DATS).
- The CDS view entity {{P}}I_DIVE_STATS exists in package $TMP and is active.
- The class {{P}}SEED_DIVE fills the three tables with test data and shows the
view.
# 4. Contract
- Fix the CDS view entity {{P}}I_DIVE_STATS in package $TMP.
- Elements, with these names: DIVER_ID (key), DIVER_NAME, DIVE_COUNT, DEEPEST_M.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The view shows one row for each diver that has at least one dive. A diver
without dives does not appear.
2. DIVE_COUNT is the number of dives of the diver. A dive whose site is not in
{{P}}SITE still counts as one dive.
3. DEEPEST_M is the greatest DEPTH_M of the sites of the dives of the diver. A
dive without a site adds nothing to DEEPEST_M.
4. DIVER_NAME is the name of the diver.
5. All other behavior stays the same.
# 6. Constraints
- Release target: SAP_BASIS 816.
- Out of scope: do not change {{P}}DIVER, {{P}}SITE, {{P}}DIVE and
{{P}}SEED_DIVE.
- Coding standards: Clean ABAP.
# 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,86 @@
{
"id": "G1071",
"category": "I",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "TABL",
"name": "{{P}}DIVER",
"file": "seed/diver.tabl.asabap",
"description": "Diver"
},
{
"type": "TABL",
"name": "{{P}}SITE",
"file": "seed/site.tabl.asabap",
"description": "Dive site"
},
{
"type": "TABL",
"name": "{{P}}DIVE",
"file": "seed/dive.tabl.asabap",
"description": "Dive"
},
{
"type": "DDLS",
"name": "{{P}}I_DIVE_STATS",
"file": "seed/i_dive_stats.ddls.asddls",
"description": "Faulty dive statistics view"
},
{
"type": "CLAS",
"name": "{{P}}SEED_DIVE",
"file": "seed/seed_dive.clas.abap",
"description": "Seed data and show view",
"run": true
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_DIVE_STATS",
"fields": [
"DIVER_ID",
"DIVER_NAME",
"DIVE_COUNT",
"DEEPEST_M"
]
}
],
"out_of_scope": [
"{{P}}DIVER",
"{{P}}SITE",
"{{P}}DIVE",
"{{P}}SEED_DIVE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T_DIVE_STATS_HIDDEN",
"file": "hidden/t_dive_stats_hidden.clas.abap",
"description": "Hidden tests for dive statistics"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_DIVE_STATS",
"file": "reference/i_dive_stats.ddls.asddls",
"description": "Fixed dive statistics view"
},
{
"type": "CLAS",
"name": "{{P}}T_DIVE_STATS_TEST",
"file": "reference/t_dive_stats_test.clas.abap",
"description": "Reference tests"
}
],
"craft_checks": []
}