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,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Brick size data'
define view entity {{P}}I_BRICK_SIZE
as select from {{p}}brick
{
key brick_id as brick_id,
mould as mould,
substring( mould, 2, 2 ) as mould_family,
cast( cast( length_mm * width_mm * height_mm as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as volume_cm3,
cast( cast( weight_g as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as weight_kg,
case
when weight_g >= 5000 then 'L'
when weight_g >= 2000 then 'M'
else 'S'
end as size_class
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Brick size data'
define view entity {{P}}I_BRICK_SIZE
as select from {{p}}brick
{
key brick_id as brick_id,
mould as mould,
substring( mould, 1, 3 ) as mould_family,
cast( cast( length_mm * width_mm * height_mm as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as volume_cm3,
cast( cast( weight_g as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as weight_kg,
case
when weight_g >= 5000 then 'L'
when weight_g >= 2000 then 'M'
else 'S'
end as size_class
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Brick size data'
define view entity {{P}}I_BRICK_SIZE
as select from {{p}}brick
{
key brick_id as brick_id,
mould as mould,
substring( mould, 1, 2 ) as mould_family,
cast( cast( length_mm * width_mm * height_mm as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as volume_cm3,
cast( cast( weight_g as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as weight_kg,
case
when weight_g < 5000 then 'L'
when weight_g >= 2000 then 'M'
else 'S'
end as size_class
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Brick size data'
define view entity {{P}}I_BRICK_SIZE
as select from {{p}}brick
{
key brick_id as brick_id,
mould as mould,
substring( mould, 1, 2 ) as mould_family,
cast( cast( length_mm * width_mm * height_mm as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as volume_cm3,
cast( cast( weight_g as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as weight_kg,
case
when weight_g >= 5000 then 'Z'
when weight_g >= 2000 then 'M'
else 'S'
end as size_class
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Brick size data'
define view entity {{P}}I_BRICK_SIZE
as select from {{p}}brick
{
key brick_id as brick_id,
mould as mould,
substring( mould, 1, 2 ) as mould_family,
cast( cast( length_mm * width_mm * height_mm as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as volume_cm3,
cast( cast( weight_g as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as weight_kg,
case
when weight_g >= 5000 then 'L'
when weight_g >= 2000 then 'M'
else 'Z'
end as size_class
}

View File

@@ -0,0 +1,19 @@
{
"id": "G1120",
"pool": "train",
"object_type": "DDLS",
"category": "B",
"attempts": [
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 5,
"killed": 5,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,86 @@
CLASS {{p}}t31_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 all_bricks_shown FOR TESTING.
METHODS mould_kept FOR TESTING.
METHODS mould_family FOR TESTING.
METHODS volume_of_brick FOR TESTING.
METHODS weight_in_kg FOR TESTING.
METHODS class_large FOR TESTING.
METHODS class_medium FOR TESTING.
METHODS class_small FOR TESTING.
METHODS class_boundary FOR TESTING.
ENDCLASS.
CLASS {{p}}t31_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BRICK_SIZE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_brick TYPE STANDARD TABLE OF {{p}}brick WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_brick = VALUE #(
( brick_id = 'B1' mould = 'NF01' length_mm = 240 width_mm = 115 height_mm = 71 weight_g = 3200 )
( brick_id = 'B2' mould = 'WF02' length_mm = 300 width_mm = 200 height_mm = 150 weight_g = 8000 )
( brick_id = 'B3' mould = 'NF03' length_mm = 200 width_mm = 100 height_mm = 50 weight_g = 1500 )
( brick_id = 'B4' mould = 'BLK1' length_mm = 250 width_mm = 120 height_mm = 80 weight_g = 5000 ) ).
go_env->insert_test_data( lt_brick ).
ENDMETHOD.
METHOD all_bricks_shown.
SELECT COUNT(*) FROM {{p}}i_brick_size INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_rows ).
ENDMETHOD.
METHOD mould_kept.
SELECT SINGLE mould FROM {{p}}i_brick_size WHERE brick_id = 'B2' INTO @DATA(lv_mould).
cl_abap_unit_assert=>assert_equals( exp = 'WF02' act = lv_mould ).
ENDMETHOD.
METHOD mould_family.
SELECT SINGLE mould_family FROM {{p}}i_brick_size WHERE brick_id = 'B4' INTO @DATA(lv_family).
cl_abap_unit_assert=>assert_equals( exp = 'BL' act = lv_family ).
ENDMETHOD.
METHOD volume_of_brick.
SELECT SINGLE volume_cm3 FROM {{p}}i_brick_size WHERE brick_id = 'B1' INTO @DATA(lv_volume).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1959.6' )
act = CONV decfloat34( lv_volume ) ).
ENDMETHOD.
METHOD weight_in_kg.
SELECT SINGLE weight_kg FROM {{p}}i_brick_size WHERE brick_id = 'B2' INTO @DATA(lv_weight).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '8' )
act = CONV decfloat34( lv_weight ) ).
ENDMETHOD.
METHOD class_large.
SELECT SINGLE size_class FROM {{p}}i_brick_size WHERE brick_id = 'B2' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'L' act = lv_class ).
ENDMETHOD.
METHOD class_medium.
SELECT SINGLE size_class FROM {{p}}i_brick_size WHERE brick_id = 'B1' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'M' act = lv_class ).
ENDMETHOD.
METHOD class_small.
SELECT SINGLE size_class FROM {{p}}i_brick_size WHERE brick_id = 'B3' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'S' act = lv_class ).
ENDMETHOD.
METHOD class_boundary.
SELECT SINGLE size_class FROM {{p}}i_brick_size WHERE brick_id = 'B4' INTO @DATA(lv_class).
cl_abap_unit_assert=>assert_equals( exp = 'L' act = lv_class ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,58 @@
{
"task": "G1120",
"mutants": [
{
"object": "{{P}}I_BRICK_SIZE",
"mutant": "line 8: 1 -> 2 (const)",
"status": "killed",
"hidden": "8/9",
"failed_tests": [
"MOULD_FAMILY"
]
},
{
"object": "{{P}}I_BRICK_SIZE",
"mutant": "line 8: 2 -> 3 (const)",
"status": "killed",
"hidden": "8/9",
"failed_tests": [
"MOULD_FAMILY"
]
},
{
"object": "{{P}}I_BRICK_SIZE",
"mutant": "line 14: >= -> < (rel)",
"status": "killed",
"hidden": "5/9",
"failed_tests": [
"CLASS_BOUNDARY",
"CLASS_LARGE",
"CLASS_MEDIUM",
"CLASS_SMALL"
]
},
{
"object": "{{P}}I_BRICK_SIZE",
"mutant": "line 14: 'L' -> 'Z' (lit)",
"status": "killed",
"hidden": "7/9",
"failed_tests": [
"CLASS_BOUNDARY",
"CLASS_LARGE"
]
},
{
"object": "{{P}}I_BRICK_SIZE",
"mutant": "line 16: 'S' -> 'Z' (lit)",
"status": "killed",
"hidden": "8/9",
"failed_tests": [
"CLASS_SMALL"
]
}
],
"valid": 5,
"killed": 5,
"kill_rate": 1.0,
"ok": true
}

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Brick size data'
define view entity {{P}}I_BRICK_SIZE
as select from {{p}}brick
{
key brick_id as brick_id,
mould as mould,
substring( mould, 1, 2 ) as mould_family,
cast( cast( length_mm * width_mm * height_mm as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as volume_cm3,
cast( cast( weight_g as abap.dec( 15, 3 ) )
/ 1000 as abap.dec( 15, 3 ) ) as weight_kg,
case
when weight_g >= 5000 then 'L'
when weight_g >= 2000 then 'M'
else 'S'
end as size_class
}

View File

@@ -0,0 +1,39 @@
CLASS {{p}}t31_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 size_data_of_one_brick FOR TESTING.
ENDCLASS.
CLASS {{p}}t31_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BRICK_SIZE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_brick TYPE STANDARD TABLE OF {{p}}brick WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_brick = VALUE #( ( brick_id = 'X1' mould = 'NF01' length_mm = 240 width_mm = 115
height_mm = 71 weight_g = 3200 ) ).
go_env->insert_test_data( lt_brick ).
ENDMETHOD.
METHOD size_data_of_one_brick.
SELECT SINGLE mould_family, volume_cm3, weight_kg, size_class FROM {{p}}i_brick_size
WHERE brick_id = 'X1' INTO @DATA(ls_brick).
cl_abap_unit_assert=>assert_equals( exp = 'NF' act = ls_brick-mould_family ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1959.6' )
act = CONV decfloat34( ls_brick-volume_cm3 ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.2' )
act = CONV decfloat34( ls_brick-weight_kg ) ).
cl_abap_unit_assert=>assert_equals( exp = 'M' act = ls_brick-size_class ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,14 @@
@EndUserText.label : 'Brick master data'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}brick {
key client : abap.clnt not null;
key brick_id : abap.char(10) not null;
mould : abap.char(4);
length_mm : abap.int4;
width_mm : abap.int4;
height_mm : abap.int4;
weight_g : abap.int4;
}

View File

@@ -0,0 +1,51 @@
# 1. Goal
A brickworks produces bricks in different moulds. The kiln team needs one row for
each brick with the size data of the brick. A report and an OData service will
read this data. Therefore the calculation must be in the database, in a CDS view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}BRICK (brick master data), package $TMP. Key: BRICK_ID (CHAR 10).
Fields:
- MOULD (CHAR 4): the mould code. A mould code always has 4 characters.
- LENGTH_MM (INT4): the length of the brick in millimetres.
- WIDTH_MM (INT4): the width of the brick in millimetres.
- HEIGHT_MM (INT4): the height of the brick in millimetres.
- WEIGHT_G (INT4): the weight of the brick in grams.
# 4. Contract
- Create the CDS view entity {{P}}I_BRICK_SIZE in package $TMP.
- The view has these elements, with these names:
- BRICK_ID (key)
- MOULD
- MOULD_FAMILY
- VOLUME_CM3
- WEIGHT_KG
- SIZE_CLASS
- Use the authorization check #NOT_REQUIRED.
# 5. Business rules
1. The view shows one row for each row of the table {{P}}BRICK.
2. MOULD is the mould code of the brick.
3. MOULD_FAMILY contains the first two characters of the mould code.
4. VOLUME_CM3 is the volume of the brick in cubic centimetres. Calculate the
volume as LENGTH_MM multiplied by WIDTH_MM multiplied by HEIGHT_MM, divided by
1000. The value has 3 decimals.
5. WEIGHT_KG is the weight of the brick in kilograms. Calculate the weight as
WEIGHT_G divided by 1000. The value has 3 decimals.
6. SIZE_CLASS is the weight class of the brick:
1. The class is 'L' if WEIGHT_G is 5000 or more.
2. The class is 'M' if WEIGHT_G is 2000 or more and less than 5000.
3. The class is 'S' if WEIGHT_G is less than 2000.
# 6. Constraints
- Release target: 8.16.
- Out of scope: do not change the table {{P}}BRICK.
- Use Clean ABAP.
# 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,60 @@
{
"id": "G1120",
"category": "B",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "TABL",
"name": "{{P}}BRICK",
"file": "seed/brick.tabl.asabap",
"description": "Brick master data"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_BRICK_SIZE",
"fields": [
"BRICK_ID",
"MOULD",
"MOULD_FAMILY",
"VOLUME_CM3",
"WEIGHT_KG",
"SIZE_CLASS"
]
}
],
"out_of_scope": [
"{{P}}BRICK"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T31_HIDDEN",
"file": "hidden/t31_hidden.clas.abap",
"description": "T31 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_BRICK_SIZE",
"file": "reference/i_brick_size.ddls.asddls",
"description": "Brick size data"
},
{
"type": "CLAS",
"name": "{{P}}T31_TEST",
"file": "reference/t31_test.clas.abap",
"description": "T31 own tests"
}
],
"craft_checks": []
}