Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged
- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
36
tasks_gen/eval/G0020/generation.json
Normal file
36
tasks_gen/eval/G0020/generation.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"id": "G0020",
|
||||
"pool": "eval",
|
||||
"object_type": "DDLS",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "manual_fix",
|
||||
"by": "Claude review 2026-10-03",
|
||||
"change": "Removed literal default values of the CDS parameters p_from and p_to (not allowed in a view entity). The harness G2 check now works for views with parameters.",
|
||||
"oracle": 100.0,
|
||||
"null": 0
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
157
tasks_gen/eval/G0020/hidden/t20_hidden.clas.abap
Normal file
157
tasks_gen/eval/G0020/hidden/t20_hidden.clas.abap
Normal file
@@ -0,0 +1,157 @@
|
||||
CLASS {{p}}t20_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 revenue_in_period FOR TESTING.
|
||||
METHODS sold_quantity_in_period FOR TESTING.
|
||||
METHODS books_in_period FOR TESTING.
|
||||
METHODS title_and_category FOR TESTING.
|
||||
METHODS revenue_has_two_decimals FOR TESTING.
|
||||
METHODS period_limits_included FOR TESTING.
|
||||
METHODS empty_period FOR TESTING.
|
||||
METHODS book_outside_period_hidden FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_hidden IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BOOK_REVENUE' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_book TYPE STANDARD TABLE OF {{p}}book WITH EMPTY KEY.
|
||||
DATA lt_sale TYPE STANDARD TABLE OF {{p}}sale WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_book = VALUE #(
|
||||
( book_id = 'B1' title = 'ABAP Basics' category = 'TECH' price = '40.00' )
|
||||
( book_id = 'B2' title = 'SQL Guide' category = 'TECH' price = '25.50' )
|
||||
( book_id = 'B3' title = 'Cooking Fun' category = 'HOME' price = '15.00' )
|
||||
( book_id = 'B4' title = 'Space Novel' category = 'FICTION' price = '9.99' )
|
||||
( book_id = 'B5' title = 'Old Book' category = 'TECH' price = '5.00' ) ).
|
||||
lt_sale = VALUE #(
|
||||
( book_id = 'B1' sale_date = '20240110' quantity = 2 )
|
||||
( book_id = 'B1' sale_date = '20240215' quantity = 1 )
|
||||
( book_id = 'B1' sale_date = '20240601' quantity = 5 )
|
||||
( book_id = 'B2' sale_date = '20240120' quantity = 4 )
|
||||
( book_id = 'B3' sale_date = '20240305' quantity = 3 )
|
||||
( book_id = 'B4' sale_date = '20240201' quantity = 1 )
|
||||
( book_id = 'B4' sale_date = '20240202' quantity = 2 )
|
||||
( book_id = 'B5' sale_date = '20240615' quantity = 7 ) ).
|
||||
go_env->insert_test_data( lt_book ).
|
||||
go_env->insert_test_data( lt_sale ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD revenue_in_period.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240331'.
|
||||
SELECT SINGLE revenue
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B1'
|
||||
INTO @DATA(lv_revenue).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '120.00' )
|
||||
act = CONV decfloat34( lv_revenue ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD sold_quantity_in_period.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240331'.
|
||||
SELECT SINGLE sold_quantity
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B1'
|
||||
INTO @DATA(lv_sold).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = CONV i( lv_sold ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD books_in_period.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240331'.
|
||||
SELECT COUNT(*)
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD title_and_category.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240331'.
|
||||
SELECT SINGLE title, category
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B2'
|
||||
INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'SQL Guide' act = ls_row-title ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'TECH' act = ls_row-category ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD revenue_has_two_decimals.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240331'.
|
||||
SELECT SINGLE revenue
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B4'
|
||||
INTO @DATA(lv_revenue).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '29.97' )
|
||||
act = CONV decfloat34( lv_revenue ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD period_limits_included.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240110'.
|
||||
lv_to = '20240110'.
|
||||
SELECT SINGLE sold_quantity
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B1'
|
||||
INTO @DATA(lv_sold_b1).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = CONV i( lv_sold_b1 ) ).
|
||||
|
||||
lv_from = '20240305'.
|
||||
lv_to = '20240305'.
|
||||
SELECT SINGLE sold_quantity
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B3'
|
||||
INTO @DATA(lv_sold_b3).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = CONV i( lv_sold_b3 ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD empty_period.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240501'.
|
||||
lv_to = '20240531'.
|
||||
SELECT COUNT(*)
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
INTO @DATA(lv_rows).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rows ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD book_outside_period_hidden.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240331'.
|
||||
SELECT SINGLE book_id
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'B5'
|
||||
INTO @DATA(lv_book).
|
||||
cl_abap_unit_assert=>assert_initial( lv_book ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
20
tasks_gen/eval/G0020/reference/i_book_revenue.ddls.asddls
Normal file
20
tasks_gen/eval/G0020/reference/i_book_revenue.ddls.asddls
Normal file
@@ -0,0 +1,20 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Book revenue in period'
|
||||
define view entity {{P}}I_BOOK_REVENUE
|
||||
with parameters
|
||||
p_from : abap.dats,
|
||||
p_to : abap.dats
|
||||
as select from {{p}}book as bk
|
||||
inner join {{p}}sale as sl on sl.book_id = bk.book_id
|
||||
{
|
||||
key bk.book_id as book_id,
|
||||
bk.title as title,
|
||||
bk.category as category,
|
||||
sum( sl.quantity ) as sold_quantity,
|
||||
sum( cast( sl.quantity as abap.dec( 10, 0 ) ) * bk.price ) as revenue
|
||||
}
|
||||
where sl.sale_date between $parameters.p_from and $parameters.p_to
|
||||
group by
|
||||
bk.book_id,
|
||||
bk.title,
|
||||
bk.category
|
||||
62
tasks_gen/eval/G0020/reference/t20_test.clas.abap
Normal file
62
tasks_gen/eval/G0020/reference/t20_test.clas.abap
Normal file
@@ -0,0 +1,62 @@
|
||||
CLASS {{p}}t20_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 revenue_of_one_book FOR TESTING.
|
||||
METHODS period_is_inclusive FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_BOOK_REVENUE' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_book TYPE STANDARD TABLE OF {{p}}book WITH EMPTY KEY.
|
||||
DATA lt_sale TYPE STANDARD TABLE OF {{p}}sale WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_book = VALUE #(
|
||||
( book_id = 'A1' title = 'Test Book' category = 'TECH' price = '10.00' ) ).
|
||||
lt_sale = VALUE #(
|
||||
( book_id = 'A1' sale_date = '20240101' quantity = 2 )
|
||||
( book_id = 'A1' sale_date = '20240131' quantity = 3 )
|
||||
( book_id = 'A1' sale_date = '20240201' quantity = 9 ) ).
|
||||
go_env->insert_test_data( lt_book ).
|
||||
go_env->insert_test_data( lt_sale ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD revenue_of_one_book.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240131'.
|
||||
SELECT SINGLE sold_quantity, revenue
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'A1'
|
||||
INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 5 act = CONV i( ls_row-sold_quantity ) ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '50.00' )
|
||||
act = CONV decfloat34( ls_row-revenue ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD period_is_inclusive.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240101'.
|
||||
lv_to = '20240101'.
|
||||
SELECT SINGLE sold_quantity
|
||||
FROM {{p}}i_book_revenue( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE book_id = 'A1'
|
||||
INTO @DATA(lv_sold).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = CONV i( lv_sold ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
13
tasks_gen/eval/G0020/seed/book.tabl.asabap
Normal file
13
tasks_gen/eval/G0020/seed/book.tabl.asabap
Normal file
@@ -0,0 +1,13 @@
|
||||
@EndUserText.label : 'Book master data'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}book {
|
||||
key client : abap.clnt not null;
|
||||
key book_id : abap.char(10) not null;
|
||||
title : abap.char(40);
|
||||
category : abap.char(10);
|
||||
price : abap.dec(15,2);
|
||||
stock : abap.int4;
|
||||
}
|
||||
11
tasks_gen/eval/G0020/seed/sale.tabl.asabap
Normal file
11
tasks_gen/eval/G0020/seed/sale.tabl.asabap
Normal file
@@ -0,0 +1,11 @@
|
||||
@EndUserText.label : 'Book sales'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}sale {
|
||||
key client : abap.clnt not null;
|
||||
key book_id : abap.char(10) not null;
|
||||
key sale_date : abap.dats not null;
|
||||
quantity : abap.int4;
|
||||
}
|
||||
43
tasks_gen/eval/G0020/spec.md
Normal file
43
tasks_gen/eval/G0020/spec.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# 1. Goal
|
||||
Show the sales of each book for a period that the caller gives. The period comes
|
||||
from the caller, so the view needs input parameters. A report and an OData
|
||||
service read the view.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}BOOK (book master data), package $TMP. Key: BOOK_ID (CHAR 10).
|
||||
Fields: TITLE (CHAR 40), CATEGORY (CHAR 10), PRICE (DEC 15,2), STOCK (INT4).
|
||||
- Table {{P}}SALE (book sales), package $TMP. Key: BOOK_ID (CHAR 10),
|
||||
SALE_DATE (DATS). Field: QUANTITY (INT4).
|
||||
|
||||
# 4. Contract
|
||||
- Create the CDS view entity {{P}}I_BOOK_REVENUE in package $TMP.
|
||||
- The view has two input parameters, with these names and types:
|
||||
- P_FROM (DATS): first day of the period.
|
||||
- P_TO (DATS): last day of the period.
|
||||
- Elements, with these names: BOOK_ID (key), TITLE, CATEGORY, SOLD_QUANTITY,
|
||||
REVENUE.
|
||||
- No authorization check (#NOT_REQUIRED).
|
||||
- Create the global ABAP Unit test class {{P}}T20_TEST for the view.
|
||||
|
||||
# 5. Business rules
|
||||
1. The view has one row for each book that has at least one sale whose
|
||||
SALE_DATE is in the period. The period starts on P_FROM and ends on P_TO.
|
||||
Both limits belong to the period.
|
||||
2. A book without a sale in the period has no row in the view.
|
||||
3. SOLD_QUANTITY is the sum of QUANTITY of all sales of the book in the period.
|
||||
4. REVENUE is the sum of QUANTITY multiplied by PRICE of the book, over all
|
||||
sales of the book in the period. REVENUE has 2 decimals.
|
||||
5. TITLE and CATEGORY are the title and the category of the book.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP, methods below 40 statements.
|
||||
- Out of scope: do not change {{P}}BOOK and {{P}}SALE.
|
||||
|
||||
# 7. Acceptance
|
||||
- The view is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- {{P}}T20_TEST uses CL_CDS_TEST_ENVIRONMENT and passes.
|
||||
76
tasks_gen/eval/G0020/task.json
Normal file
76
tasks_gen/eval/G0020/task.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"id": "G0020",
|
||||
"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}}BOOK",
|
||||
"file": "seed/book.tabl.asabap",
|
||||
"description": "Book master data"
|
||||
},
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}SALE",
|
||||
"file": "seed/sale.tabl.asabap",
|
||||
"description": "Book sales"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_BOOK_REVENUE",
|
||||
"fields": [
|
||||
"BOOK_ID",
|
||||
"TITLE",
|
||||
"CATEGORY",
|
||||
"SOLD_QUANTITY",
|
||||
"REVENUE"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "P_FROM",
|
||||
"type": "DATS"
|
||||
},
|
||||
{
|
||||
"name": "P_TO",
|
||||
"type": "DATS"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}BOOK",
|
||||
"{{P}}SALE"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_HIDDEN",
|
||||
"file": "hidden/t20_hidden.clas.abap",
|
||||
"description": "T20 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "DDLS",
|
||||
"name": "{{P}}I_BOOK_REVENUE",
|
||||
"file": "reference/i_book_revenue.ddls.asddls",
|
||||
"description": "Book revenue in a period"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_TEST",
|
||||
"file": "reference/t20_test.clas.abap",
|
||||
"description": "T20 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user