Really Automatic Scalable Object-Oriented Reengineering

  • Marco Trudel
  • Carlo A. Furia
  • Martin Nordio
  • Bertrand Meyer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7920)

Abstract

Even when implemented in a purely procedural programming language, properly designed programs possess elements of good design that are expressible through object-oriented constructs and concepts. For example, placing structured types and the procedures operating on them together in the same module achieves a weak form of encapsulation that reduces inter-module coupling. This paper presents a novel technique, and a supporting tool AutoOO, that extracts such implicit design elements from C applications and uses them to build reengineered object-oriented programs. The technique is completely automatic: users only provide a source C program, and the tool produces an object-oriented application written in Eiffel with the same input/output behavior as the source. An extensive evaluation on 10 open-source programs (including the editor vim and the math library libgsl) demonstrates that our technique works on applications of significant size and builds reengineered programs exhibiting elements of good object-oriented design, such as low coupling and high cohesion of classes, and proper encapsulation. The reengineered programs also leverage advanced features such as inheritance, contracts, and exceptions to achieve a better usability and a clearer design. The tool AutoOO is freely available for download.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Achee, B.L., Carver, D.L.: Creating object-oriented designs from legacy FORTRAN code. JSS 39(2), 179–194 (1997)Google Scholar
  2. 2.
    Chikofsky, E.J., Cross II, J.H.: Reverse engineering and design recovery: A taxonomy. IEEE Software 7(1), 13–17 (1990)CrossRefGoogle Scholar
  3. 3.
    Ó Cinnéide, M., Tratt, L., Harman, M., Counsell, S., Moghadam, I.H.: Experimental assessment of software metrics using automated refactoring. In: ESEM, pp. 49–58. ACM (2012)Google Scholar
  4. 4.
    Ellison, C., Rosu, G.: An executable formal semantics of C with applications. In: POPL, pp. 533–544 (2012)Google Scholar
  5. 5.
    Ernst, M.D., Cockrell, J., Griswold, W.G., Notkin, D.: Dynamically discovering likely program invariants to support program evolution. IEEE TSE 27(2), 99–123 (2001)Google Scholar
  6. 6.
    Fanta, R., Rajlich, V.: Reengineering object-oriented code. In: Proceedings of the International Conference on Software Maintenance, pp. 238–246 (1998)Google Scholar
  7. 7.
    Fowler, M.: Refactoring: Improving the design of existing code. Addison-Wesley (1999)Google Scholar
  8. 8.
    Frakes, W.B., Kulczycki, G., Moodliar, N.: An empirical comparison of methods for reengineering procedural software systems to object-oriented systems. In: Mei, H. (ed.) ICSR 2008. LNCS, vol. 5030, pp. 376–389. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  9. 9.
    Gall, H., Klosch, R.: Finding objects in procedural programs: an alternative approach. In: WCRE, pp. 208–216. IEEE (1995)Google Scholar
  10. 10.
    Jacobson, I., Lindström, F.: Reengineering of old systems to an object-oriented architecture. In: OOPSLA, pp. 340–350. ACM (1991)Google Scholar
  11. 11.
    Kontogiannis, K., Patil, P.: Evidence driven object identification in procedural code. In: STEP, pp. 12–21. IEEE (1999)Google Scholar
  12. 12.
    Kovács, L., Voronkov, A.: Finding loop invariants for programs over arrays using a theorem prover. In: Chechik, M., Wirsing, M. (eds.) FASE 2009. LNCS, vol. 5503, pp. 470–485. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  13. 13.
    Livadas, P.E., Johnson, T.: A new approach to finding objects in programs. Journal of Software Maintenance 6(5), 249–260 (1994)CrossRefGoogle Scholar
  14. 14.
    Martin, J., Müller, H.A.: Strategies for migration from C to Java. In: CSMR, pp. 200–210. IEEE Computer Society (2001)Google Scholar
  15. 15.
    Meyer, B.: Object-Oriented Software Construction, 2nd edn. Prentice Hall (1997)Google Scholar
  16. 16.
    Millham, R.: An investigation: reengineering sequential procedure-driven software into object-oriented event-driven software through UML diagrams. In: COMPSAC, 2002, pp. 731–733 (2002)Google Scholar
  17. 17.
    Mossienko, M.: Automated Cobol to Java recycling. In: CSMR, pp. 40–50. IEEE (2003)Google Scholar
  18. 18.
    Nadera, B.S., Chitraprasad, D., Chandra, V.S.S.: The varying faces of a program transformation systems. ACM Inroads 3(1), 49–55 (2012)CrossRefGoogle Scholar
  19. 19.
    Necula, G.C., McPeak, S., Rahul, S.P., Weimer, W.: CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs. In: Nigel Horspool, R. (ed.) CC 2002. LNCS, vol. 2304, pp. 213–228. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  20. 20.
    Newcomb, P., Kotik, G.: Reengineering procedural into object-oriented systems. In: WCRE, pp. 237–249. IEEE (1995)Google Scholar
  21. 21.
    Novosoft. C2J: a C to Java translator (2001), http://www.novosoft-us.com/solutions/product_c2j.shtml
  22. 22.
    Sneed, H.: Planning the reengineering of legacy systems. IEEE Software 12(1), 24–34 (1995)CrossRefGoogle Scholar
  23. 23.
    Sneed, H.: Migrating from COBOL to Java. In: ICSM, pp. 1–7. IEEE (2010)Google Scholar
  24. 24.
    Sneed, H.: Migrating PL/I code to Java. In: CSMR, pp. 287–296. IEEE (2011)Google Scholar
  25. 25.
    Tangible Software Solutions. C++ to C# and C++ to Java, http://www.tangiblesoftwaresolutions.com/
  26. 26.
    Tilevich, E.: Translating C++ to Java. In: German Java Developers’ Conference Journal. Sun Microsystems Press (1997)Google Scholar
  27. 27.
    Trudel, M., Furia, C.A., Nordio, M., Meyer, B., Oriol, M.: C to O-O translation: Beyond the easy stuff. In: Proceedings of WCRE, pp. 19–28. IEEE (2012)Google Scholar
  28. 28.
    Wei, Y., Furia, C.A., Kazmin, N., Meyer, B.: Inferring better contracts. In: ICSE, pp. 191–200. ACM (2011)Google Scholar
  29. 29.
    Yeh, A., Harris, D., Reubenstein, H.: Recovering abstract data types and object instances from a conventional procedural language. In: WCRE, pp. 227–236 (1995)Google Scholar
  30. 30.
    Zhong, H., Thummalapenta, S., Xie, T., Zhang, L., Wang, Q.: Mining API mapping for language migration. In: ICSE, pp. 195–204 (2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Marco Trudel
    • 1
  • Carlo A. Furia
    • 1
  • Martin Nordio
    • 1
  • Bertrand Meyer
    • 1
    • 2
  1. 1.Chair of Software EngineeringETH ZurichSwitzerland
  2. 2.Software Engineering LaboratoryITMOSt. PetersburgRussia

Personalised recommendations