Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
Kral
2026-10-03 12:10:52 +02:00
parent d3250acfb8
commit 39769afce8
741 changed files with 40573 additions and 317 deletions

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Energy of one park'
define view entity {{P}}I_PARK_POWER
with parameters
p_park : abap.char(4)
as select from {{p}}turbine as turbine
left outer join {{p}}prod as prod on prod.turbine_id = turbine.turbine_id
{
key turbine.turbine_id as turbine_id,
turbine.park_id as park_id,
sum( prod.energy_kwh ) as total_kwh,
count( * ) as day_count
}
where turbine.park_id = $parameters.p_park
group by turbine.turbine_id, turbine.park_id

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Energy of one park'
define view entity {{P}}I_PARK_POWER
with parameters
p_park : abap.char(4)
as select from {{p}}turbine as turbine
inner join {{p}}prod as prod on prod.turbine_id <> turbine.turbine_id
{
key turbine.turbine_id as turbine_id,
turbine.park_id as park_id,
sum( prod.energy_kwh ) as total_kwh,
count( * ) as day_count
}
where turbine.park_id = $parameters.p_park
group by turbine.turbine_id, turbine.park_id

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Energy of one park'
define view entity {{P}}I_PARK_POWER
with parameters
p_park : abap.char(4)
as select from {{p}}turbine as turbine
inner join {{p}}prod as prod on prod.turbine_id = turbine.turbine_id
{
key turbine.turbine_id as turbine_id,
turbine.park_id as park_id,
max( prod.energy_kwh ) as total_kwh,
count( * ) as day_count
}
where turbine.park_id = $parameters.p_park
group by turbine.turbine_id, turbine.park_id

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Energy of one park'
define view entity {{P}}I_PARK_POWER
with parameters
p_park : abap.char(4)
as select from {{p}}turbine as turbine
inner join {{p}}prod as prod on prod.turbine_id = turbine.turbine_id
{
key turbine.turbine_id as turbine_id,
turbine.park_id as park_id,
sum( prod.energy_kwh ) as total_kwh,
count( * ) as day_count
}
where turbine.park_id <> $parameters.p_park
group by turbine.turbine_id, turbine.park_id

View File

