msr2016 - an empirical study on the practice of maintaining object-relational mapping code in java...
TRANSCRIPT
![Page 1: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/1.jpg)
1
An Empirical Study on the Practice of Maintaining Object-Relational Mapping
Code in Java Systems
Mohamed Nasser, Parminder Flora
Tse-Hsun(Peter) Chen Ahmed E. HassanWeiyi Shang Jinqiu Yang Michael W. Godfrey
![Page 2: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/2.jpg)
2
Databases are essential in modern large-scale software systems
Database
![Page 3: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/3.jpg)
3
Object-Relational Mapping (ORM) eliminates the gap between objects and SQL
Database
• Less boilerplate code • Object-DB translations are done automatically
JavaClasses
Benefits over raw SQLs
ORM
Much less code and shorter development time
![Page 4: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/4.jpg)
ORM provides another layer of abstraction
4
ORM
Database mapping code@Table(name = “user”)
Performance configurationquery.cache()
ORM query codeUser u = q.getSingleResult();
![Page 5: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/5.jpg)
5
ORM is not a silver bullet
Using ORM comes with some hidden costs…
We have been working on helping developers improve ORM code for the past few years
![Page 6: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/6.jpg)
Developers are often not aware of database access
Wow! I don’t need to worry
about DB code!
ORM code with performance anti-patterns
6
Bad system performance
The performance impact can be SIGNIFICANT (ICSE 2014)!
![Page 7: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/7.jpg)
ORM is hard to configure
7
Hundreds of ORM performance-related
configuration
Un-optimal ORM configuration is common and causes significantly performance
problem (TSE 2016)!
Bad system Performance if
configured incorrectly
![Page 8: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/8.jpg)
Studying maintenance activities of Java ORM code
8
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
![Page 9: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/9.jpg)
Studied Java systems
Large open-source e-commence system Enterprise system
9
Portal Content management system
![Page 10: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/10.jpg)
Studying maintenance activities of Java ORM code
10
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
![Page 11: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/11.jpg)
Lack of bug detection tool support for Java ORM
11
Coverity PMD Google error-prone
Facebook InferFindBugs
More than 67% of Java developers use ORM, but there is limited tooling support (ICSE SEIP 2016)
![Page 12: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/12.jpg)
Studying maintenance activities of Java ORM code
12
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
No! There is limited tooling
support
![Page 13: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/13.jpg)
Studying maintenance activities of Java ORM code
13
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
No! There is limited tooling
support
![Page 14: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/14.jpg)
ORM configurations are rarely tuned
14
Most ORM code changes are related to ORM queries (35%) and ORM database mapping code (55%)
ORM performance configurations are rarely tuned (less than 10%)
![Page 15: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/15.jpg)
Studying maintenance activities of Java ORM code
15
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
No! There is limited tooling
support
No! ORM configurations
are rarely tuned
![Page 16: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/16.jpg)
Studying maintenance activities of Java ORM code
16
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
No! There is limited tooling
support
No! ORM configurations
are rarely tuned
![Page 17: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/17.jpg)
ORM code changes are more scattered
17
Series10
2
4
6
8
10
12
14
ORMnon-ORM
Med
ian
mod
ified
file
s in
a co
mm
it
Such high change scatteredness may be caused by ORM’s inability to completely
abstract DB accesses
![Page 18: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/18.jpg)
Studying maintenance activities of Java ORM code
18
Expect: ORM-related changes are localized
Expect: Frequently tuning configurations
Expect: Tooling support due to ORM
popularity
No! There is limited tooling
support
No! ORM configurations
are rarely tuned
No! ORM code changes are
more scattered
![Page 19: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/19.jpg)
19
![Page 20: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/20.jpg)
20
![Page 21: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/21.jpg)
21
![Page 22: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/22.jpg)
22
![Page 23: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/23.jpg)
23
![Page 24: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/24.jpg)
24
![Page 25: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/25.jpg)
25
![Page 26: MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational Mapping Code in Java Systems](https://reader036.vdocuments.us/reader036/viewer/2022070523/58edc5d41a28ab87578b45bf/html5/thumbnails/26.jpg)
26