Hard batch G0022-G0026: 5/5 accepted; budget floor, CDS checks, mutation check

- generator: budget floor (2x oracle activations, 3x calls), static checks for CDS
  $parameters and UNION annotation
- harness/mutation.py: deterministic mutants of the reference; hidden tests must fail
- G0022 revalidated with harness fixes: oracle 100, null 0
- results in docs/faz1-tasarim.md 11f

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-03 05:16:30 +02:00
parent 3570d7ef9b
commit 32f03fcad4
53 changed files with 2931 additions and 14 deletions

View File

@@ -0,0 +1,19 @@
{
"id": "G0025",
"pool": "eval",
"object_type": "DDLS",
"category": "B",
"attempts": [
{
"stage": "validate",
"oracle": 0,
"null": 0
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0
}
],
"accepted": true
}

View File

@@ -0,0 +1,88 @@
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 source_a_rows FOR TESTING.
METHODS source_b_rows FOR TESTING.
METHODS all_partners FOR TESTING.
METHODS same_id_twice FOR TESTING.
METHODS name_and_city FOR TESTING.
METHODS only_in_a FOR TESTING.
METHODS only_in_b FOR TESTING.
ENDCLASS.
CLASS {{p}}t16_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_PARTNER_ALL' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_a TYPE STANDARD TABLE OF {{p}}part_a WITH EMPTY KEY.
DATA lt_b TYPE STANDARD TABLE OF {{p}}part_b WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_a = VALUE #( ( partner_id = 'P1' name = 'Alpha GmbH' city = 'Berlin' )
( partner_id = 'P2' name = 'Beta AG' city = 'Hamburg' ) ).
lt_b = VALUE #( ( partner_id = 'P2' name = 'Beta AG' city = 'Hamburg' )
( partner_id = 'P3' name = 'Gamma KG' city = 'Munich' ) ).
go_env->insert_test_data( lt_a ).
go_env->insert_test_data( lt_b ).
ENDMETHOD.
METHOD source_a_rows.
SELECT partner_id, source FROM {{p}}i_partner_all
WHERE source = 'A' ORDER BY partner_id INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_rows ) ).
cl_abap_unit_assert=>assert_equals( exp = 'P1' act = lt_rows[ 1 ]-partner_id ).
cl_abap_unit_assert=>assert_equals( exp = 'P2' act = lt_rows[ 2 ]-partner_id ).
ENDMETHOD.
METHOD source_b_rows.
SELECT partner_id, source FROM {{p}}i_partner_all
WHERE source = 'B' ORDER BY partner_id INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_rows ) ).
cl_abap_unit_assert=>assert_equals( exp = 'P2' act = lt_rows[ 1 ]-partner_id ).
cl_abap_unit_assert=>assert_equals( exp = 'P3' act = lt_rows[ 2 ]-partner_id ).
ENDMETHOD.
METHOD all_partners.
SELECT COUNT(*) FROM {{p}}i_partner_all INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_count ).
ENDMETHOD.
METHOD same_id_twice.
SELECT source FROM {{p}}i_partner_all
WHERE partner_id = 'P2' ORDER BY source INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_rows ) ).
cl_abap_unit_assert=>assert_equals( exp = 'A' act = lt_rows[ 1 ]-source ).
cl_abap_unit_assert=>assert_equals( exp = 'B' act = lt_rows[ 2 ]-source ).
ENDMETHOD.
METHOD name_and_city.
SELECT SINGLE name, city FROM {{p}}i_partner_all
WHERE partner_id = 'P3' AND source = 'B' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'Gamma KG' act = ls_row-name ).
cl_abap_unit_assert=>assert_equals( exp = 'Munich' act = ls_row-city ).
ENDMETHOD.
METHOD only_in_a.
SELECT source FROM {{p}}i_partner_all
WHERE partner_id = 'P1' INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( lt_rows ) ).
cl_abap_unit_assert=>assert_equals( exp = 'A' act = lt_rows[ 1 ]-source ).
ENDMETHOD.
METHOD only_in_b.
SELECT source FROM {{p}}i_partner_all
WHERE partner_id = 'P3' INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( lt_rows ) ).
cl_abap_unit_assert=>assert_equals( exp = 'B' act = lt_rows[ 1 ]-source ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,19 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'All partners'
@Metadata.ignorePropagatedAnnotations: true
define view entity {{P}}I_PARTNER_ALL
as select from {{p}}part_a as a
{
key a.partner_id as partner_id,
a.name as name,
a.city as city,
cast('A' as abap.char(1)) as source
}
union all
select from {{p}}part_b as b
{
key b.partner_id as partner_id,
b.name as name,
b.city as city,
cast('B' as abap.char(1)) as source
}

View File

@@ -0,0 +1,45 @@
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 same_partner_twice FOR TESTING.
ENDCLASS.
CLASS {{p}}t16_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_PARTNER_ALL' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_a TYPE STANDARD TABLE OF {{p}}part_a WITH EMPTY KEY.
DATA lt_b TYPE STANDARD TABLE OF {{p}}part_b WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_a = VALUE #( ( partner_id = 'A1' name = 'One' city = 'Bonn' ) ).
lt_b = VALUE #( ( partner_id = 'A1' name = 'One' city = 'Bonn' )
( partner_id = 'B1' name = 'Two' city = 'Kiel' ) ).
go_env->insert_test_data( lt_a ).
go_env->insert_test_data( lt_b ).
ENDMETHOD.
METHOD both_sources.
SELECT source FROM {{p}}i_partner_all ORDER BY source INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lines( lt_rows ) ).
ENDMETHOD.
METHOD same_partner_twice.
SELECT source FROM {{p}}i_partner_all
WHERE partner_id = 'A1' ORDER BY source INTO TABLE @DATA(lt_rows).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_rows ) ).
cl_abap_unit_assert=>assert_equals( exp = 'A' act = lt_rows[ 1 ]-source ).
cl_abap_unit_assert=>assert_equals( exp = 'B' act = lt_rows[ 2 ]-source ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Partner list A'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}part_a {
key client : abap.clnt not null;
key partner_id : abap.char(10) not null;
name : abap.char(40);
city : abap.char(40);
}

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Partner list B'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}part_b {
key client : abap.clnt not null;
key partner_id : abap.char(10) not null;
name : abap.char(40);
city : abap.char(40);
}

