Presentation is loading. Please wait.

Presentation is loading. Please wait.

Make Software Modular. And… Efficient

Similar presentations


Presentation on theme: "Make Software Modular. And… Efficient"— Presentation transcript:

1 Make Software Modular. And… Efficient
Make Software Modular! And… Efficient? s An Empirical Evaluation of OSGi Dependencies Best Practices Lina Ochoa, Thomas Degueule & Jurgen Vinju Mining Software Repositories (MSR) 2018 S.W.A.T.

2 “Engineers are very pragmatic; they may admire beauty, but they seek utility. I tried to find an explanation of why “beauty” was useful.” - David L. Parnas

3 Modularity in software
Modular software Non-modular software

4 How modularity works in Java language?
- Java is one of the most popular programming languages (#1 acc. TIOBE 2018)

5 Modularity in Java + OSGi
OSGi document: 450 pages! mod.sort pkg.sort.api pkg.sort.impl mod.students mod.math pkg.math.api pkg.math.impl pkg.students.api Bundle-ManifestVersion: 2 Bundle-Name: Lib1 Bundle-SymbolicName: a.lib1 Bundle-Version: release-2 Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.package1;version=“0.0.1” Require-Bundle: a.lib2;bundle-version=“2.1.1” Import-Package: org.package4;version=“[1.1,1.5]” DynamicImport-Package: org.package5 Require-Bundle pkg.students.impl Import-Package

6 What OSGi best practices are advised?

7 OSGi best practices B1: Prefer package-level dependencies
B2: Minimize dependencies B3: Export only needed packages B4: Use versions when possible B5: Import all needed packages B6: Avoid dynamic import of packages B7: Separate implementation, API, and OSGi-specific packages B8: Use semantic versioning B9: Avoid splitting packages B10: Declare additional dependencies in the bundle classpath B11: Import exported API packages

8 B1: Prefer package-level dependencies
mod.sort pkg.sort.api pkg.sort.impl mod.students mod.othersort pkg.sort.api pkg.sort.otherimpl pkg.students.api Require-Bundle Import-Package pkg.students.impl Import-Package

9 Are OSGi best practices being followed?

10 Best practices in practice
372 modules B1 58% of the bundles use Require-Bundle. B2 83% of packages required through Require-Bundle are never used. B3 15% of exported packages are imported through Import-Package. 80% of exported packages are required through Require-Bundle.

11 Do OSGi best practices have an impact on the system efficiency?

12 Studied corpus C0 C6 C1 R6 R1 372 modules Corpora Results Benchmark
Transform Compare Benchmark C0 C6 C1 R6 R1 Results Corpora 372 modules Rascal MPL

13 Best practices impact on…
Classpath size Median relative difference: 0% – 23% Resolution time Median relative difference: ±13%

14 “I tried to find an explanation of why “beauty” was useful.”
- David L. Parnas

15 Make Software Modular. And… Efficient
Make Software Modular! And… Efficient? An Empirical Evaluation of OSGi Dependencies Best Practices (MSR 2018) Lina Ochoa Thomas Degueule Jurgen Vinju 11 OSGi best practices Best practices are not widely followed Best practices impact on classpath size (0-23%) and performance (±13%) “Modularity without regret.”


Download ppt "Make Software Modular. And… Efficient"

Similar presentations


Ads by Google