Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
14
tasks_gen/train/G1145/faulty/m0_i_still_output.ddls.asddls
Normal file
14
tasks_gen/train/G1145/faulty/m0_i_still_output.ddls.asddls
Normal file
@@ -0,0 +1,14 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Spirit output per still'
|
||||
define view entity {{P}}I_STILL_OUTPUT
|
||||
as select from {{p}}runlog
|
||||
{
|
||||
key still_id as still_id,
|
||||
count( * ) as runs,
|
||||
max( wash_litre ) as wash_l,
|
||||
sum( spirit_litre ) as spirit_l,
|
||||
count( distinct cask_no ) as casks,
|
||||
max( run_date ) as last_run
|
||||
}
|
||||
where spirit_litre > 0
|
||||
group by still_id
|
||||
14
tasks_gen/train/G1145/faulty/m1_i_still_output.ddls.asddls
Normal file
14
tasks_gen/train/G1145/faulty/m1_i_still_output.ddls.asddls
Normal file
@@ -0,0 +1,14 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Spirit output per still'
|
||||
define view entity {{P}}I_STILL_OUTPUT
|
||||
as select from {{p}}runlog
|
||||
{
|
||||
key still_id as still_id,
|
||||
count( * ) as runs,
|
||||
sum( wash_litre ) as wash_l,
|
||||
max( spirit_litre ) as spirit_l,
|
||||
count( distinct cask_no ) as casks,
|
||||
max( run_date ) as last_run
|
||||
}
|
||||
where spirit_litre > 0
|
||||
group by still_id
|
||||
14
tasks_gen/train/G1145/faulty/m2_i_still_output.ddls.asddls
Normal file
14
tasks_gen/train/G1145/faulty/m2_i_still_output.ddls.asddls
Normal file
@@ -0,0 +1,14 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Spirit output per still'
|
||||
define view entity {{P}}I_STILL_OUTPUT
|
||||
as select from {{p}}runlog
|
||||
{
|
||||
key still_id as still_id,
|
||||
count( * ) as runs,
|
||||
sum( wash_litre ) as wash_l,
|
||||
sum( spirit_litre ) as spirit_l,
|
||||
count( distinct cask_no ) as casks,
|
||||
max( run_date ) as last_run
|
||||
}
|
||||
where spirit_litre <= 0
|
||||
group by still_id
|
||||
28
tasks_gen/train/G1145/generation.json
Normal file
28
tasks_gen/train/G1145/generation.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"id": "G1145",
|
||||
"pool": "train",
|
||||
"object_type": "DDLS",
|
||||
"category": "F",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "bundle",
|
||||
"errors": [
|
||||
"Too close to task G0175 (similarity spec 0.73, rules 0.65, names 0.33). Choose a different business topic and different object names."
|
||||
],
|
||||
"by_check": {
|
||||
"extra": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 3,
|
||||
"killed": 3,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
78
tasks_gen/train/G1145/hidden/t_runlog_hidden.clas.abap
Normal file
78
tasks_gen/train/G1145/hidden/t_runlog_hidden.clas.abap
Normal file
@@ -0,0 +1,78 @@
|
||||
CLASS {{p}}t_runlog_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 runs_of_still FOR TESTING.
|
||||
METHODS wash_volume FOR TESTING.
|
||||
METHODS spirit_volume FOR TESTING.
|
||||
METHODS distinct_casks FOR TESTING.
|
||||
METHODS last_run FOR TESTING.
|
||||
METHODS failed_runs_skipped FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t_runlog_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STILL_OUTPUT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_runlog TYPE STANDARD TABLE OF {{p}}runlog WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_runlog = VALUE #(
|
||||
( run_id = 'R1' still_id = 'STILL-A' run_date = '20240301'
|
||||
wash_litre = '1000.0' spirit_litre = '120.0' strength_pct = '68.50' cask_no = 'C1' )
|
||||
( run_id = 'R2' still_id = 'STILL-A' run_date = '20240315'
|
||||
wash_litre = '1200.0' spirit_litre = '150.0' strength_pct = '70.00' cask_no = 'C2' )
|
||||
( run_id = 'R3' still_id = 'STILL-A' run_date = '20240401'
|
||||
wash_litre = '900.0' spirit_litre = '100.0' strength_pct = '69.00' cask_no = 'C1' )
|
||||
( run_id = 'R4' still_id = 'STILL-B' run_date = '20240210'
|
||||
wash_litre = '800.0' spirit_litre = '0.0' strength_pct = '0.00' cask_no = '' )
|
||||
( run_id = 'R5' still_id = 'STILL-B' run_date = '20240220'
|
||||
wash_litre = '700.0' spirit_litre = '90.0' strength_pct = '65.00' cask_no = 'C3' )
|
||||
( run_id = 'R6' still_id = 'STILL-C' run_date = '20240305'
|
||||
wash_litre = '500.0' spirit_litre = '0.0' strength_pct = '0.00' cask_no = '' ) ).
|
||||
go_env->insert_test_data( lt_runlog ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD runs_of_still.
|
||||
SELECT SINGLE runs FROM {{p}}i_still_output WHERE still_id = 'STILL-A' INTO @DATA(lv_runs).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_runs ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD wash_volume.
|
||||
SELECT SINGLE wash_l FROM {{p}}i_still_output WHERE still_id = 'STILL-A' INTO @DATA(lv_wash).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3100.0' )
|
||||
act = CONV decfloat34( lv_wash ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD spirit_volume.
|
||||
SELECT SINGLE spirit_l FROM {{p}}i_still_output WHERE still_id = 'STILL-A' INTO @DATA(lv_spirit).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '370.0' )
|
||||
act = CONV decfloat34( lv_spirit ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD distinct_casks.
|
||||
SELECT SINGLE casks FROM {{p}}i_still_output WHERE still_id = 'STILL-A' INTO @DATA(lv_casks).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_casks ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD last_run.
|
||||
SELECT SINGLE last_run FROM {{p}}i_still_output WHERE still_id = 'STILL-A' INTO @DATA(lv_last).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV dats( '20240401' ) act = lv_last ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD failed_runs_skipped.
|
||||
SELECT COUNT(*) FROM {{p}}i_still_output INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rows ).
|
||||
SELECT SINGLE runs FROM {{p}}i_still_output WHERE still_id = 'STILL-B' INTO @DATA(lv_runs).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_runs ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
40
tasks_gen/train/G1145/mutation.json
Normal file
40
tasks_gen/train/G1145/mutation.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"task": "G1145",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}I_STILL_OUTPUT",
|
||||
"mutant": "line 8: sum( -> max( (agg)",
|
||||
"status": "killed",
|
||||
"hidden": "5/6",
|
||||
"failed_tests": [
|
||||
"WASH_VOLUME"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_STILL_OUTPUT",
|
||||
"mutant": "line 9: sum( -> max( (agg)",
|
||||
"status": "killed",
|
||||
"hidden": "5/6",
|
||||
"failed_tests": [
|
||||
"SPIRIT_VOLUME"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_STILL_OUTPUT",
|
||||
"mutant": "line 13: > -> <= (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "1/6",
|
||||
"failed_tests": [
|
||||
"DISTINCT_CASKS",
|
||||
"LAST_RUN",
|
||||
"RUNS_OF_STILL",
|
||||
"SPIRIT_VOLUME",
|
||||
"WASH_VOLUME"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 3,
|
||||
"killed": 3,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
14
tasks_gen/train/G1145/reference/i_still_output.ddls.asddls
Normal file
14
tasks_gen/train/G1145/reference/i_still_output.ddls.asddls
Normal file
@@ -0,0 +1,14 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Spirit output per still'
|
||||
define view entity {{P}}I_STILL_OUTPUT
|
||||
as select from {{p}}runlog
|
||||
{
|
||||
key still_id as still_id,
|
||||
count( * ) as runs,
|
||||
sum( wash_litre ) as wash_l,
|
||||
sum( spirit_litre ) as spirit_l,
|
||||
count( distinct cask_no ) as casks,
|
||||
max( run_date ) as last_run
|
||||
}
|
||||
where spirit_litre > 0
|
||||
group by still_id
|
||||
43
tasks_gen/train/G1145/reference/runlog_out_test.clas.abap
Normal file
43
tasks_gen/train/G1145/reference/runlog_out_test.clas.abap
Normal file
@@ -0,0 +1,43 @@
|
||||
CLASS {{p}}runlog_out_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 output_of_one_still FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}runlog_out_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STILL_OUTPUT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_runlog TYPE STANDARD TABLE OF {{p}}runlog WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_runlog = VALUE #(
|
||||
( run_id = 'X1' still_id = 'STILL-X' run_date = '20240501'
|
||||
wash_litre = '400.0' spirit_litre = '50.0' strength_pct = '66.00' cask_no = 'K1' )
|
||||
( run_id = 'X2' still_id = 'STILL-X' run_date = '20240520'
|
||||
wash_litre = '600.0' spirit_litre = '80.0' strength_pct = '67.00' cask_no = 'K1' ) ).
|
||||
go_env->insert_test_data( lt_runlog ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD output_of_one_still.
|
||||
SELECT SINGLE runs, wash_l, spirit_l, casks, last_run
|
||||
FROM {{p}}i_still_output WHERE still_id = 'STILL-X' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-runs ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1000.0' )
|
||||
act = CONV decfloat34( ls_row-wash_l ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '130.0' )
|
||||
act = CONV decfloat34( ls_row-spirit_l ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-casks ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV dats( '20240520' ) act = ls_row-last_run ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
15
tasks_gen/train/G1145/seed/runlog.tabl.asabap
Normal file
15
tasks_gen/train/G1145/seed/runlog.tabl.asabap
Normal file
@@ -0,0 +1,15 @@
|
||||
@EndUserText.label : 'Distillation run'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}runlog {
|
||||
key client : abap.clnt not null;
|
||||
key run_id : abap.char(10) not null;
|
||||
still_id : abap.char(10);
|
||||
run_date : abap.dats;
|
||||
wash_litre : abap.dec(13,1);
|
||||
spirit_litre : abap.dec(13,1);
|
||||
strength_pct : abap.dec(5,2);
|
||||
cask_no : abap.char(10);
|
||||
}
|
||||
30
tasks_gen/train/G1145/seed/seed_runlog.clas.abap
Normal file
30
tasks_gen/train/G1145/seed/seed_runlog.clas.abap
Normal file
@@ -0,0 +1,30 @@
|
||||
CLASS {{p}}seed_runlog DEFINITION
|
||||
PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_runlog IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DATA lt_runlog TYPE STANDARD TABLE OF {{p}}runlog WITH EMPTY KEY.
|
||||
lt_runlog = VALUE #(
|
||||
( run_id = 'R1' still_id = 'STILL-A' run_date = '20240301'
|
||||
wash_litre = '1000.0' spirit_litre = '120.0' strength_pct = '68.50' cask_no = 'C1' )
|
||||
( run_id = 'R2' still_id = 'STILL-A' run_date = '20240315'
|
||||
wash_litre = '1200.0' spirit_litre = '150.0' strength_pct = '70.00' cask_no = 'C2' )
|
||||
( run_id = 'R3' still_id = 'STILL-A' run_date = '20240401'
|
||||
wash_litre = '900.0' spirit_litre = '100.0' strength_pct = '69.00' cask_no = 'C1' )
|
||||
( run_id = 'R4' still_id = 'STILL-B' run_date = '20240210'
|
||||
wash_litre = '800.0' spirit_litre = '0.0' strength_pct = '0.00' cask_no = '' )
|
||||
( run_id = 'R5' still_id = 'STILL-B' run_date = '20240220'
|
||||
wash_litre = '700.0' spirit_litre = '90.0' strength_pct = '65.00' cask_no = 'C3' )
|
||||
( run_id = 'R6' still_id = 'STILL-C' run_date = '20240305'
|
||||
wash_litre = '500.0' spirit_litre = '0.0' strength_pct = '0.00' cask_no = '' ) ).
|
||||
DELETE FROM {{p}}runlog.
|
||||
INSERT {{p}}runlog FROM TABLE @lt_runlog.
|
||||
out->write( |Runs: { lines( lt_runlog ) }| ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
42
tasks_gen/train/G1145/spec.md
Normal file
42
tasks_gen/train/G1145/spec.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# 1. Goal
|
||||
Show the spirit output of each still of a whisky distillery. A report and an
|
||||
OData service read the output, so the calculation must be in the database, in a
|
||||
CDS view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}RUNLOG is in package $TMP. The table is active and contains data.
|
||||
Read the definition of the table in the system. The table has one row for each
|
||||
distillation run. Its columns contain the still, the run date, the volume of
|
||||
the wash in litres, the volume of the spirit in litres, the strength of the
|
||||
spirit in percent, and the number of the cask that the run filled. The table
|
||||
has more columns that you do not need.
|
||||
- Do not change the table.
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_STILL_OUTPUT in package $TMP.
|
||||
- The view has these elements, with these names: STILL_ID (key), RUNS, WASH_L,
|
||||
SPIRIT_L, CASKS, LAST_RUN.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. The view has one row for each still that has at least one counted run.
|
||||
2. A run with a spirit volume of zero or less is a failed run. Do not count a
|
||||
failed run. A still that has only failed runs has no row in the view.
|
||||
3. RUNS is the number of counted runs of the still.
|
||||
4. WASH_L is the sum of the wash volumes of the counted runs, in litres.
|
||||
5. SPIRIT_L is the sum of the spirit volumes of the counted runs, in litres.
|
||||
6. CASKS is the number of different casks that the counted runs filled.
|
||||
7. LAST_RUN is the latest run date of the counted runs.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: SAP_BASIS 8.16 (ABAP Platform 2025).
|
||||
- Coding standards: Clean ABAP. Keep methods below 40 statements.
|
||||
- Out of scope: do not change {{P}}RUNLOG.
|
||||
|
||||
# 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.
|
||||
67
tasks_gen/train/G1145/task.json
Normal file
67
tasks_gen/train/G1145/task.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"id": "G1145",
|
||||
"category": "F",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}RUNLOG",
|
||||
"file": "seed/runlog.tabl.asabap",
|
||||
"description": "Distillation run of a distillery"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_RUNLOG",
|
||||
"file": "seed/seed_runlog.clas.abap",
|
||||
"run": true,
|
||||
"description": "Seed data for {{P}}RUNLOG"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_STILL_OUTPUT",
|
||||
"fields": [
|
||||
"STILL_ID",
|
||||
"RUNS",
|
||||
"WASH_L",
|
||||
"SPIRIT_L",
|
||||
"CASKS",
|
||||
"LAST_RUN"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}RUNLOG"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T_RUNLOG_HIDDEN",
|
||||
"file": "hidden/t_runlog_hidden.clas.abap",
|
||||
"description": "T16 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_STILL_OUTPUT",
|
||||
"file": "reference/i_still_output.ddls.asddls",
|
||||
"description": "Spirit output per still"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}RUNLOG_OUT_TEST",
|
||||
"file": "reference/runlog_out_test.clas.abap",
|
||||
"description": "T16 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user