Test coverage analysis of object-oriented programs

Rajib Mall, Debasis Samanta, E. S. F. Najumudheen · 2011

Test coverage analysis is a commonly used method to determine the effectiveness of software testing. Coverage analysis typically helps to identify any inadequacies of a test suite, and provides an insight into those implementation aspects that have not been adequately tested. Coverage analysis techniques for procedural programs can be used to determine the coverage of statements, logical decisions, and data-flow paths. But object-oriented features such as inheritance, polymorphism, and exception handling, give rise to complex relationships and new types of dependencies among classes, which are not adequately addressed by the existing coverage analysis techniques. In this thesis, we propose a model-based test coverage analysis technique that can effectively exercise the various procedural and object-oriented features. To perform the coverage analysis effectively, we first propose a suitable program model, named Call-based Object-Oriented System Dependence Graph. The model has been designed to serve as an intermediate program representation for coverage analysis, and is constructed by using static code analysis. Next, we propose a model-based technique for test coverage analysis of object-oriented programs, named Coverage On-the-Fly. Our technique consists of three phases. In the first phase, our technique constructs the proposed model for a program, in the second, it instruments the source code at specific program points, and in the third, it executes the instrumented code with the test suite, maps the executed features onto the model, marks the model elements on-the-fly , and examines the status of the elements of the constructed model to calculate various coverage measures, both procedural and object-oriented. Our technique does not store the execution traces in a file or database. We further propose an augmented program model to represent exception handling in object-oriented programs. We apply our coverage analysis technique to the augmented model to determine the coverage of exception handling features. We have implemented our coverage analysis technique in a prototype tool. Using the tool, we have carried out several experimental studies and compared the results with those obtained using open-source coverage analysis tools. Our studies point out the inadequacies of traditional coverage measures in exercising object-oriented features.

Read the paper · More papers on PaperTik