@@ -0,0 +1,24 @@
{
"id": "G0147",
"pool": "eval",
"object_type": "DDLS",
"category": "E",
"attempts": [
{
"stage": "validate",
"oracle": 0,
"null": 0
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 4,
"killed": 4,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,101 @@
CLASS {{p}}t20_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 park_p01_turbines FOR TESTING.
METHODS park_p02_turbines FOR TESTING.
METHODS unknown_park_empty FOR TESTING.
METHODS total_kwh_sum FOR TESTING.
METHODS day_count_rows FOR TESTING.
METHODS turbine_without_prod FOR TESTING.
METHODS park_id_is_param FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_PARK_POWER' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_turbine TYPE STANDARD TABLE OF {{p}}turbine WITH EMPTY KEY.
DATA lt_prod TYPE STANDARD TABLE OF {{p}}prod WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_turbine = VALUE #( ( turbine_id = 'T1' park_id = 'P01' capacity_kw = 2000 )
( turbine_id = 'T2' park_id = 'P01' capacity_kw = 1500 )
( turbine_id = 'T3' park_id = 'P02' capacity_kw = 3000 )
( turbine_id = 'T4' park_id = 'P03' capacity_kw = 800 )
( turbine_id = 'T5' park_id = 'P01' capacity_kw = 500 ) ).
lt_prod = VALUE #( ( turbine_id = 'T1' prod_date = '20240101' energy_kwh = '100.50' )
( turbine_id = 'T1' prod_date = '20240102' energy_kwh = '200.25' )
( turbine_id = 'T2' prod_date = '20240101' energy_kwh = '50.00' )
( turbine_id = 'T3' prod_date = '20240101' energy_kwh = '500.00' )
( turbine_id = 'T3' prod_date = '20240102' energy_kwh = '300.00' )
( turbine_id = 'T4' prod_date = '20240101' energy_kwh = '10.00' ) ).
go_env->insert_test_data( lt_turbine ).
go_env->insert_test_data( lt_prod ).
ENDMETHOD.
METHOD park_p01_turbines.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P01'.
SELECT COUNT(*) FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
ENDMETHOD.
METHOD park_p02_turbines.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P02'.
SELECT COUNT(*) FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count ).
SELECT SINGLE turbine_id FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_turbine).
cl_abap_unit_assert=>assert_equals( exp = 'T3' act = lv_turbine ).
ENDMETHOD.
METHOD unknown_park_empty.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P99'.
SELECT COUNT(*) FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD total_kwh_sum.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P01'.
SELECT SINGLE total_kwh FROM {{p}}i_park_power( p_park = @lv_park )
WHERE turbine_id = 'T1' INTO @DATA(lv_total).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '300.75' )
act = CONV decfloat34( lv_total ) ).
ENDMETHOD.
METHOD day_count_rows.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P01'.
SELECT SINGLE day_count FROM {{p}}i_park_power( p_park = @lv_park )
WHERE turbine_id = 'T1' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
ENDMETHOD.
METHOD turbine_without_prod.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P01'.
SELECT COUNT(*) FROM {{p}}i_park_power( p_park = @lv_park )
WHERE turbine_id = 'T5' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD park_id_is_param.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P02'.
SELECT SINGLE park_id FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_park_id).
cl_abap_unit_assert=>assert_equals( exp = 'P02' act = lv_park_id ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,53 @@
{
"task": "G0147",
"mutants": [
{
"object": "{{P}}I_PARK_POWER",
"mutant": "line 7: inner join -> left outer join (join)",
"status": "killed",
"hidden": "5/7",
"failed_tests": [
"PARK_P01_TURBINES",
"TURBINE_WITHOUT_PROD"
]
},
{
"object": "{{P}}I_PARK_POWER",
"mutant": "line 7: = -> <> (eq)",
"status": "killed",
"hidden": "3/7",
"failed_tests": [
"DAY_COUNT_ROWS",
"PARK_P01_TURBINES",
"TOTAL_KWH_SUM",
"TURBINE_WITHOUT_PROD"
]
},
{
"object": "{{P}}I_PARK_POWER",
"mutant": "line 11: sum( -> max( (agg)",
"status": "killed",
"hidden": "6/7",
"failed_tests": [
"TOTAL_KWH_SUM"
]
},
{
"object": "{{P}}I_PARK_POWER",
"mutant": "line 14: = -> <> (eq)",
"status": "killed",
"hidden": "2/7",
"failed_tests": [
"DAY_COUNT_ROWS",
"PARK_ID_IS_PARAM",
"PARK_P02_TURBINES",
"TOTAL_KWH_SUM",
"UNKNOWN_PARK_EMPTY"
]
}
],
"valid": 4,
"killed": 4,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,15 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Energy of one park'
define view entity {{P}}I_PARK_POWER
with parameters
p_park : abap.char(4)
as select from {{p}}turbine as turbine
inner join {{p}}prod as prod on prod.turbine_id = turbine.turbine_id
{
key turbine.turbine_id as turbine_id,
turbine.park_id as park_id,
sum( prod.energy_kwh ) as total_kwh,
count( * ) as day_count
}
where turbine.park_id = $parameters.p_park
group by turbine.turbine_id, turbine.park_id

View File

@@ -0,0 +1,52 @@
CLASS {{p}}t20_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 filter_by_park FOR TESTING.
METHODS sum_and_count FOR TESTING.
ENDCLASS.
CLASS {{p}}t20_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_PARK_POWER' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_turbine TYPE STANDARD TABLE OF {{p}}turbine WITH EMPTY KEY.
DATA lt_prod TYPE STANDARD TABLE OF {{p}}prod WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_turbine = VALUE #( ( turbine_id = 'A1' park_id = 'P01' capacity_kw = 1000 )
( turbine_id = 'A2' park_id = 'P02' capacity_kw = 1000 ) ).
lt_prod = VALUE #( ( turbine_id = 'A1' prod_date = '20240301' energy_kwh = '10.00' )
( turbine_id = 'A1' prod_date = '20240302' energy_kwh = '20.00' )
( turbine_id = 'A2' prod_date = '20240301' energy_kwh = '99.00' ) ).
go_env->insert_test_data( lt_turbine ).
go_env->insert_test_data( lt_prod ).
ENDMETHOD.
METHOD filter_by_park.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P01'.
SELECT COUNT(*) FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count ).
ENDMETHOD.
METHOD sum_and_count.
DATA lv_park TYPE {{p}}turbine-park_id.
lv_park = 'P01'.
SELECT SINGLE total_kwh FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_total).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '30.00' )
act = CONV decfloat34( lv_total ) ).
SELECT SINGLE day_count FROM {{p}}i_park_power( p_park = @lv_park ) INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,13 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Energy of one park'
define view entity {{P}}I_PARK_POWER
as select from {{p}}turbine as turbine
inner join {{p}}prod as prod on prod.turbine_id = turbine.turbine_id
{
key turbine.turbine_id as turbine_id,
turbine.park_id as park_id,
sum( prod.energy_kwh ) as total_kwh,
count( * ) as day_count
}
where turbine.park_id = 'P01'
group by turbine.turbine_id, turbine.park_id

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Daily energy production'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}prod {
key client : abap.clnt not null;
key turbine_id : abap.char(10) not null;
key prod_date : abap.dats not null;
energy_kwh : abap.dec(15,2);
}

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Wind turbine'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}turbine {
key client : abap.clnt not null;
key turbine_id : abap.char(10) not null;
park_id : abap.char(4);
capacity_kw : abap.int4;
}

