Skip to main content
Erschienen in: Empirical Software Engineering 2/2016

01.04.2016

Understanding and addressing exhibitionism in Java empirical research about method accessibility

verfasst von: Santiago A. Vidal, Alexandre Bergel, Claudia Marcos, J. Andrés Díaz-Pace

Erschienen in: Empirical Software Engineering | Ausgabe 2/2016

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Information hiding is a positive consequence of properly defining component interfaces. Unfortunately, determining what should constitute a public interface remains difficult. We have analyzed over 3.6 million lines of Java open-source code and found that on the average, at least 20 % of defined methods are over-exposed, thus threatening public interfaces to unnecessary exposure. Such over-exposed methods may have their accessibility reduced to exactly reflect the method usage. We have identified three patterns in the source code to identify over-exposed methods. We also propose an Eclipse plugin to guide practitioners in identifying over-exposed methods and refactoring their applications. Our plugin has been successfully used to refactor a non-trivial application.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Anhänge
Nur mit Berechtigung zugänglich
Fußnoten
9
Note that a private method cannot be overridden.
 
10
These scatterplots are not reported in this paper.
 
11
ArgoUML, SweetHome3D, FreeMind, Ant, Cobertura, Findbugs, Jajuk, JStock, PMD, TuxGuitar
 
15
version Juno (4.2)
 
16
version 9.0.4
 
17
version 7.0.1
 
18
This happens when you call a method that does not exist and you ask Eclipse to automatically generate the missing method.
 
20
Experiments were conducted on a MacBook Air, CPU 1.8 GHz Intel Core 5. 4Gb of memory.
 
25
We obtained the value 35 % by computing the average of the IGAM metric from Fig. 3 in Zoller and Schmolitzky (2012).
 
Literatur
Zurück zum Zitat Bacon DF, Sweeney PF (1996). In: Anderson L, Coplien J (eds) Fast static analysis of c++ virtual function calls. OOPSLA ACM, pp 324–341 Bacon DF, Sweeney PF (1996). In: Anderson L, Coplien J (eds) Fast static analysis of c++ virtual function calls. OOPSLA ACM, pp 324–341
Zurück zum Zitat Binkley D, Ceccato M, Harman M, Ricca F, Tonella P (2005) Automated refactoring of object oriented code into aspects In: Software Maintenance, 2005. ICSM’05. In: Proceedings of the 21st IEEE International Conference on, pp 27–36. doi:10.1109/ICSM.2005.27 Binkley D, Ceccato M, Harman M, Ricca F, Tonella P (2005) Automated refactoring of object oriented code into aspects In: Software Maintenance, 2005. ICSM’05. In: Proceedings of the 21st IEEE International Conference on, pp 27–36. doi:10.​1109/​ICSM.​2005.​27
Zurück zum Zitat Booch G (2004) Object-Oriented Analysis and Design with Applications (3rd Edition). Addison Wesley Longman Publishing Co., Inc., Redwood Booch G (2004) Object-Oriented Analysis and Design with Applications (3rd Edition). Addison Wesley Longman Publishing Co., Inc., Redwood
Zurück zum Zitat Bouillon P, Grokinsky E, Steimann F (2008) Controlling accessibility in agile projects with the access modifier modifier. In: Paige RF, Meyer B (eds) TOOLS (46), Springer, Lecture Notes in Business Information Processing, vol 11, pp 41–59 Bouillon P, Grokinsky E, Steimann F (2008) Controlling accessibility in agile projects with the access modifier modifier. In: Paige RF, Meyer B (eds) TOOLS (46), Springer, Lecture Notes in Business Information Processing, vol 11, pp 41–59
Zurück zum Zitat Briand LC, Wst J, Lounis H (1999) Using coupling measurement for impact analysis in object-oriented systems. In: ICSM, pp 475–482 Briand LC, Wst J, Lounis H (1999) Using coupling measurement for impact analysis in object-oriented systems. In: ICSM, pp 475–482
Zurück zum Zitat Chowdhury I, Zulkernine M (2010) Can complexity, coupling, and cohesion metrics be used as early indicators of vulnerabilities? In: Proceedings of the 2010 ACM Symposium on Applied Computing. ACM, New York, pp 1963–1969. SAC ’10 Chowdhury I, Zulkernine M (2010) Can complexity, coupling, and cohesion metrics be used as early indicators of vulnerabilities? In: Proceedings of the 2010 ACM Symposium on Applied Computing. ACM, New York, pp 1963–1969. SAC ’10
Zurück zum Zitat Fowler M (2002) Public versus published interfaces. IEEE Softw 19(2):18–19CrossRef Fowler M (2002) Public versus published interfaces. IEEE Softw 19(2):18–19CrossRef
Zurück zum Zitat Liang D, Pennings M, Harrold MJ (2001) Extending and evaluating flow-insenstitive and context-insensitive points-to analyses for Java. In: Proceedings of the, 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, ACM, New York, NY, USA, PASTE ’01, pp 73–79. doi:10.1145/379605.379676 Liang D, Pennings M, Harrold MJ (2001) Extending and evaluating flow-insenstitive and context-insensitive points-to analyses for Java. In: Proceedings of the, 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, ACM, New York, NY, USA, PASTE ’01, pp 73–79. doi:10.​1145/​379605.​379676
Zurück zum Zitat Martin RC (2002) Agile Software Development.Principles,Patterns, and Practices. Prentice-Hall Martin RC (2002) Agile Software Development.Principles,Patterns, and Practices. Prentice-Hall
Zurück zum Zitat Meyer B (2009) Touch of class: learning to program well with objects and contracts, 1st edn. Springer Publishing Company, Incorporated Meyer B (2009) Touch of class: learning to program well with objects and contracts, 1st edn. Springer Publishing Company, Incorporated
Zurück zum Zitat Mockus A, Nagappan N, Dinh-Trong TT (2009) Test coverage and post-verification defects: A multiple case study. In: Proceedings of the 2009 3rd International Symposium on Empirical Software Engineering and Measurement, IEEE Computer Society, Washington, DC, USA, ESEM ’09, pp 291–301. doi:10.1109/ESEM.2009.5315981 Mockus A, Nagappan N, Dinh-Trong TT (2009) Test coverage and post-verification defects: A multiple case study. In: Proceedings of the 2009 3rd International Symposium on Empirical Software Engineering and Measurement, IEEE Computer Society, Washington, DC, USA, ESEM ’09, pp 291–301. doi:10.​1109/​ESEM.​2009.​5315981
Zurück zum Zitat Müller A (2010) Bytecode analysis for checking Java access modifiers. In: Work in Progress and Poster Session, 8th Int. Conf. on Principles and Practice of Programming in Java (PPPJ, 2010), Vienna, Austria Müller A (2010) Bytecode analysis for checking Java access modifiers. In: Work in Progress and Poster Session, 8th Int. Conf. on Principles and Practice of Programming in Java (PPPJ, 2010), Vienna, Austria
Zurück zum Zitat Patenaude JF, Merlo E, Dagenais M (1999) Extending software quality assessment techniques to Java systems In: IWPC. IEEE Computer Society, Lagu, B, p 49 Patenaude JF, Merlo E, Dagenais M (1999) Extending software quality assessment techniques to Java systems In: IWPC. IEEE Computer Society, Lagu, B, p 49
Zurück zum Zitat Riel A (1996) Object-oriented design heuristics. Addison Wesley, Boston Riel A (1996) Object-oriented design heuristics. Addison Wesley, Boston
Zurück zum Zitat Schafer M, Thies A, Steimann F, Tip F (2012) A comprehensive approach to naming and accessibility in refactoring Java programs. IEEE Trans Softw Eng 38(6):1233–1257. doi:10.1109/TSE.2012.13 CrossRef Schafer M, Thies A, Steimann F, Tip F (2012) A comprehensive approach to naming and accessibility in refactoring Java programs. IEEE Trans Softw Eng 38(6):1233–1257. doi:10.​1109/​TSE.​2012.​13 CrossRef
Zurück zum Zitat Siegel S, Castellan NJ (1988) Nonparametric statistics for the behavioral sciences, 2nd edn. McGraw-Hill, New York Siegel S, Castellan NJ (1988) Nonparametric statistics for the behavioral sciences, 2nd edn. McGraw-Hill, New York
Zurück zum Zitat Singh S, Kahlo n KS (2011) Effectiveness of encapsulation and object-oriented metrics to refactor code and identify error prone classes using bad smells. ACM SIGSOFT Softw Eng Notes 36(5):1–10CrossRef Singh S, Kahlo n KS (2011) Effectiveness of encapsulation and object-oriented metrics to refactor code and identify error prone classes using bad smells. ACM SIGSOFT Softw Eng Notes 36(5):1–10CrossRef
Zurück zum Zitat Singh V, Bhattacherjee V, Bhattacharjee S (2012) An analysis of dependency of coupling on software defects. ACM SIGSOFT Softw Eng. Notes 37(1):1–6CrossRef Singh V, Bhattacherjee V, Bhattacharjee S (2012) An analysis of dependency of coupling on software defects. ACM SIGSOFT Softw Eng. Notes 37(1):1–6CrossRef
Zurück zum Zitat Steimann F, Thies A (2009) From public to private to absent: Refactoring Java programs under constrained accessibility. In: Drossopoulou S (ed) Lecture Notes in Computer Science, vol 5653. ECOOP, Springer, pp 419–443 Steimann F, Thies A (2009) From public to private to absent: Refactoring Java programs under constrained accessibility. In: Drossopoulou S (ed) Lecture Notes in Computer Science, vol 5653. ECOOP, Springer, pp 419–443
Zurück zum Zitat Tempero E, Anslow C, Dietrich J, Han T, Li J, Lumpe M, Melton H, Noble J (2010) The qualitas corpus:A curated collection of Java code for empirical studies. In: Software Engineering Conference (APSEC), 2010 17th Asia Pacific, pp 336–345 Tempero E, Anslow C, Dietrich J, Han T, Li J, Lumpe M, Melton H, Noble J (2010) The qualitas corpus:A curated collection of Java code for empirical studies. In: Software Engineering Conference (APSEC), 2010 17th Asia Pacific, pp 336–345
Zurück zum Zitat Thies A, Bodden E (2012) Refaflex: safer refactorings for reflective Java programs.In: Proceedings of the 2012 International Symposium on Software Testing and Analysis, ACM, New York, NY, USA, ISSTA 2012 Thies A, Bodden E (2012) Refaflex: safer refactorings for reflective Java programs.In: Proceedings of the 2012 International Symposium on Software Testing and Analysis, ACM, New York, NY, USA, ISSTA 2012
Zurück zum Zitat Wohlin C, Runeson P, Höst M, Ohlsson MC, Regnell B, Wesslén A (2000) Experimentation in software engineering: an introduction. Kluwer Academic Publishers, NorwellCrossRefMATH Wohlin C, Runeson P, Höst M, Ohlsson MC, Regnell B, Wesslén A (2000) Experimentation in software engineering: an introduction. Kluwer Academic Publishers, NorwellCrossRefMATH
Zurück zum Zitat Zoller C, Schmolitzky A (2012) Measuring inappropriate generosity with access modifiers in Java systems. In: Proceedings of the 2012 Joint Conference of the 22Nd International Workshop on Software Measurement and the 2012 Seventh International Conference on Software Process and Product Measurement. doi:10.1109/IWSM-MENSURA.2012.15. IEEE Computer Society, Washington, DC, USA, IWSM-MENSURA ’12, pp 43–52 Zoller C, Schmolitzky A (2012) Measuring inappropriate generosity with access modifiers in Java systems. In: Proceedings of the 2012 Joint Conference of the 22Nd International Workshop on Software Measurement and the 2012 Seventh International Conference on Software Process and Product Measurement. doi:10.​1109/​IWSM-MENSURA.​2012.​15. IEEE Computer Society, Washington, DC, USA, IWSM-MENSURA ’12, pp 43–52
Metadaten
Titel
Understanding and addressing exhibitionism in Java empirical research about method accessibility
verfasst von
Santiago A. Vidal
Alexandre Bergel
Claudia Marcos
J. Andrés Díaz-Pace
Publikationsdatum
01.04.2016
Verlag
Springer US
Erschienen in
Empirical Software Engineering / Ausgabe 2/2016
Print ISSN: 1382-3256
Elektronische ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-015-9365-9

Weitere Artikel der Ausgabe 2/2016

Empirical Software Engineering 2/2016 Zur Ausgabe

Premium Partner