Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
52
tasks_gen/train/G1070/spec.md
Normal file
52
tasks_gen/train/G1070/spec.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# 1. Goal
|
||||
A document shredding company prices a collection of paper boxes. The order desk
|
||||
calls the class {{P}}SHRED_PRICER for each order. The class was written many years
|
||||
ago and is hard to maintain. Refactor the class. The price of an order must stay
|
||||
the same.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- The class {{P}}SHRED_PRICER exists in package $TMP. It is active.
|
||||
- The class is public and final and has a public constructor without parameters.
|
||||
- The order desk calls the public method CALCULATE_PRICE.
|
||||
- The class holds the complete pricing logic of the company. Read the class.
|
||||
- No other document describes the pricing rules.
|
||||
|
||||
# 4. Contract
|
||||
- Keep the class {{P}}SHRED_PRICER in package $TMP. Keep the name.
|
||||
- Keep the class public and final with a public constructor without parameters.
|
||||
- Keep the public types TY_SIZE, TY_SERVICE, and TY_PRICE.
|
||||
- Keep the public constants C_SIZE (SMALL, LARGE) and C_SERVICE (PLANT, ONSITE).
|
||||
- Keep the public method CALCULATE_PRICE with these parameters:
|
||||
IV_BOXES TYPE i, IV_SIZE TYPE ty_size, IV_SERVICE TYPE ty_service,
|
||||
IV_EXPRESS TYPE abap_bool, IV_CONTRACT TYPE abap_bool, and the returning
|
||||
parameter RV_PRICE TYPE ty_price.
|
||||
- Do not add other public methods.
|
||||
|
||||
# 5. Business rules
|
||||
- The behavior stays the same. For every order, CALCULATE_PRICE must return the
|
||||
same price as the current class.
|
||||
- The pricing rules are in the current class. Read the class and keep every rule,
|
||||
including the price of a box, the surcharge for on-site shredding, the discount
|
||||
for many boxes, the discount for contract customers, the surcharge for express
|
||||
service, the fallback for an unknown box size, and the minimum charge.
|
||||
- The sequence of the rules must not change.
|
||||
- Quality goals:
|
||||
- Short methods. One method does one thing.
|
||||
- No magic numbers. Use named constants.
|
||||
- The class must be easy to read and easy to change.
|
||||
- The public interface must stay the same.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
|
||||
- Coding standards: Clean ABAP. Method length below 40 statements. No global
|
||||
variables. No comment that restates the code.
|
||||
- Out of scope: do not change the public interface of {{P}}SHRED_PRICER. Do not
|
||||
change the package.
|
||||
|
||||
# 7. Acceptance
|
||||
- The class {{P}}SHRED_PRICER is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write your own ABAP Unit tests for the class.
|
||||
Reference in New Issue
Block a user