An approach for class testing from class contracts

  • Authors:
  • Atul Gupta

  • Affiliations:
  • Indian Institute of Information Technology, Design & Manufacturing, Jabalpur, MP, India

  • Venue:
  • ATVA'10 Proceedings of the 8th international conference on Automated technology for verification and analysis
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Adequate testing of a class requires testing valid and invalid sequences of class method interactions. In this paper, we show that class contracts can be used to generate effective state based unit tests algorithmically for testing meaningful interactions between methods. Using an abstract state configuration for the object and an initial abstract state, we incrementally search for the methods those can be invoked in the current state and compute resulting abstract states. The same is repeated for each newly generated abstract state till no more new abstract states are generated. This search generates a directed graph from which test sequences can easily be obtained. We applied the proposed approach to test three Java programs seeded with mutation faults and obtained high mutation scores.