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/G1099/generation.json
Normal file
14
tasks_gen/train/G1099/generation.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "G1099",
|
||||
"pool": "train",
|
||||
"object_type": "CLAS",
|
||||
"category": "H",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100,
|
||||
"null": 30
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
38
tasks_gen/train/G1099/reference/salon_pricer.clas.abap
Normal file
38
tasks_gen/train/G1099/reference/salon_pricer.clas.abap
Normal file
@@ -0,0 +1,38 @@
|
||||
CLASS {{p}}salon_pricer DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES {{p}}if_salon_price.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS base_price
|
||||
IMPORTING iv_service TYPE {{p}}if_salon_price=>ty_service
|
||||
RETURNING VALUE(rv_price) TYPE {{p}}if_salon_price=>ty_amount.
|
||||
METHODS minimum_price
|
||||
IMPORTING iv_price TYPE {{p}}if_salon_price=>ty_amount
|
||||
RETURNING VALUE(rv_price) TYPE {{p}}if_salon_price=>ty_amount.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}salon_pricer IMPLEMENTATION.
|
||||
METHOD {{p}}if_salon_price~price.
|
||||
IF iv_service = {{p}}if_salon_price=>c_service-cut AND iv_child = abap_true.
|
||||
rv_price = '12.00'.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
rv_price = minimum_price( base_price( iv_service ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_price.
|
||||
CASE iv_service.
|
||||
WHEN {{p}}if_salon_price=>c_service-cut.
|
||||
rv_price = '42.00'.
|
||||
WHEN {{p}}if_salon_price=>c_service-colour.
|
||||
rv_price = '90.00'.
|
||||
WHEN {{p}}if_salon_price=>c_service-perm.
|
||||
rv_price = '95.00'.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_price.
|
||||
rv_price = nmax( val1 = iv_price val2 = '20.00' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
@@ -0,0 +1,44 @@
|
||||
CLASS ltc_salon_pricer DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}if_salon_price.
|
||||
METHODS setup.
|
||||
METHODS cut_price FOR TESTING.
|
||||
METHODS colour_price FOR TESTING.
|
||||
METHODS perm_price FOR TESTING.
|
||||
METHODS child_cut_price FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_salon_pricer IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}salon_pricer( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD cut_price.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV {{p}}if_salon_price=>ty_amount( '42.00' )
|
||||
act = mo_cut->price( iv_service = {{p}}if_salon_price=>c_service-cut
|
||||
iv_child = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD colour_price.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV {{p}}if_salon_price=>ty_amount( '90.00' )
|
||||
act = mo_cut->price( iv_service = {{p}}if_salon_price=>c_service-colour
|
||||
iv_child = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD perm_price.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV {{p}}if_salon_price=>ty_amount( '95.00' )
|
||||
act = mo_cut->price( iv_service = {{p}}if_salon_price=>c_service-perm
|
||||
iv_child = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD child_cut_price.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV {{p}}if_salon_price=>ty_amount( '12.00' )
|
||||
act = mo_cut->price( iv_service = {{p}}if_salon_price=>c_service-cut
|
||||
iv_child = abap_true ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
14
tasks_gen/train/G1099/seed/if_salon_price.intf.abap
Normal file
14
tasks_gen/train/G1099/seed/if_salon_price.intf.abap
Normal file
@@ -0,0 +1,14 @@
|
||||
INTERFACE {{p}}if_salon_price PUBLIC.
|
||||
TYPES ty_service TYPE c LENGTH 10.
|
||||
TYPES ty_amount TYPE p LENGTH 8 DECIMALS 2.
|
||||
CONSTANTS:
|
||||
BEGIN OF c_service,
|
||||
cut TYPE ty_service VALUE 'CUT',
|
||||
colour TYPE ty_service VALUE 'COLOUR',
|
||||
perm TYPE ty_service VALUE 'PERM',
|
||||
END OF c_service.
|
||||
METHODS price
|
||||
IMPORTING iv_service TYPE ty_service
|
||||
iv_child TYPE abap_bool
|
||||
RETURNING VALUE(rv_price) TYPE ty_amount.
|
||||
ENDINTERFACE.
|
||||
43
tasks_gen/train/G1099/spec.md
Normal file
43
tasks_gen/train/G1099/spec.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# 1. Goal
|
||||
A hair salon prices appointments. The checkout program calls one class for each
|
||||
appointment. The class returns the price of the appointment in euro.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Interface {{P}}IF_SALON_PRICE exists in package $TMP. It is active.
|
||||
- The interface has the type TY_SERVICE (CHAR 10) and the type TY_AMOUNT
|
||||
(P length 8, 2 decimals).
|
||||
- The interface has the constant structure C_SERVICE with the components CUT,
|
||||
COLOUR and PERM.
|
||||
- The interface has one method:
|
||||
PRICE IMPORTING iv_service TYPE ty_service
|
||||
iv_child TYPE abap_bool
|
||||
RETURNING VALUE(rv_price) TYPE ty_amount.
|
||||
- iv_child is abap_true when the customer is under 12 years.
|
||||
|
||||
# 4. Contract
|
||||
- Create the class {{P}}SALON_PRICER in package $TMP.
|
||||
- The class is public, final, and has a public constructor without parameters.
|
||||
- The class implements {{P}}IF_SALON_PRICE.
|
||||
- Do not add other public methods.
|
||||
|
||||
# 5. Business rules
|
||||
1. The price is in euro with two decimals.
|
||||
2. A cut costs 42.00 EUR.
|
||||
3. A colour service costs 78.00 EUR. A colour service includes a scalp
|
||||
treatment. Add 12.00 EUR to the price of a colour service.
|
||||
4. A perm costs 95.00 EUR.
|
||||
5. A cut for a child under 12 years costs exactly 12.00 EUR.
|
||||
6. The minimum price of an appointment is 20.00 EUR.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 8.16.
|
||||
- Coding standards: Clean ABAP. Method length below 40 statements. No global
|
||||
variables. No comment that restates the code.
|
||||
- Out of scope: do not change {{P}}IF_SALON_PRICE.
|
||||
|
||||
# 7. Acceptance
|
||||
- The class is active and has no syntax error.
|
||||
- Write your own ABAP Unit tests for the class.
|
||||
60
tasks_gen/train/G1099/task.json
Normal file
60
tasks_gen/train/G1099/task.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"id": "G1099",
|
||||
"category": "H",
|
||||
"object_type": "CLAS",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "stop",
|
||||
"expected_gap": {
|
||||
"description": "Rule 5 fixes the price of a child's cut at exactly 12.00 EUR, but rule 6 sets the minimum price of an appointment to 20.00 EUR, so the price of a child's cut is not defined.",
|
||||
"keywords": [
|
||||
[
|
||||
"child",
|
||||
"12"
|
||||
],
|
||||
[
|
||||
"minimum",
|
||||
"20"
|
||||
],
|
||||
[
|
||||
"child",
|
||||
"cut"
|
||||
]
|
||||
]
|
||||
},
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "INTF",
|
||||
"name": "{{P}}IF_SALON_PRICE",
|
||||
"file": "seed/if_salon_price.intf.abap",
|
||||
"description": "Salon price contract: service type, amount type, service constants and the price method"
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SALON_PRICER",
|
||||
"implements": "{{P}}IF_SALON_PRICE"
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}IF_SALON_PRICE"
|
||||
],
|
||||
"hidden_tests": [],
|
||||
"reference": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}SALON_PRICER",
|
||||
"file": "reference/salon_pricer.clas.abap",
|
||||
"description": "Intended salon price class (the child cut price rule wins)",
|
||||
"testclasses_file": "reference/salon_pricer.testclasses.abap"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"method_length"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user