Hard batch G0022-G0026: 5/5 accepted; budget floor, CDS checks, mutation check
- generator: budget floor (2x oracle activations, 3x calls), static checks for CDS $parameters and UNION annotation - harness/mutation.py: deterministic mutants of the reference; hidden tests must fail - G0022 revalidated with harness fixes: oracle 100, null 0 - results in docs/faz1-tasarim.md 11f Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
19
tasks_gen/eval/G0024/generation.json
Normal file
19
tasks_gen/eval/G0024/generation.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "G0024",
|
||||
"pool": "eval",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
89
tasks_gen/eval/G0024/hidden/t16_hidden.clas.abap
Normal file
89
tasks_gen/eval/G0024/hidden/t16_hidden.clas.abap
Normal file
@@ -0,0 +1,89 @@
|
||||
CLASS {{p}}t16_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CONSTANTS c_from TYPE d VALUE '20240101'.
|
||||
CONSTANTS c_to TYPE d VALUE '20240131'.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS row_per_product FOR TESTING.
|
||||
METHODS sums_quantity FOR TESTING.
|
||||
METHODS sums_amount FOR TESTING.
|
||||
METHODS excludes_before_from FOR TESTING.
|
||||
METHODS excludes_after_to FOR TESTING.
|
||||
METHODS bounds_inclusive FOR TESTING.
|
||||
METHODS empty_period FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SALES_REPORT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_sales TYPE STANDARD TABLE OF {{p}}sales WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_sales = VALUE #(
|
||||
( doc_id = 'D1' item_no = 1 product = 'MAT_A' quantity = 3 price = '10.00' sold_on = '20240110' )
|
||||
( doc_id = 'D1' item_no = 2 product = 'MAT_A' quantity = 2 price = '5.00' sold_on = '20240115' )
|
||||
( doc_id = 'D2' item_no = 1 product = 'MAT_B' quantity = 1 price = '100.00' sold_on = '20240131' )
|
||||
( doc_id = 'D3' item_no = 1 product = 'MAT_B' quantity = 4 price = '2.50' sold_on = '20231231' )
|
||||
( doc_id = 'D4' item_no = 1 product = 'MAT_C' quantity = 7 price = '1.00' sold_on = '20240201' ) ).
|
||||
go_env->insert_test_data( lt_sales ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD row_per_product.
|
||||
SELECT COUNT(*) FROM {{p}}i_sales_report( p_from = @c_from, p_to = @c_to )
|
||||
INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD sums_quantity.
|
||||
SELECT SINGLE total_qty FROM {{p}}i_sales_report( p_from = @c_from, p_to = @c_to )
|
||||
WHERE product = 'MAT_A' INTO @DATA(lv_qty).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 5 act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD sums_amount.
|
||||
SELECT SINGLE total_amount FROM {{p}}i_sales_report( p_from = @c_from, p_to = @c_to )
|
||||
WHERE product = 'MAT_A' INTO @DATA(lv_amount).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '40.00' )
|
||||
act = CONV decfloat34( lv_amount ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD excludes_before_from.
|
||||
SELECT SINGLE total_qty FROM {{p}}i_sales_report( p_from = @c_from, p_to = @c_to )
|
||||
WHERE product = 'MAT_B' INTO @DATA(lv_qty).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD excludes_after_to.
|
||||
SELECT COUNT(*) FROM {{p}}i_sales_report( p_from = @c_from, p_to = @c_to )
|
||||
WHERE product = 'MAT_C' INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD bounds_inclusive.
|
||||
DATA lv_day TYPE d.
|
||||
lv_day = '20240131'.
|
||||
SELECT SINGLE total_qty FROM {{p}}i_sales_report( p_from = @lv_day, p_to = @lv_day )
|
||||
WHERE product = 'MAT_B' INTO @DATA(lv_qty).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD empty_period.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20230101'.
|
||||
lv_to = '20230131'.
|
||||
SELECT COUNT(*) FROM {{p}}i_sales_report( p_from = @lv_from, p_to = @lv_to )
|
||||
INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
15
tasks_gen/eval/G0024/reference/i_sales_report.ddls.asddls
Normal file
15
tasks_gen/eval/G0024/reference/i_sales_report.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales per product in a period'
|
||||
define view entity {{P}}I_SALES_REPORT
|
||||
with parameters
|
||||
p_from : abap.dats,
|
||||
p_to : abap.dats
|
||||
as select from {{p}}sales as sale
|
||||
{
|
||||
key sale.product as product,
|
||||
sum( sale.quantity ) as total_qty,
|
||||
sum( cast( sale.quantity as abap.dec( 15, 2 ) ) * sale.price ) as total_amount
|
||||
}
|
||||
where sale.sold_on >= $parameters.p_from
|
||||
and sale.sold_on <= $parameters.p_to
|
||||
group by sale.product
|
||||
44
tasks_gen/eval/G0024/reference/t16_test.clas.abap
Normal file
44
tasks_gen/eval/G0024/reference/t16_test.clas.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
CLASS {{p}}t16_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 period_is_inclusive FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SALES_REPORT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_sales TYPE STANDARD TABLE OF {{p}}sales WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_sales = VALUE #(
|
||||
( doc_id = 'S1' item_no = 1 product = 'P1' quantity = 2 price = '1.50' sold_on = '20240501' )
|
||||
( doc_id = 'S1' item_no = 2 product = 'P1' quantity = 1 price = '4.00' sold_on = '20240531' )
|
||||
( doc_id = 'S2' item_no = 1 product = 'P2' quantity = 9 price = '0.10' sold_on = '20240601' ) ).
|
||||
go_env->insert_test_data( lt_sales ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD period_is_inclusive.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240501'.
|
||||
lv_to = '20240531'.
|
||||
SELECT SINGLE total_qty, total_amount
|
||||
FROM {{p}}i_sales_report( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE product = 'P1'
|
||||
INTO @DATA(ls_result).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = ls_result-total_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '7.00' )
|
||||
act = CONV decfloat34( ls_result-total_amount ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
14
tasks_gen/eval/G0024/seed/sales.tabl.asabap
Normal file
14
tasks_gen/eval/G0024/seed/sales.tabl.asabap
Normal file
@@ -0,0 +1,14 @@
|
||||
@EndUserText.label : 'Sales line'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}sales {
|
||||
key client : abap.clnt not null;
|
||||
key doc_id : abap.char(10) not null;
|
||||
key item_no : abap.int4 not null;
|
||||
product : abap.char(10);
|
||||
quantity : abap.int4;
|
||||
price : abap.dec(15,2);
|
||||
sold_on : abap.dats;
|
||||
}
|
||||
22
tasks_gen/eval/G0024/seed/seed_sales.clas.abap
Normal file
22
tasks_gen/eval/G0024/seed/seed_sales.clas.abap
Normal file
@@ -0,0 +1,22 @@
|
||||
CLASS {{p}}seed_sales DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}seed_sales IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DATA lt_sales TYPE STANDARD TABLE OF {{p}}sales WITH EMPTY KEY.
|
||||
lt_sales = VALUE #(
|
||||
( doc_id = 'D1' item_no = 1 product = 'MAT_A' quantity = 3 price = '10.00' sold_on = '20240110' )
|
||||
( doc_id = 'D1' item_no = 2 product = 'MAT_A' quantity = 2 price = '5.00' sold_on = '20240115' )
|
||||
( doc_id = 'D2' item_no = 1 product = 'MAT_B' quantity = 1 price = '100.00' sold_on = '20240131' )
|
||||
( doc_id = 'D3' item_no = 1 product = 'MAT_B' quantity = 4 price = '2.50' sold_on = '20231231' )
|
||||
( doc_id = 'D4' item_no = 1 product = 'MAT_C' quantity = 7 price = '1.00' sold_on = '20240201' ) ).
|
||||
DELETE FROM {{p}}sales.
|
||||
INSERT {{p}}sales FROM TABLE @lt_sales.
|
||||
out->write( |Seed rows: { lines( lt_sales ) }| ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
40
tasks_gen/eval/G0024/spec.md
Normal file
40
tasks_gen/eval/G0024/spec.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# 1. Goal
|
||||
Give the sales figures of each product for a period. The period is an input of the
|
||||
view. A report and an OData service read the figures, so the calculation must be in
|
||||
the database, in a CDS view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}SALES (sales line), package $TMP. Key: DOC_ID (CHAR 10), ITEM_NO (INT4).
|
||||
Fields: PRODUCT (CHAR 10), QUANTITY (INT4), PRICE (DEC 15,2, the price of one
|
||||
unit), SOLD_ON (DATS, the date of the sale).
|
||||
- The class {{P}}SEED_SALES fills {{P}}SALES with sample data. Run it if you want to
|
||||
test the view manually.
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_SALES_REPORT in package $TMP.
|
||||
- Input parameters, with these names and types: P_FROM (DATS), P_TO (DATS).
|
||||
The parameters have no default value.
|
||||
- Elements, with these names: PRODUCT (key), TOTAL_QTY, TOTAL_AMOUNT.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
|
||||
# 5. Business rules
|
||||
1. A sales line is in the period when SOLD_ON is not before P_FROM and not after
|
||||
P_TO. P_FROM and P_TO are part of the period.
|
||||
2. Show one row for each product with at least one sales line in the period. Do not
|
||||
show a product without a sales line in the period.
|
||||
3. TOTAL_QTY is the sum of QUANTITY of all sales lines of the product in the period.
|
||||
4. TOTAL_AMOUNT is the sum of QUANTITY multiplied by PRICE of all sales lines of the
|
||||
product in the period, with 2 decimals.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP.
|
||||
- Out of scope: do not change {{P}}SALES and {{P}}SEED_SALES.
|
||||
|
||||
# 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.
|
||||
75
tasks_gen/eval/G0024/task.json
Normal file
75
tasks_gen/eval/G0024/task.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"id": "G0024",
|
||||
"category": "B",
|
||||
"object_type": "DDLS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v758",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 40,
|
||||
"max_activations": 10
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}SALES",
|
||||
"file": "seed/sales.tabl.asabap",
|
||||
"description": "Sales line"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SEED_SALES",
|
||||
"file": "seed/seed_sales.clas.abap",
|
||||
"run": true,
|
||||
"description": "Seed data for {{P}}SALES"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SALES_REPORT",
|
||||
"params": [
|
||||
{
|
||||
"name": "P_FROM",
|
||||
"type": "abap.dats"
|
||||
},
|
||||
{
|
||||
"name": "P_TO",
|
||||
"type": "abap.dats"
|
||||
}
|
||||
],
|
||||
"fields": [
|
||||
"PRODUCT",
|
||||
"TOTAL_QTY",
|
||||
"TOTAL_AMOUNT"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}SALES",
|
||||
"{{P}}SEED_SALES"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T16_HIDDEN",
|
||||
"file": "hidden/t16_hidden.clas.abap",
|
||||
"description": "T16 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_SALES_REPORT",
|
||||
"file": "reference/i_sales_report.ddls.asddls",
|
||||
"description": "Sales figures per product in a period"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T16_TEST",
|
||||
"file": "reference/t16_test.clas.abap",
|
||||
"description": "T16 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user