Visualizing Clone Cohesion and Coupling

  • Authors:
  • Zhen Ming Jiang;Ahmed E. Hassan;Richard C. Holt

  • Affiliations:
  • University of Waterloo;University of Victoria;University of Waterloo

  • Venue:
  • APSEC '06 Proceedings of the XIII Asia Pacific Software Engineering Conference
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Coupling and cohesion between subsystems are commonly studied metrics when analyzing the architecture of software systems. It is usually desirable for subsystems to have high cohesion within the subsystem and to have low coupling to other subsystems. High cohesion implies cohesive concerns and low coupling implies localized changes. We extend the ideas of coupling and cohesion to code cloning. A code clone is a segment of code that has been created through duplication of another piece of code. Previous research has shown that in some instances code cloning is desirable, whereas in other cases it is not. We believe that it is justifiable to have code cloning within subsystems (high cohesion), whereas it is not justifiable and likely not desirable to have it across subsystems (high coupling). We present an approach, which consists of a framework that generates and filters cloning data and a visualization technique which graphically highlights clone cohesion and coupling between architectural subsystems. Our approach can be used by developers to locate undesirable cloning in their software system. We demonstrate our approach through a case study on the SCSI drivers in the Linux kernel.