An empirical study on limits of clone unification using generics

  • Basit H
  • Rajapakse D
  • Jarzabek S
  • 13


    Mendeley users who have this article in their library.
  • 10


    Citations of this article.


Abstract. Generics (templates) attempt to unify similar program structures to avoid explosion of redundant code. How well do generics serve this purpose in practice? We try to answer this question through empirical analysis from two case studies. First, we analyzed the Java Buffer library in which 68% of the code was redundant due to cloning. We were able to remove only 40% of the redundant code using the proposed Java generics. Unification failed because the variations between cloned classes were either non-type parametric or nonparametric. To analyze whether this problem is specific to Java generics, we investigated the C++ Standard Template Library (STL), an exemplary application of C++ templates, as our second case study. Even though C++ templates are more powerful, we still found substantial cloning. We believe that we are dealing with a fundamental phenomenon that will cause many other class libraries and application programs to suffer from the code redundancy problem.

Get free article suggestions today

Mendeley saves you time finding and organizing research

Sign up here
Already have an account ?Sign in

Find this document

  • SCOPUS: 2-s2.0-84885384152
  • SGR: 84885384152
  • PUI: 370066867
  • ISBN: 9781627486590


  • Hamid Abdul Basit

  • Damith C Rajapakse

  • Stan Jarzabek

Cite this document

Choose a citation style from the tabs below

Save time finding and organizing research with Mendeley

Sign up for free