Snapshot: new training tasks (balanced generation), docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 22:08:59 +02:00
parent eb13453097
commit 6984fc7917
572 changed files with 30024 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
left outer join {{p}}dome as dome on dome.dome_id = night.dome_id
inner join {{p}}scope as scope on scope.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome on dome.dome_id <> night.dome_id
inner join {{p}}scope as scope on scope.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome on dome.dome_id = night.dome_id
left outer join {{p}}scope as scope on scope.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome on dome.dome_id = night.dome_id
inner join {{p}}scope as scope on scope.scope_id <> night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome on dome.dome_id = night.dome_id
inner join {{p}}scope as scope on scope.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity + night.visitors as free_seats
}

View File

@@ -0,0 +1,38 @@
{
"id": "G1929",
"pool": "train",
"object_type": "DDLS",
"category": "E",
"attempts": [
{
"stage": "bundle",
"errors": [
"Too close to task G0146 (similarity spec 0.56, rules 0.65, names 0.00). Choose a different business topic and different object names."
],
"by_check": {
"extra": 1
}
},
{
"stage": "bundle",
"errors": [
"Too close to task G0146 (similarity spec 0.57, rules 0.67, names 0.00). Choose a different business topic and different object names.",
"Too close to task G0147 (similarity spec 0.51, rules 0.62, names 0.00). Choose a different business topic and different object names."
],
"by_check": {
"extra": 2
}
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 5,
"killed": 5,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,118 @@
CLASS {{p}}t61_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 shows_dome_data FOR TESTING.
METHODS shows_scope_data FOR TESTING.
METHODS shows_ids_and_visitors FOR TESTING.
METHODS shows_night_date FOR TESTING.
METHODS free_seats_positive FOR TESTING.
METHODS free_seats_negative FOR TESTING.
METHODS hides_unknown_dome FOR TESTING.
METHODS hides_unknown_scope FOR TESTING.
METHODS counts_rows FOR TESTING.
ENDCLASS.
CLASS {{p}}t61_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STAR_NIGHT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_dome TYPE STANDARD TABLE OF {{p}}dome WITH EMPTY KEY.
DATA lt_scope TYPE STANDARD TABLE OF {{p}}scope WITH EMPTY KEY.
DATA lt_night TYPE STANDARD TABLE OF {{p}}night WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_dome = VALUE #( ( dome_id = 'D1' dome_name = 'Main Dome' city = 'NORTH' capacity = 120 )
( dome_id = 'D2' dome_name = 'Side Dome' city = 'SOUTH' capacity = 60 ) ).
lt_scope = VALUE #( ( scope_id = 'S1' scope_name = 'Reflector' aperture_mm = 300 mount_kind = 'EQUATORIAL' )
( scope_id = 'S2' scope_name = 'Refractor' aperture_mm = 150 mount_kind = 'ALT_AZ' ) ).
lt_night = VALUE #( ( night_id = 'N1' dome_id = 'D1' scope_id = 'S1' visitors = 100 night_date = '20250601' )
( night_id = 'N2' dome_id = 'D2' scope_id = 'S2' visitors = 70 night_date = '20250602' )
( night_id = 'N3' dome_id = 'D9' scope_id = 'S1' visitors = 5 night_date = '20250603' )
( night_id = 'N4' dome_id = 'D1' scope_id = 'S9' visitors = 5 night_date = '20250604' ) ).
go_env->insert_test_data( lt_dome ).
go_env->insert_test_data( lt_scope ).
go_env->insert_test_data( lt_night ).
ENDMETHOD.
METHOD shows_dome_data.
SELECT SINGLE dome_name, dome_city
FROM {{p}}i_star_night
WHERE night_id = 'N1'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'Main Dome' act = ls_row-dome_name ).
cl_abap_unit_assert=>assert_equals( exp = 'NORTH' act = ls_row-dome_city ).
ENDMETHOD.
METHOD shows_scope_data.
SELECT SINGLE scope_name, aperture_mm
FROM {{p}}i_star_night
WHERE night_id = 'N2'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'Refractor' act = ls_row-scope_name ).
cl_abap_unit_assert=>assert_equals( exp = 150 act = ls_row-aperture_mm ).
ENDMETHOD.
METHOD shows_ids_and_visitors.
SELECT SINGLE dome_id, scope_id, visitors
FROM {{p}}i_star_night
WHERE night_id = 'N2'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'D2' act = ls_row-dome_id ).
cl_abap_unit_assert=>assert_equals( exp = 'S2' act = ls_row-scope_id ).
cl_abap_unit_assert=>assert_equals( exp = 70 act = ls_row-visitors ).
ENDMETHOD.
METHOD shows_night_date.
DATA lv_expected TYPE dats VALUE '20250601'.
SELECT SINGLE night_date
FROM {{p}}i_star_night
WHERE night_id = 'N1'
INTO @DATA(lv_date).
cl_abap_unit_assert=>assert_equals( exp = lv_expected act = lv_date ).
ENDMETHOD.
METHOD free_seats_positive.
SELECT SINGLE free_seats
FROM {{p}}i_star_night
WHERE night_id = 'N1'
INTO @DATA(lv_free).
cl_abap_unit_assert=>assert_equals( exp = 20 act = lv_free ).
ENDMETHOD.
METHOD free_seats_negative.
SELECT SINGLE free_seats
FROM {{p}}i_star_night
WHERE night_id = 'N2'
INTO @DATA(lv_free).
cl_abap_unit_assert=>assert_equals( exp = -10 act = lv_free ).
ENDMETHOD.
METHOD hides_unknown_dome.
SELECT COUNT(*) FROM {{p}}i_star_night
WHERE dome_id = 'D9'
INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD hides_unknown_scope.
SELECT COUNT(*) FROM {{p}}i_star_night
WHERE scope_id = 'S9'
INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD counts_rows.
SELECT COUNT(*) FROM {{p}}i_star_night INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rows ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,63 @@
{
"task": "G1929",
"mutants": [
{
"object": "{{P}}I_STAR_NIGHT",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "killed",
"hidden": "7/9",
"failed_tests": [
"COUNTS_ROWS",
"HIDES_UNKNOWN_DOME"
]
},
{
"object": "{{P}}I_STAR_NIGHT",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "4/9",
"failed_tests": [
"COUNTS_ROWS",
"FREE_SEATS_NEGATIVE",
"FREE_SEATS_POSITIVE",
"HIDES_UNKNOWN_DOME",
"SHOWS_DOME_DATA"
]
},
{
"object": "{{P}}I_STAR_NIGHT",
"mutant": "line 6: inner join -> left outer join (join)",
"status": "killed",
"hidden": "7/9",
"failed_tests": [
"COUNTS_ROWS",
"HIDES_UNKNOWN_SCOPE"
]
},
{
"object": "{{P}}I_STAR_NIGHT",
"mutant": "line 6: = -> <> (eq)",
"status": "killed",
"hidden": "6/9",
"failed_tests": [
"COUNTS_ROWS",
"HIDES_UNKNOWN_SCOPE",
"SHOWS_SCOPE_DATA"
]
},
{
"object": "{{P}}I_STAR_NIGHT",
"mutant": "line 17: - -> + (arith)",
"status": "killed",
"hidden": "7/9",
"failed_tests": [
"FREE_SEATS_NEGATIVE",
"FREE_SEATS_POSITIVE"
]
}
],
"valid": 5,
"killed": 5,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome on dome.dome_id = night.dome_id
inner join {{p}}scope as scope on scope.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,51 @@
CLASS {{p}}t61_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 reads_master_data_once FOR TESTING.
METHODS drops_night_without_dome FOR TESTING.
ENDCLASS.
CLASS {{p}}t61_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STAR_NIGHT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_dome TYPE STANDARD TABLE OF {{p}}dome WITH EMPTY KEY.
DATA lt_scope TYPE STANDARD TABLE OF {{p}}scope WITH EMPTY KEY.
DATA lt_night TYPE STANDARD TABLE OF {{p}}night WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_dome = VALUE #( ( dome_id = 'D1' dome_name = 'Main Dome' city = 'NORTH' capacity = 90 ) ).
lt_scope = VALUE #( ( scope_id = 'S1' scope_name = 'Reflector' aperture_mm = 300 mount_kind = 'EQUATORIAL' ) ).
lt_night = VALUE #( ( night_id = 'A1' dome_id = 'D1' scope_id = 'S1' visitors = 60 night_date = '20250701' )
( night_id = 'A2' dome_id = 'DX' scope_id = 'S1' visitors = 10 night_date = '20250702' ) ).
go_env->insert_test_data( lt_dome ).
go_env->insert_test_data( lt_scope ).
go_env->insert_test_data( lt_night ).
ENDMETHOD.
METHOD reads_master_data_once.
SELECT SINGLE dome_name, dome_city, scope_name, free_seats
FROM {{p}}i_star_night
WHERE night_id = 'A1'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'Main Dome' act = ls_row-dome_name ).
cl_abap_unit_assert=>assert_equals( exp = 'NORTH' act = ls_row-dome_city ).
cl_abap_unit_assert=>assert_equals( exp = 'Reflector' act = ls_row-scope_name ).
cl_abap_unit_assert=>assert_equals( exp = 30 act = ls_row-free_seats ).
ENDMETHOD.
METHOD drops_night_without_dome.
SELECT COUNT(*) FROM {{p}}i_star_night INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rows ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Dome of the observatory'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}dome {
key client : abap.clnt not null;
key dome_id : abap.char(4) not null;
dome_name : abap.char(30);
city : abap.char(20);
capacity : abap.int4;
}

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory (legacy)'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome_a on dome_a.dome_id = night.dome_id
inner join {{p}}dome as dome_b on dome_b.dome_id = night.dome_id
inner join {{p}}scope as scope_a on scope_a.scope_id = night.scope_id
inner join {{p}}scope as scope_b on scope_b.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome_a.dome_name as dome_name,
dome_b.city as dome_city,
night.scope_id as scope_id,
scope_a.scope_name as scope_name,
scope_b.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome_b.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Stargazing night'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}night {
key client : abap.clnt not null;
key night_id : abap.char(10) not null;
dome_id : abap.char(4);
scope_id : abap.char(4);
visitors : abap.int4;
night_date : abap.dats;
}

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Telescope of the observatory'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}scope {
key client : abap.clnt not null;
key scope_id : abap.char(4) not null;
scope_name : abap.char(30);
aperture_mm : abap.int4;
mount_kind : abap.char(10);
}

View File

@@ -0,0 +1,54 @@
# 1. Goal
The view entity {{P}}I_STAR_NIGHT in package $TMP lists the stargazing nights of
a city observatory. Today the view reads the same master table twice. Remove
that repetition. The view keeps its name, its key element and all its element
names. Its result must not change.
# 2. Open questions
None.
# 3. Context
A city observatory opens its domes on clear nights. Each stargazing night takes
place in one dome and uses one telescope.
Tables in package $TMP:
- {{P}}NIGHT - the stargazing nights. Key NIGHT_ID (CHAR 10). Further fields:
DOME_ID (CHAR 4), SCOPE_ID (CHAR 4), VISITORS (INT4), NIGHT_DATE (DATS).
- {{P}}DOME - the domes of the observatory. Key DOME_ID (CHAR 4). Further
fields: DOME_NAME (CHAR 30), CITY (CHAR 20), CAPACITY (INT4).
- {{P}}SCOPE - the telescopes. Key SCOPE_ID (CHAR 4). Further fields:
SCOPE_NAME (CHAR 30), APERTURE_MM (INT4), MOUNT_KIND (CHAR 10).
The view entity {{P}}I_STAR_NIGHT is active and reads the three tables. A report
and an OData service consume it. Take the current source of the view as the
definition of its result. Read the source before you touch it.
# 4. Contract
- The view entity {{P}}I_STAR_NIGHT stays in package $TMP.
- Key element: NIGHT_ID.
- Element names, unchanged: NIGHT_ID, DOME_ID, DOME_NAME, DOME_CITY, SCOPE_ID,
SCOPE_NAME, APERTURE_MM, VISITORS, NIGHT_DATE, FREE_SEATS.
- Authorization check: #NOT_REQUIRED.
# 5. Business rules
1. The row set of the view does not change. A night appears exactly as often as
it appears today, and no night appears that does not appear today.
2. Every element keeps its value. NIGHT_ID, DOME_ID, SCOPE_ID, VISITORS and
NIGHT_DATE come from the night. DOME_NAME and DOME_CITY describe the dome of
the night. SCOPE_NAME and APERTURE_MM describe the telescope of the night.
FREE_SEATS is the capacity of the dome minus the visitors of the night. It
may be negative.
3. The element types and the meaning of the key stay as they are.
# 6. Constraints
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
- Quality goal: no master table is read more than once by the view. A master
table that is needed twice must still be read only once.
- Coding standards: Clean ABAP. The view must activate without a syntax error.
- Out of scope: {{P}}NIGHT, {{P}}DOME, {{P}}SCOPE.
# 7. Acceptance
- {{P}}I_STAR_NIGHT is active and syntax-clean.
- All hidden tests pass.
- Add ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,89 @@
{
"id": "G1929",
"category": "E",
"object_type": "DDLS",
"difficulty": 3,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "TABL",
"name": "{{P}}NIGHT",
"file": "seed/night.tabl.asabap",
"description": "Stargazing nights of the observatory"
},
{
"type": "TABL",
"name": "{{P}}DOME",
"file": "seed/dome.tabl.asabap",
"description": "Domes of the observatory"
},
{
"type": "TABL",
"name": "{{P}}SCOPE",
"file": "seed/scope.tabl.asabap",
"description": "Telescopes of the observatory"
},
{
"type": "DDLS",
"name": "{{P}}I_STAR_NIGHT",
"file": "seed/i_star_night.ddls.asddls",
"description": "Legacy view entity that reads the same master table twice"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_STAR_NIGHT",
"fields": [
"NIGHT_ID",
"DOME_ID",
"DOME_NAME",
"DOME_CITY",
"SCOPE_ID",
"SCOPE_NAME",
"APERTURE_MM",
"VISITORS",
"NIGHT_DATE",
"FREE_SEATS"
]
}
],
"out_of_scope": [
"{{P}}NIGHT",
"{{P}}DOME",
"{{P}}SCOPE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T61_HIDDEN",
"file": "hidden/t61_hidden.clas.abap",
"description": "T61 hidden tests for the refactored view entity"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_STAR_NIGHT",
"file": "reference/i_star_night.ddls.asddls",
"description": "Refactored view entity, every master table read once"
},
{
"type": "CLAS",
"name": "{{P}}T61_TEST",
"file": "reference/t61_test.clas.abap",
"description": "T61 own tests with CL_CDS_TEST_ENVIRONMENT"
}
],
"craft_checks": [
"The view entity {{P}}I_STAR_NIGHT reads {{P}}DOME only once",
"The view entity {{P}}I_STAR_NIGHT reads {{P}}SCOPE only once",
"The view entity {{P}}I_STAR_NIGHT keeps the key element NIGHT_ID and all ten element names",
"The view entity {{P}}I_STAR_NIGHT drops a night whose dome or telescope does not exist"
]
}