Skip to Content

Why Code Coverage?

Testers from Test teams/organizations test the Software application/product using the test cases/test techniques, but it’s very much essential to measure (how much in terms of percentage & What part of) the code that gets tested through the test cases or test techniques to ensure that most significant part of code base developed by the development is executed by tester’s test cases or approaches.

Though the test organizations develop test cases based on the traceability matrix (where requirements are mapped), there could be a chance to miss out the areas that are not tested by the test cases/test techniques, which leads to the defect leakage to the customer landscape.

In order to prevent defect leakage to the customers & to improve quality of Testing, Code Coverage should be implemented during test execution.

What is Code Coverage?

Code coverage is a measure used in software testing, which would describe the level or degree to which source code of a program has been tested. There are various code coverage tools available in the Industry.

SCOV is a transaction or a code coverage tool provided by SAP as part of the ABAP engine.

When to Activate Code Coverage tool?

Code Coverage tool can be activated in test systems during test execution during new development testing or during a New Release & it can also be measured when there are major code changes during a support pack, in order to understand that if the changed areas have good code coverage.

Benefits of Code Coverage

  • Finds the Cumulative Execution Percentage for the ABAP Packages
  • By measuring code coverage there is a possibility to identify the presence of dead code or code which is not executed completely.
  • Helps to increase test coverage.

How to Measure Code Coverage in SAP ABAP Systems?

Image1.png

  • System would display the code coverage details for the request ABAP package/s. Please note: Initially KPIs must be agreed (with stakeholders or whomsoever  as per the organization needs)upon as What %age of Code is Okay to be executed, meaning , if a package has achieved statement coverage of 60% it should be considered as okay and a package which has achieved anything less than 60% should be considered for Improvement.
  • Code Coverage at the program object level is depicted through color codes as shown below. Green Colored code is executed by testing and Red Colored is not executed during testing

Picture1.jpg

Next Steps after Measuring Code Coverage

Testers to contact the development colleagues to understand that the code which is not executed by testing is a dead code or required code.

  • If it’s a required code that should be executed, Create and execute test cases, so that the red colored code is executed by the newly created test case.
  • Else if its a dead Code, testers to request the developers to comment or delete the dead code.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply