Snapshot: new training tasks (balanced generation), docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 22:08:59 +02:00
parent eb13453097
commit 6984fc7917
572 changed files with 30024 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Open forge jobs'
define view entity {{P}}I_FORGE_JOB
as select from {{p}}forgjob as job
inner join {{p}}forgart as art on art.article_id = job.article_id
inner join {{p}}forgcus as cus on cus.customer_id <> art.customer_id
{
key job.job_id as job_id,
job.job_date as job_date,
art.article_name as article_name,
art.weight_kg as weight_kg,
cus.customer_name as customer_name,
cus.city as city,
job.work_min as work_min,
case when job.work_min > 120
then 'HEAVY'
else 'LIGHT'
end as effort
}
where job.job_state = 'O'

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Open forge jobs'
define view entity {{P}}I_FORGE_JOB
as select from {{p}}forgjob as job
inner join {{p}}forgart as art on art.article_id = job.article_id
inner join {{p}}forgcus as cus on cus.customer_id = art.customer_id
{
key job.job_id as job_id,
job.job_date as job_date,
art.article_name as article_name,
art.weight_kg as weight_kg,
cus.customer_name as customer_name,
cus.city as city,
job.work_min as work_min,
case when job.work_min > 121
then 'HEAVY'
else 'LIGHT'
end as effort
}
where job.job_state = 'O'

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Open forge jobs'
define view entity {{P}}I_FORGE_JOB
as select from {{p}}forgjob as job
inner join {{p}}forgart as art on art.article_id = job.article_id
inner join {{p}}forgcus as cus on cus.customer_id = art.customer_id
{
key job.job_id as job_id,
job.job_date as job_date,
art.article_name as article_name,
art.weight_kg as weight_kg,
cus.customer_name as customer_name,
cus.city as city,
job.work_min as work_min,
case when job.work_min > 120
then 'ZEAVY'
else 'LIGHT'
end as effort
}
where job.job_state = 'O'

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Open forge jobs'
define view entity {{P}}I_FORGE_JOB
as select from {{p}}forgjob as job
inner join {{p}}forgart as art on art.article_id = job.article_id
inner join {{p}}forgcus as cus on cus.customer_id = art.customer_id
{
key job.job_id as job_id,
job.job_date as job_date,
art.article_name as article_name,
art.weight_kg as weight_kg,
cus.customer_name as customer_name,
cus.city as city,
job.work_min as work_min,
case when job.work_min > 120
then 'HEAVY'
else 'ZIGHT'
end as effort
}
where job.job_state = 'O'

View File

@@ -0,0 +1,39 @@
{
"id": "G1923",
"pool": "train",
"object_type": "DDLS",
"category": "E",
"attempts": [
{
"stage": "bundle",
"errors": [
"Too close to task G0146 (similarity spec 0.70, rules 0.71, names 0.00). Choose a different business topic and different object names.",
"Too close to task G0147 (similarity spec 0.64, rules 0.73, 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": 3,
"ok": false
}
},
{
"stage": "validate",
"oracle": 100.0,
"null": 0,
"mutation": {
"valid": 5,
"killed": 4,
"ok": true
}
}
],
"accepted": true
}

View File

@@ -0,0 +1,127 @@
CLASS {{p}}forge_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 open_jobs_only FOR TESTING.
METHODS done_job_hidden FOR TESTING.
METHODS job_without_article FOR TESTING.
METHODS job_without_customer FOR TESTING.
METHODS article_fields FOR TESTING.
METHODS customer_fields FOR TESTING.
METHODS heavy_effort FOR TESTING.
METHODS light_effort FOR TESTING.
METHODS exact_limit_light FOR TESTING.
METHODS work_min_shown FOR TESTING.
METHODS boundary_over_limit FOR TESTING.
METHODS missing_article_no_row FOR TESTING.
ENDCLASS.
CLASS {{p}}forge_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_FORGE_JOB' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_job TYPE STANDARD TABLE OF {{p}}forgjob WITH EMPTY KEY.
DATA lt_art TYPE STANDARD TABLE OF {{p}}forgart WITH EMPTY KEY.
DATA lt_cus TYPE STANDARD TABLE OF {{p}}forgcus WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_job = VALUE #(
( job_id = 'B1' article_id = 'W1' job_date = '20240301' work_min = 200 job_state = 'O' )
( job_id = 'B2' article_id = 'W2' job_date = '20240302' work_min = 60 job_state = 'O' )
( job_id = 'B3' article_id = 'W3' job_date = '20240303' work_min = 90 job_state = 'O' )
( job_id = 'B4' article_id = 'W1' job_date = '20240304' work_min = 120 job_state = 'D' )
( job_id = 'B5' article_id = 'W4' job_date = '20240305' work_min = 30 job_state = 'O' )
( job_id = 'B6' article_id = 'W1' job_date = '20240306' work_min = 120 job_state = 'O' )
( job_id = 'B7' article_id = 'W2' job_date = '20240307' work_min = 121 job_state = 'O' )
( job_id = 'B8' article_id = 'W9' job_date = '20240308' work_min = 45 job_state = 'O' ) ).
lt_art = VALUE #(
( article_id = 'W1' customer_id = 'K1' article_name = 'GATE' weight_kg = 40 )
( article_id = 'W2' customer_id = 'K2' article_name = 'FENCE' weight_kg = 25 )
( article_id = 'W4' customer_id = 'K9' article_name = 'RAILING' weight_kg = 15 ) ).
lt_cus = VALUE #(
( customer_id = 'K1' customer_name = 'ALPHA' city = 'BREMEN' )
( customer_id = 'K2' customer_name = 'BETA' city = 'KIEL' )
( customer_id = '' customer_name = 'ORPHAN' city = 'NOWHERE' ) ).
go_env->insert_test_data( lt_job ).
go_env->insert_test_data( lt_art ).
go_env->insert_test_data( lt_cus ).
ENDMETHOD.
METHOD open_jobs_only.
SELECT COUNT(*) FROM {{p}}i_forge_job INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_count ).
ENDMETHOD.
METHOD done_job_hidden.
SELECT COUNT(*) FROM {{p}}i_forge_job WHERE job_id = 'B4' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD job_without_article.
SELECT COUNT(*) FROM {{p}}i_forge_job WHERE job_id = 'B3' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD job_without_customer.
SELECT COUNT(*) FROM {{p}}i_forge_job WHERE job_id = 'B5' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD article_fields.
SELECT SINGLE article_name, weight_kg FROM {{p}}i_forge_job
WHERE job_id = 'B1' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'GATE' act = ls_row-article_name ).
cl_abap_unit_assert=>assert_equals( exp = 40 act = ls_row-weight_kg ).
ENDMETHOD.
METHOD customer_fields.
SELECT SINGLE customer_name, city FROM {{p}}i_forge_job
WHERE job_id = 'B2' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'BETA' act = ls_row-customer_name ).
cl_abap_unit_assert=>assert_equals( exp = 'KIEL' act = ls_row-city ).
ENDMETHOD.
METHOD heavy_effort.
SELECT SINGLE effort FROM {{p}}i_forge_job
WHERE job_id = 'B1' INTO @DATA(lv_effort).
cl_abap_unit_assert=>assert_equals( exp = 'HEAVY' act = lv_effort ).
ENDMETHOD.
METHOD light_effort.
SELECT SINGLE effort FROM {{p}}i_forge_job
WHERE job_id = 'B2' INTO @DATA(lv_effort).
cl_abap_unit_assert=>assert_equals( exp = 'LIGHT' act = lv_effort ).
ENDMETHOD.
METHOD exact_limit_light.
SELECT SINGLE effort FROM {{p}}i_forge_job
WHERE job_id = 'B6' INTO @DATA(lv_effort).
cl_abap_unit_assert=>assert_equals( exp = 'LIGHT' act = lv_effort ).
ENDMETHOD.
METHOD work_min_shown.
SELECT SINGLE work_min FROM {{p}}i_forge_job
WHERE job_id = 'B6' INTO @DATA(lv_min).
cl_abap_unit_assert=>assert_equals( exp = 120 act = lv_min ).
ENDMETHOD.
METHOD boundary_over_limit.
SELECT SINGLE effort FROM {{p}}i_forge_job
WHERE job_id = 'B7' INTO @DATA(lv_effort).
cl_abap_unit_assert=>assert_equals( exp = 'HEAVY' act = lv_effort ).
ENDMETHOD.
METHOD missing_article_no_row.
SELECT COUNT(*) FROM {{p}}i_forge_job WHERE job_id = 'B8' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,56 @@
{
"task": "G1923",
"mutants": [
{
"object": "{{P}}I_FORGE_JOB",
"mutant": "line 5: inner join -> left outer join (join)",
"status": "survived",
"hidden": "12/12",
"failed_tests": []
},
{
"object": "{{P}}I_FORGE_JOB",
"mutant": "line 6: = -> <> (eq)",
"status": "killed",
"hidden": "9/12",
"failed_tests": [
"CUSTOMER_FIELDS",
"JOB_WITHOUT_CUSTOMER",
"OPEN_JOBS_ONLY"
]
},
{
"object": "{{P}}I_FORGE_JOB",
"mutant": "line 15: 120 -> 121 (const)",
"status": "killed",
"hidden": "11/12",
"failed_tests": [
"BOUNDARY_OVER_LIMIT"
]
},
{
"object": "{{P}}I_FORGE_JOB",
"mutant": "line 16: 'HEAVY' -> 'ZEAVY' (lit)",
"status": "killed",
"hidden": "10/12",
"failed_tests": [
"BOUNDARY_OVER_LIMIT",
"HEAVY_EFFORT"
]
},
{
"object": "{{P}}I_FORGE_JOB",
"mutant": "line 17: 'LIGHT' -> 'ZIGHT' (lit)",
"status": "killed",
"hidden": "10/12",
"failed_tests": [
"EXACT_LIMIT_LIGHT",
"LIGHT_EFFORT"
]
}
],
"valid": 5,
"killed": 4,
"kill_rate": 0.8,
"ok": true
}

