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:
12
tasks_gen/eval/G0154/faulty/m0_i_site_cost.ddls.asddls
Normal file
12
tasks_gen/eval/G0154/faulty/m0_i_site_cost.ddls.asddls
Normal file
@@ -0,0 +1,12 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Cleaning cost per site'
|
||||
define view entity {{P}}I_SITE_COST
|
||||
as select from {{p}}cln_job
|
||||
{
|
||||
key site_id as site_id,
|
||||
count( * ) as job_count,
|
||||
max( duration ) as total_hours,
|
||||
sum( cast( duration * hour_rate as abap.dec( 15, 2 ) ) ) as total_cost
|
||||
}
|
||||
where job_status <> 'C'
|
||||
group by site_id
|
||||
12
tasks_gen/eval/G0154/faulty/m1_i_site_cost.ddls.asddls
Normal file
12
tasks_gen/eval/G0154/faulty/m1_i_site_cost.ddls.asddls
Normal file
@@ -0,0 +1,12 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Cleaning cost per site'
|
||||
define view entity {{P}}I_SITE_COST
|
||||
as select from {{p}}cln_job
|
||||
{
|
||||
key site_id as site_id,
|
||||
count( * ) as job_count,
|
||||
sum( duration ) as total_hours,
|
||||
max( cast( duration * hour_rate as abap.dec( 15, 2 ) ) ) as total_cost
|
||||
}
|
||||
where job_status <> 'C'
|
||||
group by site_id
|
||||
12
tasks_gen/eval/G0154/faulty/m2_i_site_cost.ddls.asddls
Normal file
12
tasks_gen/eval/G0154/faulty/m2_i_site_cost.ddls.asddls
Normal file
@@ -0,0 +1,12 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Cleaning cost per site'
|
||||
define view entity {{P}}I_SITE_COST
|
||||
as select from {{p}}cln_job
|
||||
{
|
||||
key site_id as site_id,
|
||||
count( * ) as job_count,
|
||||
sum( duration ) as total_hours,
|
||||
sum( cast( duration * hour_rate as abap.dec( 15, 2 ) ) ) as total_cost
|
||||
}
|
||||
where job_status = 'C'
|
||||
group by site_id
|
||||
12
tasks_gen/eval/G0154/faulty/m3_i_site_cost.ddls.asddls
Normal file
12
tasks_gen/eval/G0154/faulty/m3_i_site_cost.ddls.asddls
Normal file
@@ -0,0 +1,12 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Cleaning cost per site'
|
||||
define view entity {{P}}I_SITE_COST
|
||||
as select from {{p}}cln_job
|
||||
{
|
||||
key site_id as site_id,
|
||||
count( * ) as job_count,
|
||||
sum( duration ) as total_hours,
|
||||
sum( cast( duration * hour_rate as abap.dec( 15, 2 ) ) ) as total_cost
|
||||
}
|
||||
where job_status <> 'Z'
|
||||
group by site_id
|
||||
29
tasks_gen/eval/G0154/generation.json
Normal file
29
tasks_gen/eval/G0154/generation.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"id": "G0154",
|
||||
"pool": "eval",
|
||||
"object_type": "DDLS",
|
||||
"category": "F",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 4,
|
||||
"killed": 4,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
68
tasks_gen/eval/G0154/hidden/t31_hidden.clas.abap
Normal file
68
tasks_gen/eval/G0154/hidden/t31_hidden.clas.abap
Normal file
@@ -0,0 +1,68 @@
|
||||
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 job_counts FOR TESTING.
|
||||
METHODS total_hours FOR TESTING.
|
||||
METHODS totals FOR TESTING.
|
||||
METHODS cancelled_excluded FOR TESTING.
|
||||
METHODS only_cancelled_site FOR TESTING.
|
||||
METHODS decimals FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t31_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SITE_COST' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_job TYPE STANDARD TABLE OF {{p}}cln_job WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_job = VALUE #(
|
||||
( job_id = 'J1' site_id = 'S1' duration = '10.00' hour_rate = '5.00' job_status = 'D' )
|
||||
( job_id = 'J2' site_id = 'S1' duration = '4.00' hour_rate = '5.00' job_status = 'D' )
|
||||
( job_id = 'J3' site_id = 'S2' duration = '2.00' hour_rate = '10.00' job_status = 'C' )
|
||||
( job_id = 'J4' site_id = 'S3' duration = '1.00' hour_rate = '100.00' job_status = 'D' )
|
||||
( job_id = 'J5' site_id = 'S3' duration = '3.00' hour_rate = '100.00' job_status = 'C' )
|
||||
( job_id = 'J6' site_id = 'S4' duration = '2.50' hour_rate = '1.50' job_status = 'O' ) ).
|
||||
go_env->insert_test_data( lt_job ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD job_counts.
|
||||
SELECT SINGLE job_count FROM {{p}}i_site_cost WHERE site_id = 'S1' INTO @DATA(lv_count).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD total_hours.
|
||||
SELECT SINGLE total_hours FROM {{p}}i_site_cost WHERE site_id = 'S1' INTO @DATA(lv_hours).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '14.00' ) act = CONV decfloat34( lv_hours ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD totals.
|
||||
SELECT SINGLE total_cost FROM {{p}}i_site_cost WHERE site_id = 'S1' INTO @DATA(lv_cost).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '70.00' ) act = CONV decfloat34( lv_cost ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD cancelled_excluded.
|
||||
SELECT SINGLE total_cost FROM {{p}}i_site_cost WHERE site_id = 'S3' INTO @DATA(lv_cost).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '100.00' ) act = CONV decfloat34( lv_cost ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD only_cancelled_site.
|
||||
SELECT COUNT(*) FROM {{p}}i_site_cost INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD decimals.
|
||||
SELECT SINGLE total_cost FROM {{p}}i_site_cost WHERE site_id = 'S4' INTO @DATA(lv_cost).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.75' ) act = CONV decfloat34( lv_cost ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
51
tasks_gen/eval/G0154/mutation.json
Normal file
51
tasks_gen/eval/G0154/mutation.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"task": "G0154",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}I_SITE_COST",
|
||||
"mutant": "line 8: sum( -> max( (agg)",
|
||||
"status": "killed",
|
||||
"hidden": "5/6",
|
||||
"failed_tests": [
|
||||
"TOTAL_HOURS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SITE_COST",
|
||||
"mutant": "line 9: sum( -> max( (agg)",
|
||||
"status": "killed",
|
||||
"hidden": "5/6",
|
||||
"failed_tests": [
|
||||
"TOTALS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SITE_COST",
|
||||
"mutant": "line 11: <> -> = (rel)",
|
||||
"status": "killed",
|
||||
"hidden": "0/6",
|
||||
"failed_tests": [
|
||||
"CANCELLED_EXCLUDED",
|
||||
"DECIMALS",
|
||||
"JOB_COUNTS",
|
||||
"ONLY_CANCELLED_SITE",
|
||||
"TOTALS",
|
||||
"TOTAL_HOURS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}I_SITE_COST",
|
||||
"mutant": "line 11: 'C' -> 'Z' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "4/6",
|
||||
"failed_tests": [
|
||||
"CANCELLED_EXCLUDED",
|
||||
"ONLY_CANCELLED_SITE"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 4,
|
||||
"killed": 4,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
12
tasks_gen/eval/G0154/reference/i_site_cost.ddls.asddls
Normal file
12
tasks_gen/eval/G0154/reference/i_site_cost.ddls.asddls
Normal file
@@ -0,0 +1,12 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Cleaning cost per site'
|
||||
define view entity {{P}}I_SITE_COST
|
||||
as select from {{p}}cln_job
|
||||
{
|
||||
key site_id as site_id,
|
||||
count( * ) as job_count,
|
||||
sum( duration ) as total_hours,
|
||||
sum( cast( duration * hour_rate as abap.dec( 15, 2 ) ) ) as total_cost
|
||||
}
|
||||
where job_status <> 'C'
|
||||
group by site_id
|
||||
38
tasks_gen/eval/G0154/reference/t31_test.clas.abap
Normal file
38
tasks_gen/eval/G0154/reference/t31_test.clas.abap
Normal file
@@ -0,0 +1,38 @@
|
||||
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 site_total FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t31_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SITE_COST' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
go_env->clear_doubles( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD site_total.
|
||||
DATA lt_job TYPE STANDARD TABLE OF {{p}}cln_job WITH EMPTY KEY.
|
||||
lt_job = VALUE #(
|
||||
( job_id = 'A' site_id = 'X1' duration = '2.00' hour_rate = '3.00' job_status = 'D' )
|
||||
( job_id = 'B' site_id = 'X1' duration = '1.00' hour_rate = '4.00' job_status = 'D' )
|
||||
( job_id = 'C' site_id = 'X1' duration = '5.00' hour_rate = '9.00' job_status = 'C' ) ).
|
||||
go_env->insert_test_data( lt_job ).
|
||||
SELECT SINGLE job_count, total_hours, total_cost FROM {{p}}i_site_cost WHERE site_id = 'X1'
|
||||
INTO @DATA(ls_site).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_site-job_count ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.00' ) act = CONV decfloat34( ls_site-total_hours ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' ) act = CONV decfloat34( ls_site-total_cost ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
13
tasks_gen/eval/G0154/seed/cln_job.tabl.asabap
Normal file
13
tasks_gen/eval/G0154/seed/cln_job.tabl.asabap
Normal file
@@ -0,0 +1,13 @@
|
||||
@EndUserText.label : 'Cleaning job'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}cln_job {
|
||||
key client : abap.clnt not null;
|
||||
key job_id : abap.char(10) not null;
|
||||
site_id : abap.char(10);
|
||||
duration : abap.dec(5,2);
|
||||
hour_rate : abap.dec(15,2);
|
||||
job_status : abap.char(1);
|
||||
}
|
||||
11
tasks_gen/eval/G0154/seed/i_job_cost.ddls.asddls
Normal file
11
tasks_gen/eval/G0154/seed/i_job_cost.ddls.asddls
Normal file
@@ -0,0 +1,11 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Cost of each cleaning job'
|
||||
define view entity {{P}}I_JOB_COST
|
||||
as select from {{p}}cln_job
|
||||
{
|
||||
key job_id as job_id,
|
||||
site_id as site_id,
|
||||
duration as work_hours,
|
||||
cast( duration * hour_rate as abap.dec(15,2) ) as job_cost
|
||||
}
|
||||
where job_status <> 'C'
|
||||
40
tasks_gen/eval/G0154/spec.md
Normal file
40
tasks_gen/eval/G0154/spec.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# 1. Goal
|
||||
A cleaning company bills its customers for cleaning jobs. Each job belongs to a
|
||||
site. Show the total cost and the total work hours of each site. A report will
|
||||
read the figures, so the calculation must be in the database, in a CDS view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}CLN_JOB, package $TMP. One row for each cleaning job of a site.
|
||||
- View entity {{P}}I_JOB_COST, package $TMP. One row for each cleaning job that
|
||||
counts for billing. The view shows the work hours and the cost of each job.
|
||||
Read {{P}}I_JOB_COST to learn which jobs count for billing and how the cost
|
||||
of a job is calculated.
|
||||
- A job counts for billing if {{P}}I_JOB_COST shows it.
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_SITE_COST in package $TMP.
|
||||
- The view must be defined on the table {{P}}CLN_JOB. {{P}}I_JOB_COST must not
|
||||
be used as a data source of the new view.
|
||||
- Elements, with these names: SITE_ID (key), JOB_COUNT, TOTAL_HOURS, TOTAL_COST.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. Show one row for each site that has at least one job that counts for
|
||||
billing. Do not show a site without such a job.
|
||||
2. JOB_COUNT is the number of jobs of the site that count for billing.
|
||||
3. TOTAL_HOURS is the sum of the work hours of these jobs.
|
||||
4. TOTAL_COST is the sum of the cost of these jobs, with 2 decimals.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Out of scope: do not change {{P}}CLN_JOB and {{P}}I_JOB_COST.
|
||||
- Do not use SAP application module data.
|
||||
|
||||
# 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.
|
||||
Create the test environment for the CDS entity {{P}}I_SITE_COST.
|
||||
65
tasks_gen/eval/G0154/task.json
Normal file
65
tasks_gen/eval/G0154/task.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"id": "G0154",
|
||||
"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}}CLN_JOB",
|
||||
"file": "seed/cln_job.tabl.asabap",
|
||||
"description": "Cleaning job"
|
||||
},
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_JOB_COST",
|
||||
"file": "seed/i_job_cost.ddls.asddls",
|
||||
"description": "Cost of each cleaning job"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SITE_COST",
|
||||
"fields": [
|
||||
"SITE_ID",
|
||||
"JOB_COUNT",
|
||||
"TOTAL_HOURS",
|
||||
"TOTAL_COST"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}CLN_JOB",
|
||||
"{{P}}I_JOB_COST"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T31_HIDDEN",
|
||||
"file": "hidden/t31_hidden.clas.abap",
|
||||
"description": "T31 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SITE_COST",
|
||||
"file": "reference/i_site_cost.ddls.asddls",
|
||||
"description": "Cleaning cost per site"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T31_TEST",
|
||||
"file": "reference/t31_test.clas.abap",
|
||||
"description": "T31 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user