Abstract
Code cloning (i.e., similar code fragments) in general purpose languages has been a major focus of the research community. For domain specific languages (DSLs), cloning related to domain-specific graphical languages has also been considered. This paper focuses on domain-specific textual languages in an effort to evaluate cloning in these DSLs where instances of such DSLs allow for less code to express domain-specific features, but potentially more frequently used code constructs. We suggest potential application scenarios of using clone detection for the maintenance of DSL code. We introduce a clone detection mechanism using a Model Driven Engineering (MDE) based approach to evaluate the extent of cloning in an initial DSL (i.e., the Object Constraint Language (OCL)). The evaluation reveals the existence of cloning in OCL, which suggests the relevance and potential applications of clone detection and analysis in DSLs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Baxter, I., Yahin, A., Moura, L., Sant’Anna, M., Bier, L.: Clone detection using abstract syntax trees. In: International Conference on Software Maintenance, pp. 368–377 (1998)
Bellon, S., Koschke, R., Antoniol, G., Krinke, J., Merlo, E.: Comparison and evaluation of clone detection tools. IEEE Transactions on Software Engineering 33(9), 577–591 (2007)
Chimiak-Opoka, J.: OCLLib, OCLUnit, OCLDoc: Pragmatic Extensions for the Object Constraint Language. In: Schürr, A., Selic, B. (eds.) MODELS 2009. LNCS, vol. 5795, pp. 665–669. Springer, Heidelberg (2009)
Deissenboeck, F., Hummel, B., Juergens, E., Pfaehler, M., Schaetz, B.: Model clone detection in practice. In: International Workshop on Software Clones, pp. 57–64 (2010)
van Deursen, A., Klint, P.: Little languages: Little maintenance. Journal of Software Maintenance: Research and Practice 10(2), 75–92 (1998)
Duala-Ekoko, E., Robillard, M.: Clone region descriptors: Representing and tracking duplication in source code. ACM Transactions of Software Engineering and Methodology 20(1), 1–31 (2010)
Frias, L., Queralt, A., Olivé, A.: Eu-rent car rentals specification. Tech. Rep. LSI-03-59-R, Technical University of Catalonia - Departament de Llenguatges i Sistemes Informatics (2003)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Boston (1995)
Gruska, N., Wasylkowski, A., Zeller, A.: Learning from 6,000 projects: Lightweight cross-project anomaly detection. In: International Symposium on Software Testing and Analysis, pp. 119–130 (2010)
Jiang, L., Misherghi, G., Su, Z., Glondu, S.: DECKARD: Scalable and accurate tree-based detection of code clones. In: International Conference on Software Engineering, pp. 96–105 (2007)
Johnson, J.H.: Substring matching for clone detection and change tracking. In: International Conference on Software Maintenance, pp. 120–126 (1994)
Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: A model transformation tool. Science of Computer Programming 72(1-2), 31–39 (2008)
Jouault, F., Bézivin, J., Kurtev, I.: TCS: A DSL for the specification of textual concrete syntaxes in model engineering. In: Jarzabek, S., Schmidt, D.C., Veldhuizen, T.L. (eds.) International Conference on Generative Programming and Component Engineering, pp. 249–254 (2006)
Kamiya, T., Kusumoto, S., Inoue, K.: CCFinder: A multilinguistic token-based code clone detection system for large scale source code. IEEE Transactions on Software Engineering 28(7), 654–670 (2002)
Kim, H., Jung, Y., Kim, S., Yi, K.: MeCC: Memory comparison-based clone detector. In: Taylor, R.N., Gall, H., Medvidovic, N. (eds.) International Conference on Software Engineering, pp. 301–310 (2011)
Kim, M., Sazawal, V., Notkin, D., Murphy, G.: An empirical study of code clone genealogies. In: European Software Engineering Conference held Jointly with the ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 187–196 (2005)
Lämmel, R., Pek, E.: Vivisection of a non-executable, domain-specific language - understanding (the usage of) the P3P language. In: IEEE International Conference on Program Comprehension, pp. 104–113 (2010)
Li, H., Thompson, S.: Clone detection and removal for Erlang/OTP within a refactoring environment. In: Workshop on Partial Evaluation and Program Manipulation, pp. 169–178 (2009)
Li, Z., Lu, S., Myagmar, S., Zhou, Y.: CP-Miner: A tool for finding copy-paste and related bugs in operating system code. In: Symposium on Operating Systems Design and Implementation, pp. 289–302 (2004)
Pham, N.H., Nguyen, H.A., Nguyen, T.T., Al-Kofahi, J.M., Nguyen, T.N.: Complete and accurate clone detection in graph-based models. In: International Conference on Software Engineering, pp. 276–286 (2009)
Roy, C., Cordy, J., Koschke, R.: Comparison and evaluation of code clone detection techniques and tools: A qualitative approach. Science of Computer Programming 74(7), 470–495 (2009)
Schmidt, D.: Guest editor’s introduction: Model-driven engineering. IEEE Computer 39(2), 25–31 (2006)
Tisi, M., Jouault, F., Fraternali, P., Ceri, S., Bézivin, J.: On the Use of Higher-Order Model Transformations. In: Paige, R.F., Hartman, A., Rensink, A. (eds.) ECMDA-FA 2009. LNCS, vol. 5562, pp. 18–33. Springer, Heidelberg (2009)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Tairas, R., Cabot, J. (2012). Cloning in DSLs: Experiments with OCL. In: Sloane, A., Aßmann, U. (eds) Software Language Engineering. SLE 2011. Lecture Notes in Computer Science, vol 6940. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28830-2_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-28830-2_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-28829-6
Online ISBN: 978-3-642-28830-2
eBook Packages: Computer ScienceComputer Science (R0)