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,21 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Melt output'
define view entity {{P}}I_MELT_OUT
as select from {{p}}casting as part
inner join {{p}}melt as head
on part.furnace_id <> head.furnace_id
and part.melt_date = head.melt_date
and part.melt_no = head.melt_no
{
key head.furnace_id as furnace_id,
key head.melt_date as melt_date,
key head.melt_no as melt_no,
head.alloy as alloy,
count( * ) as pieces,
sum( part.weight ) as net_weight
}
group by
head.furnace_id,
head.melt_date,
head.melt_no,
head.alloy

View File

@@ -0,0 +1,21 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Melt output'
define view entity {{P}}I_MELT_OUT
as select from {{p}}casting as part
inner join {{p}}melt as head
on part.furnace_id = head.furnace_id
or part.melt_date = head.melt_date
and part.melt_no = head.melt_no
{
key head.furnace_id as furnace_id,
key head.melt_date as melt_date,
key head.melt_no as melt_no,
head.alloy as alloy,
count( * ) as pieces,
sum( part.weight ) as net_weight
}
group by
head.furnace_id,
head.melt_date,
head.melt_no,
head.alloy

View File

@@ -0,0 +1,21 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Melt output'
define view entity {{P}}I_MELT_OUT
as select from {{p}}casting as part
inner join {{p}}melt as head
on part.furnace_id = head.furnace_id
and part.melt_date <> head.melt_date
and part.melt_no = head.melt_no
{
key head.furnace_id as furnace_id,
key head.melt_date as melt_date,
key head.melt_no as melt_no,
head.alloy as alloy,
count( * ) as pieces,
sum( part.weight ) as net_weight
}
group by
head.furnace_id,
head.melt_date,
head.melt_no,
head.alloy

View File

@@ -0,0 +1,21 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Melt output'
define view entity {{P}}I_MELT_OUT
as select from {{p}}casting as part
inner join {{p}}melt as head
on part.furnace_id = head.furnace_id
and part.melt_date = head.melt_date
and part.melt_no = head.melt_no
{
key head.furnace_id as furnace_id,
key head.melt_date as melt_date,
key head.melt_no as melt_no,
head.alloy as alloy,
count( * ) as pieces,
max( part.weight ) as net_weight
}
group by
head.furnace_id,
head.melt_date,
head.melt_no,
head.alloy

View File

