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,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Rental totals'
define view entity {{P}}I_RENTAL_TOTAL
as select from {{p}}rental as r
left outer join {{p}}charge as c on c.rental_id = r.rental_id
{
key r.rental_id as rental_id,
r.customer as customer,
count( * ) as charge_count,
sum( c.amount ) as total_amount
}
group by
r.rental_id,
r.customer

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Rental totals'
define view entity {{P}}I_RENTAL_TOTAL
as select from {{p}}rental as r
inner join {{p}}charge as c on c.rental_id <> r.rental_id
{
key r.rental_id as rental_id,
r.customer as customer,
count( * ) as charge_count,
sum( c.amount ) as total_amount
}
group by
r.rental_id,
r.customer

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Rental totals'
define view entity {{P}}I_RENTAL_TOTAL
as select from {{p}}rental as r
inner join {{p}}charge as c on c.rental_id = r.rental_id
{
key r.rental_id as rental_id,
r.customer as customer,
count( * ) as charge_count,
max( c.amount ) as total_amount
}
group by
r.rental_id,
r.customer

View File

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

View File

@@ -0,0 +1,80 @@
CLASS {{p}}t_rental_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 per_rental_totals FOR TESTING.
METHODS charge_counts FOR TESTING.
METHODS rental_without_charges FOR TESTING.
METHODS customer_shown FOR TESTING.
METHODS decimals FOR TESTING.
METHODS two_customers FOR TESTING.
ENDCLASS.
CLASS {{p}}t_rental_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_RENTAL_TOTAL' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_rental TYPE STANDARD TABLE OF {{p}}rental WITH EMPTY KEY.
DATA lt_charge TYPE STANDARD TABLE OF {{p}}charge WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_rental = VALUE #( ( rental_id = 'R1' customer = 'C1' pickup_date = '20240101' )
( rental_id = 'R2' customer = 'C1' pickup_date = '20240102' )
( rental_id = 'R3' customer = 'C2' pickup_date = '20240103' )
( rental_id = 'R4' customer = 'C2' pickup_date = '20240104' )
( rental_id = 'R5' customer = 'C3' pickup_date = '20240105' ) ).
lt_charge = VALUE #( ( rental_id = 'R1' charge_no = 1 customer = 'C1' charge_type = 'FUEL' amount = '50.00' )
( rental_id = 'R1' charge_no = 2 customer = 'C1' charge_type = 'TOLL' amount = '10.00' )
( rental_id = 'R2' charge_no = 1 customer = 'C1' charge_type = 'FUEL' amount = '30.00' )
( rental_id = 'R4' charge_no = 1 customer = 'C2' charge_type = 'FUEL' amount = '20.00' )
( rental_id = 'R5' charge_no = 1 customer = 'C3' charge_type = 'FUEL' amount = '5.50' )
( rental_id = 'R5' charge_no = 2 customer = 'C3' charge_type = 'TOLL' amount = '4.50' ) ).
go_env->insert_test_data( lt_rental ).
go_env->insert_test_data( lt_charge ).
ENDMETHOD.
METHOD per_rental_totals.
SELECT SINGLE total_amount FROM {{p}}i_rental_total WHERE rental_id = 'R1' INTO @DATA(lv_total).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '60.00' ) act = CONV decfloat34( lv_total ) ).
SELECT SINGLE total_amount FROM {{p}}i_rental_total WHERE rental_id = 'R2' INTO @DATA(lv_total2).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '30.00' ) act = CONV decfloat34( lv_total2 ) ).
ENDMETHOD.
METHOD charge_counts.
SELECT SINGLE charge_count FROM {{p}}i_rental_total WHERE rental_id = 'R1' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
SELECT SINGLE charge_count FROM {{p}}i_rental_total WHERE rental_id = 'R2' INTO @DATA(lv_count2).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_count2 ).
ENDMETHOD.
METHOD rental_without_charges.
SELECT COUNT(*) FROM {{p}}i_rental_total WHERE rental_id = 'R3' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD customer_shown.
SELECT SINGLE customer FROM {{p}}i_rental_total WHERE rental_id = 'R1' INTO @DATA(lv_customer).
cl_abap_unit_assert=>assert_equals( exp = 'C1' act = lv_customer ).
ENDMETHOD.
METHOD decimals.
SELECT SINGLE total_amount FROM {{p}}i_rental_total WHERE rental_id = 'R5' INTO @DATA(lv_total).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' ) act = CONV decfloat34( lv_total ) ).
ENDMETHOD.
METHOD two_customers.
SELECT SINGLE total_amount FROM {{p}}i_rental_total WHERE rental_id = 'R4' INTO @DATA(lv_total4).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' ) act = CONV decfloat34( lv_total4 ) ).
SELECT SINGLE total_amount FROM {{p}}i_rental_total WHERE rental_id = 'R5' INTO @DATA(lv_total5).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' ) act = CONV decfloat34( lv_total5 ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,42 @@
{
"task": "G0165",
"mutants": [
{
"object": "{{P}}I_RENTAL_TOTAL",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "killed",
"hidden": "5/6",
"failed_tests": [
"RENTAL_WITHOUT_CHARGES"
]
},
{
"object": "{{P}}I_RENTAL_TOTAL",
"mutant": "line 5: = -> <> (eq)",
"status": "killed",
"hidden": "1/6",
"failed_tests": [
"CHARGE_COUNTS",
"DECIMALS",
"PER_RENTAL_TOTALS",
"RENTAL_WITHOUT_CHARGES",
"TWO_CUSTOMERS"
]
},
{
"object": "{{P}}I_RENTAL_TOTAL",
"mutant": "line 10: sum( -> max( (agg)",
"status": "killed",
"hidden": "3/6",
"failed_tests": [
"DECIMALS",
"PER_RENTAL_TOTALS",
"TWO_CUSTOMERS"
]
}
],
"valid": 3,
"killed": 3,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Rental totals'
define view entity {{P}}I_RENTAL_TOTAL
as select from {{p}}rental as r
inner join {{p}}charge as c on c.rental_id = r.rental_id
{
key r.rental_id as rental_id,
r.customer as customer,
count( * ) as charge_count,
sum( c.amount ) as total_amount
}
group by
r.rental_id,
r.customer

View File

@@ -0,0 +1,39 @@
CLASS {{p}}t_rental_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 total_of_one_rental FOR TESTING.
ENDCLASS.
CLASS {{p}}t_rental_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_RENTAL_TOTAL' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD total_of_one_rental.
DATA lt_rental TYPE STANDARD TABLE OF {{p}}rental WITH EMPTY KEY.
DATA lt_charge TYPE STANDARD TABLE OF {{p}}charge WITH EMPTY KEY.
lt_rental = VALUE #( ( rental_id = 'A1' customer = 'K1' pickup_date = '20240101' ) ).
lt_charge = VALUE #( ( rental_id = 'A1' charge_no = 1 customer = 'K1' charge_type = 'FUEL' amount = '12.00' )
( rental_id = 'A1' charge_no = 2 customer = 'K1' charge_type = 'TOLL' amount = '3.00' ) ).
go_env->insert_test_data( lt_rental ).
go_env->insert_test_data( lt_charge ).
SELECT SINGLE charge_count, total_amount FROM {{p}}i_rental_total WHERE rental_id = 'A1'
INTO @DATA(ls_total).
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_total-charge_count ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '15.00' )
act = CONV decfloat34( ls_total-total_amount ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Rental charge'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}charge {
key client : abap.clnt not null;
key rental_id : abap.char(10) not null;
key charge_no : abap.int4 not null;
customer : abap.char(10);
charge_type : abap.char(4);
amount : abap.dec(15,2);
}

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Rental totals'
define view entity {{P}}I_RENTAL_TOTAL
as select from {{p}}rental as r
inner join {{p}}charge as c on c.customer = r.customer
{
key r.rental_id as rental_id,
r.customer as customer,
count( * ) as charge_count,
sum( c.amount ) as total_amount
}
group by
r.rental_id,
r.customer

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Rental header'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}rental {
key client : abap.clnt not null;
key rental_id : abap.char(10) not null;
customer : abap.char(10);
pickup_date : abap.dats;
}