View File

@@ -0,0 +1,60 @@
CLASS {{p}}forge_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 shows_open_job FOR TESTING.
METHODS hides_done_job FOR TESTING.
METHODS effort_boundary FOR TESTING.
ENDCLASS.
CLASS {{p}}forge_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_FORGE_JOB' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_job TYPE STANDARD TABLE OF {{p}}forgjob WITH EMPTY KEY.
DATA lt_art TYPE STANDARD TABLE OF {{p}}forgart WITH EMPTY KEY.
DATA lt_cus TYPE STANDARD TABLE OF {{p}}forgcus WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_job = VALUE #(
( job_id = 'C1' article_id = 'X1' job_date = '20240401' work_min = 180 job_state = 'O' )
( job_id = 'C2' article_id = 'X1' job_date = '20240402' work_min = 20 job_state = 'D' )
( job_id = 'C3' article_id = 'X1' job_date = '20240403' work_min = 121 job_state = 'O' ) ).
lt_art = VALUE #(
( article_id = 'X1' customer_id = 'D1' article_name = 'GRID' weight_kg = 55 ) ).
lt_cus = VALUE #(
( customer_id = 'D1' customer_name = 'SMITH' city = 'ESSEN' ) ).
go_env->insert_test_data( lt_job ).
go_env->insert_test_data( lt_art ).
go_env->insert_test_data( lt_cus ).
ENDMETHOD.
METHOD shows_open_job.
SELECT SINGLE job_id, article_name, customer_name, effort FROM {{p}}i_forge_job
WHERE job_id = 'C1' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'C1' act = ls_row-job_id ).
cl_abap_unit_assert=>assert_equals( exp = 'GRID' act = ls_row-article_name ).
cl_abap_unit_assert=>assert_equals( exp = 'SMITH' act = ls_row-customer_name ).
cl_abap_unit_assert=>assert_equals( exp = 'HEAVY' act = ls_row-effort ).
ENDMETHOD.
METHOD hides_done_job.
SELECT COUNT(*) FROM {{p}}i_forge_job WHERE job_id = 'C2' INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_count ).
ENDMETHOD.
METHOD effort_boundary.
SELECT SINGLE effort FROM {{p}}i_forge_job
WHERE job_id = 'C3' INTO @DATA(lv_effort).
cl_abap_unit_assert=>assert_equals( exp = 'HEAVY' act = lv_effort ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,20 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Open forge jobs'
define view entity {{P}}I_FORGE_JOB
as select from {{p}}forgjob as job
inner join {{p}}forgart as art on art.article_id = job.article_id
inner join {{p}}forgcus as cus on cus.customer_id = art.customer_id
{
key job.job_id as job_id,
job.job_date as job_date,
art.article_name as article_name,
art.weight_kg as weight_kg,
cus.customer_name as customer_name,
cus.city as city,
job.work_min as work_min,
case when job.work_min > 120
then 'HEAVY'
else 'LIGHT'
end as effort
}
where job.job_state = 'O'

View File

@@ -0,0 +1,12 @@
@EndUserText.label : 'Forged article'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}forgart {
key client : abap.clnt not null;
key article_id : abap.char(10) not null;
customer_id : abap.char(10);
article_name : abap.char(20);
weight_kg : abap.int4;
}

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Forge customer'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}forgcus {
key client : abap.clnt not null;
key customer_id : abap.char(10) not null;
customer_name : abap.char(20);
city : abap.char(20);
}

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Forge job'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}forgjob {
key client : abap.clnt not null;
key job_id : abap.char(10) not null;
article_id : abap.char(10);
job_date : abap.dats;
work_min : abap.int4;
job_state : abap.char(1);
}

View File

