Skip to main content

2020 | OriginalPaper | Buchkapitel

String Representations of Java Objects: An Empirical Study

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

search-config
loading …

Abstract

String representations of objects are used for many purposes during software development, including debugging and logging. In Java, each class can define its own string representation by overriding the toString method. Despite their usefulness, these methods have been neglected by researchers so far. In this paper, we describe an empirical study of toString methods performed on a corpus of Java files. We are asking what portion of classes defines toString, how are these methods called, and what do they look like. We found that the majority of classes do not override the default (not very useful) implementation. A large portion of the toString method calls is implicit (using a concatenation operator). The calls to toString are used for nested string representation building, exception handling, in introspection libraries, for type conversion, and in test code. A typical toString implementation consists of literals, field reads, and string concatenation. Around one third of the string representation definitions is schematic. Half of such schematic implementations do not include all member variables in the printout. This fact motivates the future research direction – fully automated generation of succinct toString methods.

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

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!

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"

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!

Literatur
1.
2.
Zurück zum Zitat Chiş, A., Nierstrasz, O., Syrel, A., Gîrba, T.: The moldable inspector. In: 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2015, pp. 44–60. ACM, New York (2015). https://doi.org/10.1145/2814228.2814234 Chiş, A., Nierstrasz, O., Syrel, A., Gîrba, T.: The moldable inspector. In: 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2015, pp. 44–60. ACM, New York (2015). https://​doi.​org/​10.​1145/​2814228.​2814234
3.
Zurück zum Zitat Dyer, R., Rajan, H., Nguyen, H.A., Nguyen, T.N.: Mining billions of AST nodes to study actual and potential usage of Java language features. In: Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, pp. 779–790. ACM, New York (2014). https://doi.org/10.1145/2568225.2568295 Dyer, R., Rajan, H., Nguyen, H.A., Nguyen, T.N.: Mining billions of AST nodes to study actual and potential usage of Java language features. In: Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, pp. 779–790. ACM, New York (2014). https://​doi.​org/​10.​1145/​2568225.​2568295
4.
Zurück zum Zitat Kalliamvakou, E., Gousios, G., Blincoe, K., Singer, L., German, D.M., Damian, D.: The promises and perils of mining GitHub. In: Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014, pp. 92–101. ACM, New York (2014). https://doi.org/10.1145/2597073.2597074 Kalliamvakou, E., Gousios, G., Blincoe, K., Singer, L., German, D.M., Damian, D.: The promises and perils of mining GitHub. In: Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014, pp. 92–101. ACM, New York (2014). https://​doi.​org/​10.​1145/​2597073.​2597074
5.
Zurück zum Zitat Lemay, M.J.: Understanding Java usability by mining GitHub repositories. In: 9th Workshop on Evaluation and Usability of Programming Languages and Tools (PLATEAU 2018). OpenAccess Series in Informatics (OASIcs), vol. 67, pp. 2:1–2:9. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany (2019). https://doi.org/10.4230/OASIcs.PLATEAU.2018.2 Lemay, M.J.: Understanding Java usability by mining GitHub repositories. In: 9th Workshop on Evaluation and Usability of Programming Languages and Tools (PLATEAU 2018). OpenAccess Series in Informatics (OASIcs), vol. 67, pp. 2:1–2:9. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany (2019). https://​doi.​org/​10.​4230/​OASIcs.​PLATEAU.​2018.​2
9.
Zurück zum Zitat Rozenberg, D., Beschastnikh, I.: Templated visualization of object state with Vebugger. In: Proceedings of the 2014 Second IEEE Working Conference on Software Visualization, VISSOFT 2014, pp. 107–111. IEEE Computer Society, Washington (2014). https://doi.org/10.1109/VISSOFT.2014.26 Rozenberg, D., Beschastnikh, I.: Templated visualization of object state with Vebugger. In: Proceedings of the 2014 Second IEEE Working Conference on Software Visualization, VISSOFT 2014, pp. 107–111. IEEE Computer Society, Washington (2014). https://​doi.​org/​10.​1109/​VISSOFT.​2014.​26
10.
Zurück zum Zitat Schwarz, N.: DoodleDebug, objects should sketch themselves for code understanding. In: 5th Workshop on Dynamic Languages and Applications, DYLA 2011 (2011) Schwarz, N.: DoodleDebug, objects should sketch themselves for code understanding. In: 5th Workshop on Dynamic Languages and Applications, DYLA 2011 (2011)
11.
Zurück zum Zitat Sulír, M., Juhár, J.: Draw this object: a study of debugging representations. In: Proceedings of the Conference Companion of the 3rd International Conference on Art, Science, and Engineering of Programming, pp. 20:1–20:11. ACM (April 2019). https://doi.org/10.1145/3328433.3328454 Sulír, M., Juhár, J.: Draw this object: a study of debugging representations. In: Proceedings of the Conference Companion of the 3rd International Conference on Art, Science, and Engineering of Programming, pp. 20:1–20:11. ACM (April 2019). https://​doi.​org/​10.​1145/​3328433.​3328454
13.
Zurück zum Zitat Tempero, E., et al.: The Qualitas Corpus: a curated collection of Java code for empirical studies. In: Proceedings of the 2010 Asia Pacific Software Engineering Conference, APSEC 2010, pp. 336–345. IEEE Computer Society, Washington (2010). https://doi.org/10.1109/APSEC.2010.46 Tempero, E., et al.: The Qualitas Corpus: a curated collection of Java code for empirical studies. In: Proceedings of the 2010 Asia Pacific Software Engineering Conference, APSEC 2010, pp. 336–345. IEEE Computer Society, Washington (2010). https://​doi.​org/​10.​1109/​APSEC.​2010.​46
16.
Zurück zum Zitat Xu, W., Huang, L., Fox, A., Patterson, D., Jordan, M.I.: Detecting large-scale system problems by mining console logs. In: Proceedings of the ACM SIGOPS 22Nd Symposium on Operating Systems Principles, SOSP 2009, pp. 117–132. ACM, New York (2009). https://doi.org/10.1145/1629575.1629587 Xu, W., Huang, L., Fox, A., Patterson, D., Jordan, M.I.: Detecting large-scale system problems by mining console logs. In: Proceedings of the ACM SIGOPS 22Nd Symposium on Operating Systems Principles, SOSP 2009, pp. 117–132. ACM, New York (2009). https://​doi.​org/​10.​1145/​1629575.​1629587
Metadaten
Titel
String Representations of Java Objects: An Empirical Study
verfasst von
Matúš Sulír
Copyright-Jahr
2020
DOI
https://doi.org/10.1007/978-3-030-38919-2_39

Premium Partner