Tracing Naming Semantics in Unit Tests of Popular Github Android Projects

Authors Matej Madeja , Jaroslav Porubän



PDF
Thumbnail PDF

File

OASIcs.SLATE.2019.3.pdf
  • Filesize: 0.6 MB
  • 13 pages

Document Identifiers

Author Details

Matej Madeja
  • Department of Computers and Informatics, Faculty of Electrical Engineering and Informatics, Technical University of Košice, Slovakia
Jaroslav Porubän
  • Department of Computers and Informatics, Faculty of Electrical Engineering and Informatics, Technical University of Košice, Slovakia

Acknowledgements

This work was supported by project VEGA No. 1/0762/19: Interactive pattern-driven language development.

Cite AsGet BibTex

Matej Madeja and Jaroslav Porubän. Tracing Naming Semantics in Unit Tests of Popular Github Android Projects. In 8th Symposium on Languages, Applications and Technologies (SLATE 2019). Open Access Series in Informatics (OASIcs), Volume 74, pp. 3:1-3:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2019)
https://doi.org/10.4230/OASIcs.SLATE.2019.3

Abstract

The tests are so closely linked to the source code that we consider them up-to-date documentation. Developers are aware of recommended naming conventions and other best practices that should be used to write tests. In this paper we focus on how the developers test in practice and what conventions they use. For the analysis 5 very popular Android projects from Github were selected. The results show that 49 % of tests contain full and 76 % of tests contain a partial unit under test (UUT) method name in their name. Further, there was observed that UUT was only rarely tested by multiple test classes and thus in cases when the tester wanted to distinguish the way he or she worked with the tested object. The analysis of this paper shows that the word "test" in the test title is not a reliable metric for identifying the test. Apart from assertions, the developers use statements like verify, try-catch and throw exception to verify the correctness of UUT functionality. At the same time it was found out that the test titles contained keywords which could lead to the identification of UUT, use case of test or data used for test. It was also found out that the words in the test title were very often found in its body and in a smaller amount in UUT body which indicated the use of similar vocabulary in tests and UUT.

Subject Classification

ACM Subject Classification
  • Software and its engineering → Semantics
  • Software and its engineering → Software testing and debugging
  • Software and its engineering → Software reverse engineering
  • Software and its engineering → Maintaining software
Keywords
  • unit tests
  • android
  • real testing practices
  • unit tests
  • program comprehension

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. G. Antoniol, G. Canfora, G. Casazza, A. De Lucia, and E. Merlo. Recovering traceability links between code and documentation. IEEE Transactions on Software Engineering, 28(10):970-983, October 2002. URL: http://dx.doi.org/10.1109/TSE.2002.1041053.
  2. Kent Beck. Test-driven development: by example. Addison-Wesley Professional, 2003. Google Scholar
  3. Kent Beck and Erich Gamma. Test infected: Programmers love writing tests. Java Report, 3(7):37-50, 1998. Google Scholar
  4. Serge Demeyer, Stéphane Ducasse, and Oscar Nierstrasz. Object-oriented reengineering patterns. Elsevier, 2002. Google Scholar
  5. M. Fowler, K. Beck, J.C. Shanklin, E. Gamma, J. Brant, W. Opdyke, and D. Roberts. Refactoring: Improving the Design of Existing Code. Addison-Wesley object technology series. Addison-Wesley, 1999. Google Scholar
  6. Edward M. Gellenbeck and Curtis R. Cook. An Investigation of Procedure and Variable Names As Beacons During Program Comprehension. Technical report, Oregon State University, Corvallis, OR, USA, 1991. Google Scholar
  7. P. S. Kochhar, F. Thung, N. Nagappan, T. Zimmermann, and D. Lo. Understanding the Test Automation Culture of App Developers. In 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST), pages 1-10, April 2015. URL: http://dx.doi.org/10.1109/ICST.2015.7102609.
  8. Matej Madeja and Jaroslav Porubän. Automated testing environment and assessment of assignments for Android MOOC. Open Computer Science, 8(1):80-92, 2018. Google Scholar
  9. Gerard Meszaros. xUnit test patterns: Refactoring test code. Pearson Education, 2007. Google Scholar
  10. Godfrey Nolan. Agile Android. Apress, 2015. Google Scholar
  11. R. Pham, L. Singer, O. Liskin, F. F. Filho, and K. Schneider. Creating a shared understanding of testing culture on a social coding site. In 2013 35th International Conference on Software Engineering (ICSE), pages 112-121, May 2013. URL: http://dx.doi.org/10.1109/ICSE.2013.6606557.
  12. B. V. Rompaey and S. Demeyer. Establishing Traceability Links between Unit Test Cases and Units under Test. In 2009 13th European Conference on Software Maintenance and Reengineering, pages 209-218, March 2009. URL: http://dx.doi.org/10.1109/CSMR.2009.39.
  13. Arie Van Deursen, Leon Moonen, Alex Van Den Bergh, and Gerard Kok. Refactoring test code. In Proceedings of the 2nd international conference on extreme programming and flexible processes in software engineering (XP2001), pages 92-95, 2001. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail