Files

2 lines
1.7 KiB
Markdown

Hi, we need to refactor the class {{P}}FRAME_PRICER in package $TMP. The class is active. It is public, final, and has a public constructor without parameters. It has public types TY_MOULDING (CHAR 1), TY_GLASS (CHAR 1), and TY_AMOUNT (packed number with 2 decimal places). It has one public method CALCULATE_PRICE with importing parameters IV_WIDTH_CM, IV_HEIGHT_CM, IV_MOULDING, IV_GLASS, and IV_QUANTITY, and returning parameter RV_PRICE. The current implementation contains the complete calculation. Please read it. The code is hard to read and hard to maintain. Refactor the class. The behavior stays the same. Keep the class name, the class properties, and the complete public interface. Do not add, remove, or rename public methods, public types, or parameters. The method CALCULATE_PRICE must return the same value as before for every input. The behavior of the class stays the same. Every input combination that the current implementation accepts must produce the same result. The rules of the calculation are in the current implementation. Read them there. The hidden tests check the behavior with valid and invalid input values. The release target is 8.16. Follow Clean ABAP. Each method must have less than 40 statements. Use local variables instead of attributes. Use constants instead of magic numbers. Use modern ABAP statements and modern comparison operators. Give each method one clear task. Do not change the public interface. Do not create other objects. Do not change any other object in package $TMP. The class must be active and have no syntax error. The hidden tests must pass. The class must have no ATC priority 1 or priority 2 finding. Write your own ABAP Unit tests for the class. There are no open questions.