Skip to main content

Cloning in DSLs: Experiments with OCL

  • Conference paper
Software Language Engineering (SLE 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6940))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Google Scholar 

  2. 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)

    Article  Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. 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)

    Google Scholar 

  5. van Deursen, A., Klint, P.: Little languages: Little maintenance. Journal of Software Maintenance: Research and Practice 10(2), 75–92 (1998)

    Article  Google Scholar 

  6. 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)

    Article  Google Scholar 

  7. 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)

    Google Scholar 

  8. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Boston (1995)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. Johnson, J.H.: Substring matching for clone detection and change tracking. In: International Conference on Software Maintenance, pp. 120–126 (1994)

    Google Scholar 

  12. Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: A model transformation tool. Science of Computer Programming 72(1-2), 31–39 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  13. 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)

    Google Scholar 

  14. 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)

    Article  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. 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)

    Google Scholar 

  18. 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)

    Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Google Scholar 

  21. 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)

    Article  MathSciNet  MATH  Google Scholar 

  22. Schmidt, D.: Guest editor’s introduction: Model-driven engineering. IEEE Computer 39(2), 25–31 (2006)

    Article  Google Scholar 

  23. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics