Analyzing and Testing Code Flashcards
What is the technical point of view regarding ATC check variants?
They are ABAP development objects. Therefore they do belong to development packages and can be transported to other systems.
What is the purpose of creating an ATC check variant?
The purpose is to specify which checks should be performed on ABAP code within a specific context or project.
How do you create a new ATC check variant?
Navigate to the ABAP repository object, type “ATC” in the filter field (file -> new -> other) to find and choose ATC check variant. Enter the name and description of the check variant, ensure the required transport request is selected, and choose “Finish”.
What steps are involved in configuring an ATC check variant?
Select the desired checks to be performed in the Checks view.
Expand “Note Syntax and Activation” and choose specific checks, e.g., “Extended Program Check SLIN”.
Edit the parameters of the selected checks in the Parameters tab, adjusting values as necessary.
What does changing the value from 1 to 2 in the Parameters tab of the check detail view accomplish?
It adjusts the behavior of the selected check, potentially expanding the scope or stringency of the check.
What is the purpose of the Extended Check in ABAP Development?
The Extended Check complements the Syntax Check by offering optional source code checks. It provides additional checks beyond basic syntax validation.
How does the ABAP Test Cockpit (ATC) enhance the functionality of the Extended Check?
ATC offers a wide range of checks beyond syntax validation, including performance, security, adherence to guidelines, and programming conventions. The functionality of the Extended Check is integrated into ATC as one of many available checks.
What are Pseudo Comments and Pragmas used for in ABAP development?
Pseudo Comments and Pragmas are used to suppress certain findings generated by ABAP Test Cockpit (ATC), allowing developers to ignore non-critical or false alarm issues.
How are Pseudo Comments used to suppress ATC findings?
Pseudo Comments are specific comments added at the end of source code lines containing the finding. For example, “#EC NEEDED” is used to suppress Extended Check findings. Pseudo Comments are not visible to the ABAP syntax check or compiler but influence ATC.
What is the purpose of Pragmas in suppressing ATC findings?
Pragmas are keywords starting with ## that are added within ABAP statements to suppress specific findings. Pragmas are placed inside the ABAP statement, not after it. For example, pragma “##needed” is used to suppress certain findings.
How do Pragmas differ from Pseudo Comments in terms of visibility to the ABAP syntax check?
Pragmas are visible to the ABAP syntax check, allowing them to suppress certain warnings from the syntax check. Pseudo Comments, however, are not visible to the syntax check or compiler.
Where can developers find information on which technique to use for suppressing a specific ATC finding?
Developers can find details on ATC findings in the ATC Problems view. This view provides information on which technique, either Pseudo Comments or Pragmas, should be used to suppress a given finding.
What distinguishes a test class from an ordinary ABAP class?
A test class is distinguished by the addition “FOR TESTING” in the class definition.
What is the purpose of the “RISK LEVEL” addition in a test class?
The “RISK LEVEL” addition assigns a risk level to the test. It helps in categorizing the test based on its impact on system settings or persistent data.
The available risk level values are:
CRITICAL
DANGEROUS
HARMLESS
What is the purpose of the “DURATION” addition in a test class?
The “DURATION” addition specifies the expected execution time of the test. It helps in setting upper runtime limits for tests.
The available duration values are:
SHORT
MEDIUM
LONG
What is the requirement for a test class in ABAP Unit?
A test class should contain at least one test method. A test method must not have any parameters.
Where should local test classes be defined when inside a global ABAP class?
Local test classes should be defined on the Test Classes tab, unlike ordinary local classes which are defined on the Local Types tab.
What is the purpose of the global service class CL_ABAP_UNIT_ASSERT?
CL_ABAP_UNIT_ASSERT is used to report errors and influence test execution in ABAP Unit tests.
How is the method “fail()” of CL_ABAP_UNIT_ASSERT typically used?
The “fail()” method reports an unconditional error. It is usually surrounded by a control structure (e.g., IF…ENDIF or TRY…ENDTRY) to ensure it is reached under a specific condition.