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

Authors: Tse-Hsun Chen Weiyi Shang Jinqiu Yang Ahmed E. Hassan Michael W. Godfrey Mohamed Nasser Parminder Flora

Venue: MSR   2016 IEEE/ACM 13th Working Conference on Mining Software Repositories (MSR), pp. 165-176, 2016

Year: 2016

Abstract: 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.

BibTeX:

@inproceedings{tse-hsunchen2016aesotpomomcijs,
    author = "Tse-Hsun Chen and Weiyi Shang and Jinqiu Yang and Ahmed E. Hassan and Michael W. Godfrey and Mohamed Nasser and Parminder Flora",
    title = "An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems",
    year = "2016",
    pages = "165-176",
    booktitle = "Proceedings of 2016 IEEE/ACM 13th Working Conference on Mining Software Repositories (MSR)"
}

Plain Text:

Tse-Hsun Chen, Weiyi Shang, Jinqiu Yang, Ahmed E. Hassan, Michael W. Godfrey, Mohamed Nasser, and Parminder Flora, "An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems," 2016 IEEE/ACM 13th Working Conference on Mining Software Repositories (MSR), pp. 165-176