View File

@@ -0,0 +1,42 @@
# 1. Goal
The CDS view entity {{P}}I_PARK_POWER in package $TMP shows the energy production
of the turbines of one wind park. The park code is a literal in the view. A
reporting tool must call the view for different parks. Refactor the view in
place. Replace the literal with an input parameter. The behavior stays the same.
# 2. Open questions
None.
# 3. Context
- The view entity {{P}}I_PARK_POWER is in package $TMP. The view is active.
- The view reads the tables {{P}}TURBINE and {{P}}PROD.
- The view contains a hardcoded park code. Read the source of the view.
- The tables and their content are correct. Do not change them.
# 4. Contract
- Refactor the CDS view entity {{P}}I_PARK_POWER in package $TMP. The name does
not change.
- Elements, with these names: TURBINE_ID (key), PARK_ID, TOTAL_KWH, DAY_COUNT.
- The view has the input parameter P_PARK. Type: abap.char(4). The parameter has
no default value.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The behavior of the view stays the same. The legacy view defines the behavior.
Read the legacy source.
2. The caller gives the park code in the parameter P_PARK. The view does not
contain a literal park code.
3. For the park code of the legacy view, the view returns the same rows and the
same values as before the refactoring.
4. The element names, the element order and the element types do not change.
# 6. Constraints
- Release target: 8.16.
- Package: $TMP. Do not use transports.
- Out of scope: do not change {{P}}TURBINE and {{P}}PROD.
- Coding standard: Clean ABAP. No ATC priority 1 and no ATC priority 2 findings.
# 7. Acceptance
- The view {{P}}I_PARK_POWER 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,71 @@
{
"id": "G0147",
"category": "E",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "TABL",
"name": "{{P}}TURBINE",
"file": "seed/turbine.tabl.asabap",
"description": "Wind turbine"
},
{
"type": "TABL",
"name": "{{P}}PROD",
"file": "seed/prod.tabl.asabap",
"description": "Daily energy production of a turbine"
},
{
"type": "DDLS",
"name": "{{P}}I_PARK_POWER",
"file": "seed/i_park_power.ddls.asddls",
"description": "Legacy view with a hardcoded park code"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_PARK_POWER",
"fields": [
"TURBINE_ID",
"PARK_ID",
"TOTAL_KWH",
"DAY_COUNT"
]
}
],
"out_of_scope": [
"{{P}}TURBINE",
"{{P}}PROD"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T20_HIDDEN",
"file": "hidden/t20_hidden.clas.abap",
"description": "T20 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_PARK_POWER",
"file": "reference/i_park_power.ddls.asddls",
"description": "Refactored view with the input parameter P_PARK"
},
{
"type": "CLAS",
"name": "{{P}}T20_TEST",
"file": "reference/t20_test.clas.abap",
"description": "T20 own tests"
}
],
"craft_checks": []
}