View File

@@ -0,0 +1,33 @@
# 1. Goal
The CDS view entity {{P}}I_RENTAL_TOTAL in package $TMP shows the charges of each rental. Users report that the view gives wrong totals and wrong counts when a customer has more than one rental. Fix the view in place. All other behavior stays the same.
# 2. Open questions
None.
# 3. Context
- Table {{P}}RENTAL (rental header), package $TMP. Key: RENTAL_ID (CHAR 10). Fields: CUSTOMER (CHAR 10), PICKUP_DATE (DATS).
- Table {{P}}CHARGE (rental charge), package $TMP. Key: RENTAL_ID (CHAR 10), CHARGE_NO (INT4). Fields: CUSTOMER (CHAR 10), CHARGE_TYPE (CHAR 4), AMOUNT (DEC 15,2).
- The CDS view entity {{P}}I_RENTAL_TOTAL already exists in package $TMP. It is faulty.
# 4. Contract
- Fix the CDS view entity {{P}}I_RENTAL_TOTAL in package $TMP.
- Elements, with these names: RENTAL_ID (key), CUSTOMER, CHARGE_COUNT, TOTAL_AMOUNT.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. Show one row for each rental that has at least one charge. Do not show a rental without charges.
2. CHARGE_COUNT is the number of charges of the rental.
3. TOTAL_AMOUNT is the sum of AMOUNT of all charges of the rental, with 2 decimals.
4. CUSTOMER is the customer of the rental.
5. All other behavior of the view stays the same.
# 6. Constraints
- Release target: 8.16.
- Coding standards: Clean ABAP.
- Out of scope: do not change {{P}}RENTAL and {{P}}CHARGE.
- Use "define view entity".
# 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,71 @@
{
"id": "G0165",
"category": "I",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 40,
"max_activations": 10
},
"seed": [
{
"type": "TABL",
"name": "{{P}}RENTAL",
"file": "seed/rental.tabl.asabap",
"description": "Rental header"
},
{
"type": "TABL",
"name": "{{P}}CHARGE",
"file": "seed/charge.tabl.asabap",
"description": "Rental charge"
},
{
"type": "DDLS",
"name": "{{P}}I_RENTAL_TOTAL",
"file": "seed/i_rental_total.ddls.asddls",
"description": "Faulty rental totals view"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_RENTAL_TOTAL",
"fields": [
"RENTAL_ID",
"CUSTOMER",
"CHARGE_COUNT",
"TOTAL_AMOUNT"
]
}
],
"out_of_scope": [
"{{P}}RENTAL",
"{{P}}CHARGE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T_RENTAL_HIDDEN",
"file": "hidden/t_rental_hidden.clas.abap",
"description": "Hidden tests for the rental totals view"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_RENTAL_TOTAL",
"file": "reference/i_rental_total.ddls.asddls",
"description": "Fixed rental totals view"
},
{
"type": "CLAS",
"name": "{{P}}T_RENTAL_TEST",
"file": "reference/t_rental_test.clas.abap",
"description": "Own tests for the rental totals view"
}
],
"craft_checks": []
}