Dsc+Mock: a test case + mock class generator in support of coding against interfaces

  • Authors:
  • Mainul Islam;Christoph Csallner

  • Affiliations:
  • University of Texas at Arlington, Arlington, TX;University of Texas at Arlington, Arlington, TX

  • Venue:
  • Proceedings of the Eighth International Workshop on Dynamic Analysis
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Coding against interfaces is a powerful technique in object-oriented programming. It decouples code and enables independent development. However, code decoupled via interfaces poses additional challenges for testing and dynamic execution, as not all pieces of code that are necessary to execute a piece of code may be available. For example, a client class may be coded against several interfaces. For testing, however, no classes may be available that implement the interfaces. This means that, to support testing, we need to generate mock classes along with test cases. Current test case generators do not fully support this kind of independent development and testing. In this paper, we describe a novel technique for generating test cases and mock classes for object-oriented programs that are coded against interfaces. We report on our initial experience with an implementation of our technique for Java. Our prototype implementation achieved higher code coverage than related tools that do not generate mock classes, such as Pex.