@@ -0,0 +1,29 @@
{
"id": "G1051",
"pool": "train",
"object_type": "DDLS",
"category": "I",
"attempts": [
{
"stage": "bundle",
"errors": [
"Too close to task T15 (similarity spec 0.84, rules 0.79, names 0.00). Choose a different business topic and different object names.",
"Too close to task T15 (similarity spec 0.84, rules 0.79, 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": 4,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,115 @@
CLASS {{p}}melt_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 melt_f1_1010 FOR TESTING.
METHODS melt_f2_1010 FOR TESTING.
METHODS melt_f1_1011 FOR TESTING.
METHODS melt_f2_0002 FOR TESTING.
METHODS melt_f2_0009 FOR TESTING.
METHODS empty_melt_absent FOR TESTING.
METHODS row_count FOR TESTING.
METHODS alloy_kept FOR TESTING.
ENDCLASS.
CLASS {{p}}melt_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_MELT_OUT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_melt TYPE STANDARD TABLE OF {{p}}melt WITH EMPTY KEY.
DATA lt_cast TYPE STANDARD TABLE OF {{p}}casting WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_melt = VALUE #(
( furnace_id = 'F1' melt_date = '20240110' melt_no = '0001' alloy = 'GJL' crew = 'A' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0001' alloy = 'GJS' crew = 'B' )
( furnace_id = 'F1' melt_date = '20240111' melt_no = '0001' alloy = 'GJL' crew = 'A' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0002' alloy = 'GJS' crew = 'B' )
( furnace_id = 'F1' melt_date = '20240112' melt_no = '0009' alloy = 'GJL' crew = 'C' )
( furnace_id = 'F2' melt_date = '20240115' melt_no = '0009' alloy = 'GJS' crew = 'D' ) ).
lt_cast = VALUE #(
( furnace_id = 'F1' melt_date = '20240110' melt_no = '0001' part_no = 1 part_name = 'WHEEL' weight = '12.50' )
( furnace_id = 'F1' melt_date = '20240110' melt_no = '0001' part_no = 2 part_name = 'HUB' weight = '7.50' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0001' part_no = 1 part_name = 'GEAR' weight = '20.00' )
( furnace_id = 'F1' melt_date = '20240111' melt_no = '0001' part_no = 1 part_name = 'WHEEL' weight = '12.50' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0002' part_no = 1 part_name = 'GEAR' weight = '20.00' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0002' part_no = 2 part_name = 'HUB' weight = '7.45' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0002' part_no = 3 part_name = 'SHAFT' weight = '5.05' )
( furnace_id = 'F2' melt_date = '20240115' melt_no = '0009' part_no = 1 part_name = 'GEAR' weight = '20.00' ) ).
go_env->insert_test_data( lt_melt ).
go_env->insert_test_data( lt_cast ).
ENDMETHOD.
METHOD melt_f1_1010.
SELECT SINGLE pieces, net_weight FROM {{p}}i_melt_out
WHERE furnace_id = 'F1' AND melt_date = '20240110' AND melt_no = '0001'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-pieces ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' )
act = CONV decfloat34( ls_row-net_weight ) ).
ENDMETHOD.
METHOD melt_f2_1010.
SELECT SINGLE pieces, net_weight FROM {{p}}i_melt_out
WHERE furnace_id = 'F2' AND melt_date = '20240110' AND melt_no = '0001'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-pieces ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' )
act = CONV decfloat34( ls_row-net_weight ) ).
ENDMETHOD.
METHOD melt_f1_1011.
SELECT SINGLE pieces, net_weight FROM {{p}}i_melt_out
WHERE furnace_id = 'F1' AND melt_date = '20240111' AND melt_no = '0001'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-pieces ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '12.50' )
act = CONV decfloat34( ls_row-net_weight ) ).
ENDMETHOD.
METHOD melt_f2_0002.
SELECT SINGLE pieces, net_weight FROM {{p}}i_melt_out
WHERE furnace_id = 'F2' AND melt_date = '20240110' AND melt_no = '0002'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 3 act = ls_row-pieces ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '32.50' )
act = CONV decfloat34( ls_row-net_weight ) ).
ENDMETHOD.
METHOD melt_f2_0009.
SELECT SINGLE pieces, net_weight FROM {{p}}i_melt_out
WHERE furnace_id = 'F2' AND melt_date = '20240115' AND melt_no = '0009'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-pieces ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' )
act = CONV decfloat34( ls_row-net_weight ) ).
ENDMETHOD.
METHOD empty_melt_absent.
SELECT COUNT(*) FROM {{p}}i_melt_out
WHERE furnace_id = 'F1' AND melt_date = '20240112' AND melt_no = '0009'
INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
METHOD row_count.
SELECT COUNT(*) FROM {{p}}i_melt_out INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 5 act = lv_rows ).
ENDMETHOD.
METHOD alloy_kept.
SELECT SINGLE alloy FROM {{p}}i_melt_out
WHERE furnace_id = 'F2' AND melt_date = '20240110' AND melt_no = '0001'
INTO @DATA(lv_alloy).
cl_abap_unit_assert=>assert_equals( exp = 'GJS' act = lv_alloy ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,70 @@
{
"task": "G1051",
"mutants": [
{
"object": "{{P}}I_MELT_OUT",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "survived",
"hidden": "8/8",
"failed_tests": []
},
{
"object": "{{P}}I_MELT_OUT",
"mutant": "line 6: = -> <> (eq)",
"status": "killed",
"hidden": "2/8",
"failed_tests": [
"MELT_F1_1010",
"MELT_F1_1011",
"MELT_F2_0002",
"MELT_F2_0009",
"MELT_F2_1010",
"ROW_COUNT"
]
},
{
"object": "{{P}}I_MELT_OUT",
"mutant": "line 7: and -> or (logic)",
"status": "killed",
"hidden": "1/8",
"failed_tests": [
"EMPTY_MELT_ABSENT",
"MELT_F1_1010",
"MELT_F1_1011",
"MELT_F2_0002",
"MELT_F2_0009",
"MELT_F2_1010",
"ROW_COUNT"
]
},
{
"object": "{{P}}I_MELT_OUT",
"mutant": "line 7: = -> <> (eq)",
"status": "killed",
"hidden": "1/8",
"failed_tests": [
"ALLOY_KEPT",
"MELT_F1_1010",
"MELT_F1_1011",
"MELT_F2_0002",
"MELT_F2_0009",
"MELT_F2_1010",
"ROW_COUNT"
]
},
{
"object": "{{P}}I_MELT_OUT",
"mutant": "line 15: sum( -> max( (agg)",
"status": "killed",
"hidden": "6/8",
"failed_tests": [
"MELT_F1_1010",
"MELT_F2_0002"
]
}
],
"valid": 5,
"killed": 4,
"kill_rate": 0.8,
"ok": true
}

View File

@@ -0,0 +1,21 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Melt output'
define view entity {{P}}I_MELT_OUT
as select from {{p}}casting as part
inner join {{p}}melt as head
on part.furnace_id = head.furnace_id
and part.melt_date = head.melt_date
and part.melt_no = head.melt_no
{
key head.furnace_id as furnace_id,
key head.melt_date as melt_date,
key head.melt_no as melt_no,
head.alloy as alloy,
count( * ) as pieces,
sum( part.weight ) as net_weight
}
group by
head.furnace_id,
head.melt_date,
head.melt_no,
head.alloy

View File

@@ -0,0 +1,53 @@
CLASS {{p}}melt_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 same_no_other_furnace FOR TESTING.
METHODS melt_without_castings FOR TESTING.
ENDCLASS.
CLASS {{p}}melt_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_MELT_OUT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD same_no_other_furnace.
DATA lt_melt TYPE STANDARD TABLE OF {{p}}melt WITH EMPTY KEY.
DATA lt_cast TYPE STANDARD TABLE OF {{p}}casting WITH EMPTY KEY.
lt_melt = VALUE #(
( furnace_id = 'F1' melt_date = '20240110' melt_no = '0001' alloy = 'GJL' crew = 'A' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0001' alloy = 'GJS' crew = 'B' ) ).
lt_cast = VALUE #(
( furnace_id = 'F1' melt_date = '20240110' melt_no = '0001' part_no = 1 part_name = 'WHEEL' weight = '12.50' )
( furnace_id = 'F2' melt_date = '20240110' melt_no = '0001' part_no = 1 part_name = 'GEAR' weight = '20.00' ) ).
go_env->insert_test_data( lt_melt ).
go_env->insert_test_data( lt_cast ).
SELECT SINGLE pieces, net_weight FROM {{p}}i_melt_out
WHERE furnace_id = 'F1' AND melt_date = '20240110' AND melt_no = '0001'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-pieces ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '12.50' )
act = CONV decfloat34( ls_row-net_weight ) ).
ENDMETHOD.
METHOD melt_without_castings.
DATA lt_melt TYPE STANDARD TABLE OF {{p}}melt WITH EMPTY KEY.
lt_melt = VALUE #(
( furnace_id = 'F1' melt_date = '20240112' melt_no = '0009' alloy = 'GJL' crew = 'C' ) ).
go_env->insert_test_data( lt_melt ).
SELECT COUNT(*) FROM {{p}}i_melt_out INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,14 @@
@EndUserText.label : 'Foundry casting'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}casting {
key client : abap.clnt not null;
key furnace_id : abap.char(4) not null;
key melt_date : abap.dats not null;
key melt_no : abap.numc(4) not null;
key part_no : abap.int4 not null;
part_name : abap.char(10);
weight : abap.dec(15,2);
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Melt output'
define view entity {{P}}I_MELT_OUT
as select from {{p}}casting as part
inner join {{p}}melt as head on part.melt_no = head.melt_no
{
key head.furnace_id as furnace_id,
key head.melt_date as melt_date,
key head.melt_no as melt_no,
head.alloy as alloy,
count( * ) as pieces,
sum( part.weight ) as net_weight
}
group by
head.furnace_id,
head.melt_date,
head.melt_no,
head.alloy

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Foundry melt'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}melt {
key client : abap.clnt not null;
key furnace_id : abap.char(4) not null;
key melt_date : abap.dats not null;
key melt_no : abap.numc(4) not null;
alloy : abap.char(10);
crew : abap.char(10);
}

View File

@@ -0,0 +1,51 @@
# 1. Goal
Fix the CDS view entity {{P}}I_MELT_OUT in package $TMP. The view reports the
output of the casting melts of a foundry. The production team says that the
figures in the view are wrong for many melts.
# 2. Open questions
None.
# 3. Context
- Table {{P}}MELT (melt header), package $TMP. Key: FURNACE_ID (CHAR 4),
MELT_DATE (DATS), MELT_NO (NUMC 4). Fields: ALLOY (CHAR 10), CREW (CHAR 10).
- Table {{P}}CASTING (casting), package $TMP. Key: FURNACE_ID (CHAR 4),
MELT_DATE (DATS), MELT_NO (NUMC 4), PART_NO (INT4). Fields: PART_NAME
(CHAR 10), WEIGHT (DEC 15,2, the weight of one casting in kilograms).
- A melt number is not unique in the foundry. The same melt number occurs in
other furnaces and on other dates.
- The CDS view entity {{P}}I_MELT_OUT already exists in package $TMP.
The production team reports these symptoms:
- The pieces and the net weight of a melt are too high when the melt number of
the melt also occurs in another furnace or on another date.
- The view shows melts that have no castings.
# 4. Contract
- Fix the CDS view entity {{P}}I_MELT_OUT in package $TMP. The name stays the
same.
- Elements, with these names: FURNACE_ID (key), MELT_DATE (key), MELT_NO (key),
ALLOY, PIECES, NET_WEIGHT.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The view shows one row for each melt that has castings. A melt without
castings must not appear in the view.
2. PIECES is the number of castings of the melt.
3. NET_WEIGHT is the sum of the weights of the castings of the melt, in
kilograms with 2 decimals.
4. A casting belongs to the melt of its own furnace, its own date and its own
melt number. Castings of another furnace, of another date or of another melt
number must not contribute to the figures of a melt.
5. All other behavior of the view stays the same.
# 6. Constraints
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
- Coding standard: Clean ABAP.
- Out of scope: do not change {{P}}MELT and {{P}}CASTING. Do not change the
element names or the data types of the view.
# 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": "G1051",
"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}}MELT",
"file": "seed/melt.tabl.asabap",
"description": "Foundry melt header"
},
{
"type": "TABL",
"name": "{{P}}CASTING",
"file": "seed/casting.tabl.asabap",
"description": "Foundry casting"
},
{
"type": "DDLS",
"name": "{{P}}I_MELT_OUT",
"file": "seed/i_melt_out.ddls.asddls",
"description": "Melt output view (faulty)"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_MELT_OUT",
"fields": [
"FURNACE_ID",
"MELT_DATE",
"MELT_NO",
"ALLOY",
"PIECES",
"NET_WEIGHT"
]
}
],
"out_of_scope": [
"{{P}}MELT",
"{{P}}CASTING"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}MELT_HIDDEN",
"file": "hidden/melt_hidden.clas.abap",
"description": "Hidden tests for the melt output view"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_MELT_OUT",
"file": "reference/i_melt_out.ddls.asddls",
"description": "Fixed melt output view"
},
{
"type": "CLAS",
"name": "{{P}}MELT_TEST",
"file": "reference/melt_test.clas.abap",
"description": "Own tests for the melt output view"
}
],
"craft_checks": []
}