An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems

Databases have become one of the most important components in modern software systems. For example, web services, cloud computing systems, and online transaction processing systems all rely heavily on databases. To abstract the complexity of accessing a database, developers make use of Object-Relational Mapping (ORM) frameworks. ORM frameworks provide an abstraction layer between the application logic and the underlying database. Such abstraction layer automatically maps objects in Object-Oriented Languages to database records, which significantly reduces the amount of boilerplate code that needs to be written. Despite the advantages of using ORM frameworks, we observe several difficulties in maintaining ORM code (i.e., code that makes use of ORM frameworks) when cooperating with our industrial partner. After conducting studies on other open source systems, we find that such difficulties are common in other Java systems. Our study finds that i) ORM cannot completely encapsulate database accesses in objects or abstract the underlying database technology, thus may cause ORM code changes more scattered; ii) ORM code changes are more frequent than regular code, but there is a lack of tools that help developers verify ORM code at compilation time; iii) we find that changes to ORM code are more commonly due to performance or security reasons; however, traditional static code analyzers need to be extended to capture the peculiarities of ORM code in order to detect such problems. Our study highlights the hidden maintenance costs of using ORM frameworks, and provides some initial insights about potential approaches to help maintain ORM code. Future studies should carefully examine ORM code, especially given the rising use of ORM in modern software systems.

[1]  N. Cliff Ordinal methods for behavioral data analysis , 1996 .

[2]  Foutse Khomh,et al.  Towards understanding how developers spend their effort during maintenance activities , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[3]  Daqing Hou,et al.  An empirical analysis of the evolution of user-visible features in an integrated development environment , 2009, CASCON.

[4]  Ahmed E. Hassan,et al.  Detecting performance anti-patterns for applications developed using object-relational mapping , 2014, ICSE.

[5]  Christian Bauer,et al.  Hibernate in action , 2005 .

[6]  Tevfik Bultan,et al.  Data model property inference and repair , 2013, ISSTA.

[7]  T. D. Wilson Review of: Boslaugh, Sarah and Watters, Paul Andrew Statistics in a nutshell. Sebastopol, CA: O'Reilly, 2008 , 2008, Inf. Res..

[8]  Ahmed E. Hassan,et al.  Security versus performance bugs: a case study on Firefox , 2011, MSR '11.

[9]  Ahmed E. Hassan,et al.  Detecting Problems in the Database Access Code of Large Scale Systems - An Industrial Experience Report , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering Companion (ICSE-C).

[10]  Dong Qiu,et al.  An empirical analysis of the co-evolution of schema and code in database applications , 2013, ESEC/FSE 2013.

[11]  Richard C. Holt,et al.  Replaying development history to assess the effectiveness of change propagation tools , 2006, Empirical Software Engineering.

[12]  Paul A. Watters,et al.  Statistics in a nutshell , 2008 .

[13]  Colin Potts,et al.  Studying the evolution and enhancement of software features , 2000, Proceedings 2000 International Conference on Software Maintenance.

[14]  Anthony Cleve,et al.  Understanding Schema Evolution as a Basis for Database Reengineering , 2013, 2013 IEEE International Conference on Software Maintenance.

[15]  Ahmed E. Hassan,et al.  CacheOptimizer: helping developers configure caching frameworks for hibernate-based database-centric web applications , 2016, SIGSOFT FSE.

[16]  Paul A. Watters,et al.  Statistics in a nutshell - a desktop quick reference , 2008 .

[17]  Michael W. Godfrey,et al.  An Exploratory Study of the Evolution of Communicated Information about the Execution of Large Software Systems , 2011, 2011 18th Working Conference on Reverse Engineering.

[18]  Harald C. Gall,et al.  Do Code and Comments Co-Evolve? On the Relation between Source Code and Comment Changes , 2007, 14th Working Conference on Reverse Engineering (WCRE 2007).

[19]  Anthony Cleve,et al.  DAHLIA: A visual analyzer of database schema evolution , 2014, 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE).

[20]  Sallie M. Henry,et al.  Software Structure Metrics Based on Information Flow , 1981, IEEE Transactions on Software Engineering.

[21]  Dewayne E. Perry,et al.  Metrics and laws of software evolution-the nineties view , 1997, Proceedings Fourth International Software Metrics Symposium.

[22]  Stephen Travis Pope,et al.  A cookbook for using the model-view controller user interface paradigm in Smalltalk-80 , 1988 .

[23]  Carlo Curino,et al.  Graceful database schema evolution: the PRISM workbench , 2008, Proc. VLDB Endow..

[24]  Ahmed E. Hassan,et al.  On the relationship between comment update practices and Software Bugs , 2012, J. Syst. Softw..

[25]  Michael W. Godfrey,et al.  Evolution in open source software: a case study , 2000, Proceedings 2000 International Conference on Software Maintenance.

[26]  Benoît Dageville,et al.  Oracle's SQL Performance Analyzer , 2008, IEEE Data Eng. Bull..

[27]  Rod Johnson,et al.  J2EE Development Frameworks , 2005, Computer.

[28]  C. Borland,et al.  Effect Size , 2019, SAGE Research Methods Foundations.

[29]  Carlo Curino,et al.  Schema Evolution in Wikipedia - Toward a Web Information System Benchmark , 2008, ICEIS.

[30]  Tom Mens,et al.  Towards a survival analysis of database framework usage in Java projects , 2015, 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[31]  I. Cuthill,et al.  Effect size, confidence interval and statistical significance: a practical guide for biologists , 2007, Biological reviews of the Cambridge Philosophical Society.

[32]  Stéphane Ducasse,et al.  Analyzing software evolution through feature views: Research Articles , 2006 .

[33]  Tore Dybå,et al.  A systematic review of effect size in software engineering experiments , 2007, Inf. Softw. Technol..

[34]  Harald C. Gall,et al.  Software evolution observations based on product release history , 1997, 1997 Proceedings International Conference on Software Maintenance.

[35]  Tom Mens,et al.  Co-evolving code-related and database-related changes in a data-intensive software system , 2014, 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE).

[36]  Ahmed E. Hassan,et al.  Understanding the rationale for updating a function’s comment , 2008, 2008 IEEE International Conference on Software Maintenance.

[37]  Stéphane Ducasse,et al.  Analyzing software evolution through feature views , 2006, J. Softw. Maintenance Res. Pract..

[38]  Ahmed E. Hassan,et al.  Examining the evolution of code comments in PostgreSQL , 2006, MSR '06.

[39]  Ahmed E. Hassan,et al.  Predicting faults using the complexity of code changes , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[40]  Harald C. Gall,et al.  Analyzing the co-evolution of comments and source code , 2009, Software Quality Journal.

[41]  Annie I. Antón,et al.  Functional Paleontology: The Evolution of User-Visible System Services , 2003, IEEE Trans. Software Eng..

[42]  Jesús M. González-Barahona,et al.  The evolution of the laws of software evolution , 2013, ACM Comput. Surv..

[43]  Ahmed E. Hassan,et al.  An empirical study of dormant bugs , 2014, MSR 2014.

[44]  Benoît Dageville,et al.  Automatic SQL Tuning in Oracle 10g , 2004, VLDB.

[45]  Ali Shokoufandeh,et al.  On evaluating the efficiency of software feature development using algebraic manifolds , 2008, 2008 IEEE International Conference on Software Maintenance.

[46]  Connie U. Smith,et al.  Software performance antipatterns , 2000, WOSP '00.