@@ -0,0 +1,22 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Open forge jobs'
define view entity {{P}}I_FORGE_JOB
as select from {{p}}forgjob as job
inner join {{p}}forgart as a1 on a1.article_id = job.article_id
inner join {{p}}forgart as a2 on a2.article_id = job.article_id
inner join {{p}}forgcus as c1 on c1.customer_id = a1.customer_id
inner join {{p}}forgcus as c2 on c2.customer_id = a2.customer_id
{
key job.job_id as job_id,
job.job_date as job_date,
a1.article_name as article_name,
a2.weight_kg as weight_kg,
c1.customer_name as customer_name,
c2.city as city,
job.work_min as work_min,
case when job.work_min > 120
then 'HEAVY'
else 'LIGHT'
end as effort
}
where job.job_state = 'O'

View File

@@ -0,0 +1,49 @@
# 1. Goal
The CDS view entity {{P}}I_FORGE_JOB in package $TMP lists the open jobs of a
blacksmith's forge. The current source of the view joins the same table more
than once. Rework the view so that every source table appears in the join one
time. The view keeps its name, its elements and its result rows.
# 2. Open questions
None.
# 3. Context
- {{P}}I_FORGE_JOB is an active CDS view entity in package $TMP.
- The view reads three tables: {{P}}FORGJOB, {{P}}FORGART and {{P}}FORGCUS.
- {{P}}FORGJOB holds one row for each job of the forge. Key: JOB_ID (CHAR 10).
Further fields: ARTICLE_ID (CHAR 10), JOB_DATE (DATS), WORK_MIN (INT4),
JOB_STATE (CHAR 1).
- {{P}}FORGART holds one row for each forged article. Key: ARTICLE_ID
(CHAR 10). Further fields: CUSTOMER_ID (CHAR 10), ARTICLE_NAME (CHAR 20),
WEIGHT_KG (INT4).
- {{P}}FORGCUS holds one row for each customer. Key: CUSTOMER_ID (CHAR 10).
Further fields: CUSTOMER_NAME (CHAR 20), CITY (CHAR 20).
- A report and an OData service read the view with the element names below.
- The current source of the view is part of the seed. Read it. It fixes the
result that the hidden tests expect.
# 4. Contract
- Rework {{P}}I_FORGE_JOB in package $TMP. The name does not change.
- The elements do not change. Element names: JOB_ID (key), JOB_DATE,
ARTICLE_NAME, WEIGHT_KG, CUSTOMER_NAME, CITY, WORK_MIN, EFFORT.
- The element types do not change.
- Authorization check: #NOT_REQUIRED.
# 5. Business rules
1. The result of the view does not change. The seed source of {{P}}I_FORGE_JOB
is the definition of the result. Read the seed source.
2. The number of rows, the element names and the element types stay as they
are today.
# 6. Constraints
- Release target: SAP_BASIS 816 (ABAP Platform 2025), client 001.
- Quality goals:
- No source table of the view may appear in the join more than once.
- The view must stay readable and free of duplicated conditions.
- Coding standards: Clean ABAP, no ATC priority 1 or priority 2 findings.
- Out of scope: do not change {{P}}FORGJOB, {{P}}FORGART and {{P}}FORGCUS.
# 7. Acceptance
- The view {{P}}I_FORGE_JOB is active and free of syntax errors.
- The hidden tests pass.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,85 @@
{
"id": "G1923",
"category": "E",
"object_type": "DDLS",
"difficulty": 3,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 80,
"max_activations": 20
},
"seed": [
{
"type": "TABL",
"name": "{{P}}FORGJOB",
"file": "seed/forgjob.tabl.asabap",
"description": "Job of the blacksmith's forge"
},
{
"type": "TABL",
"name": "{{P}}FORGART",
"file": "seed/forgart.tabl.asabap",
"description": "Forged article"
},
{
"type": "TABL",
"name": "{{P}}FORGCUS",
"file": "seed/forgcus.tabl.asabap",
"description": "Customer of the forge"
},
{
"type": "DDLS",
"name": "{{P}}I_FORGE_JOB",
"file": "seed/i_forge_job.ddls.asddls",
"description": "Legacy view with repeated join logic"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_FORGE_JOB",
"fields": [
"JOB_ID",
"JOB_DATE",
"ARTICLE_NAME",
"WEIGHT_KG",
"CUSTOMER_NAME",
"CITY",
"WORK_MIN",
"EFFORT"
]
}
],
"out_of_scope": [
"{{P}}FORGJOB",
"{{P}}FORGART",
"{{P}}FORGCUS"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}FORGE_HIDDEN",
"file": "hidden/forge_hidden.clas.abap",
"description": "Hidden tests for the reworked view"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_FORGE_JOB",
"file": "reference/i_forge_job.ddls.asddls",
"description": "Reworked view, each source table joined once"
},
{
"type": "CLAS",
"name": "{{P}}FORGE_TEST",
"file": "reference/forge_test.clas.abap",
"description": "Own tests for the view"
}
],
"craft_checks": [
"No source table of the view appears in the join more than once.",
"The view contains no duplicated join condition."
]
}