View File

@@ -0,0 +1,24 @@
CLASS {{p}}seed_partner DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS {{p}}seed_partner IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DATA lt_a TYPE STANDARD TABLE OF {{p}}part_a WITH EMPTY KEY.
DATA lt_b TYPE STANDARD TABLE OF {{p}}part_b WITH EMPTY KEY.
lt_a = VALUE #( ( client = sy-mandt partner_id = 'P1' name = 'Alpha GmbH' city = 'Berlin' )
( client = sy-mandt partner_id = 'P2' name = 'Beta AG' city = 'Hamburg' ) ).
lt_b = VALUE #( ( client = sy-mandt partner_id = 'P2' name = 'Beta AG' city = 'Hamburg' )
( client = sy-mandt partner_id = 'P3' name = 'Gamma KG' city = 'Munich' ) ).
MODIFY {{p}}part_a FROM TABLE @lt_a.
MODIFY {{p}}part_b FROM TABLE @lt_b.
out->write( 'Partner seed data written.' ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,37 @@
# 1. Goal
Two tables hold partner lists. A report and an OData service must read one
single list of all partners. Each row must show from which table it comes.
# 2. Open questions
None.
# 3. Context
- Table {{P}}PART_A (partner list A), package $TMP. Key: PARTNER_ID (CHAR 10).
Fields: NAME (CHAR 40), CITY (CHAR 40).
- Table {{P}}PART_B (partner list B), package $TMP. It has the same structure.
- A partner ID can be in both tables.
# 4. Contract
- Create the CDS view entity {{P}}I_PARTNER_ALL in package $TMP.
- Elements, with these names: PARTNER_ID (key), NAME, CITY, SOURCE.
- SOURCE is one character.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The view shows every partner of {{P}}PART_A and every partner of
{{P}}PART_B. No partner is missing.
2. SOURCE is 'A' for a row from {{P}}PART_A. SOURCE is 'B' for a row from
{{P}}PART_B.
3. NAME and CITY are the values of the table that the row comes from.
4. If the same PARTNER_ID is in both tables, the view shows two rows for this
partner. One row has SOURCE 'A'. The other row has SOURCE 'B'.
5. A partner that is only in one table is shown one time.
# 6. Constraints
- Release target: 8.16.
- Out of scope: do not change {{P}}PART_A, {{P}}PART_B and {{P}}SEED_PARTNER.
# 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,73 @@
{
"id": "G0025",
"category": "B",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 40,
"max_activations": 10
},
"seed": [
{
"type": "TABL",
"name": "{{P}}PART_A",
"file": "seed/part_a.tabl.asabap",
"description": "Partner list A"
},
{
"type": "TABL",
"name": "{{P}}PART_B",
"file": "seed/part_b.tabl.asabap",
"description": "Partner list B"
},
{
"type": "CLAS",
"name": "{{P}}SEED_PARTNER",
"file": "seed/seed_partner.clas.abap",
"description": "Fills both partner tables",
"run": true
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_PARTNER_ALL",
"fields": [
"PARTNER_ID",
"NAME",
"CITY",
"SOURCE"
]
}
],
"out_of_scope": [
"{{P}}PART_A",
"{{P}}PART_B",
"{{P}}SEED_PARTNER"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T16_HIDDEN",
"file": "hidden/t16_hidden.clas.abap",
"description": "T16 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_PARTNER_ALL",
"file": "reference/i_partner_all.ddls.asddls",
"description": "All partners of both lists with a source element"
},
{
"type": "CLAS",
"name": "{{P}}T16_TEST",
"file": "reference/t16_test.clas.abap",
"description": "T16 own tests"
}
],
"craft_checks": []
}