Readability of Code Snippets Included in Stack Overflow Questions: An Exploratory Study
Loading...
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Department of Computer Science and Engineering(CSE), Islamic University of Technology(IUT), Board Bazar, Gazipur-1704, Bangladesh
Abstract
Stack Overflow (SO) is a popular question and answer site for programmers of all skill levels. In Stack Overflow software developers asks questions with sample code segments, supporting description, and if needed
with bug report. However, the quality of the questioner code is poorly
readable to attract the solution of the answerer. In this paper, we explore
the idea of Java code readability from Stack Overflow question and tried
to investigate the impact of the criteria in code readability. This research
is the first study on Java code readability from Stack Overflow that we are
aware of. We propose a novel dataset of Java code readability criteria from
Stack Overflow. Our study consists of 21 readability metric of Java, 241
SO questions, three human annotators, and two experts. With collecting
SO Questions with Java tag from SO site, three human annotators manually evaluated the dataset and later the annotation were rechecked by two
software experts. Moreover, we tried to analyse the impact of the criteria in code readability and the correlations between readability and different performance measures of SO site like readability vs score mechanism,
readability vs accepted answers, and so on. Finally, we discuss how our
study will encourage new inquirer to ask a good readable question so that
he can get an answer he was looking for as early as possible.
Description
Supervised by
Mr. Shohel Ahmed,
Assistant Professor,
Department of Computer Science and Engineering(CSE),
Islamic University of Technology(IUT),
Board Bazar, Gazipur-1704. Bangladesh.
This thesis is submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science and Engineering, 2022.
Keywords
Stack Overflow, JAVA, Readability, Novel Dataset
Citation
[1] M. Duijn, A. Kucera, and A. Bacchelli, “Quality questions need quality code: Classifying code fragments on stack overflow,” in 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories. IEEE, 2015, pp. 410–413. [2] C. Treude and M. P. Robillard, “Understanding stack overflow code fragments,” in 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 2017, pp. 509–513. [3] “stackoverflow,” https://stackoverflow.com/help/privileges/vote-up, accessed: 2022-04-22. [4] U. A. Mannan, I. Ahmed, and A. Sarma, “Towards understanding code readability and its impact on design quality,” in Proceedings of the 4th ACM SIGSOFT International Workshop on NLP for Software Engineering, 2018, pp. 18–21. [5] S. Fakhoury, D. Roy, A. Hassan, and V. Arnaoudova, “Improving source code readability: Theory and practice,” in 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC). IEEE, 2019, pp. 2–12. [6] R. P. Buse and W. R. Weimer, “Learning a metric for code readability,” IEEE Transactions on software engineering, vol. 36, no. 4, pp. 546–558, 2009. [7] A. Batool, M. Rehman, A. Khan, and A. Azeem, “Impact and comparison of programming constructs on java and c# source code readability,” Int. J. Softw. Eng. Appl, vol. 9, pp. 79–90, 2015. [8] J. Johnson, S. Lubo, N. Yedla, J. Aponte, and B. Sharif, “An empirical study assessing source code readability in comprehension,” in 2019 40 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 2019, pp. 513–523. [9] D. Alawad, M. Panta, M. Zibran, and M. R. Islam, “An empirical study of the relationships between code readability and software complexity,” arXiv preprint arXiv:1909.01760, 2019. [10] M. U. Tariq, M. B. Bashir, M. Babar, and A. Sohail, “Code readability management of high-level programming languages: a comparative study,” International Journal of Advanced Computer Science and Applications (IJACSA), vol. 11, no. 3, pp. 595–602, 2020. [11] S. Scalabrino, M. Linares-Vasquez, D. Poshyvanyk, and R. Oliveto, “Improving code readability models with textual features,” in 2016 IEEE 24th International Conference on Program Comprehension (ICPC). IEEE, 2016, pp. 1–10. [12] S. Scalabrino, M. Linares-Vásquez, R. Oliveto, and D. Poshyvanyk, “A comprehensive model for code readability,” Journal of Software: Evolution and Process, vol. 30, no. 6, p. e1958, 2018. [13] R. M. dos Santos and M. A. Gerosa, “Impacts of coding practices on readability,” in Proceedings of the 26th Conference on Program Comprehension, 2018, pp. 277–285. [14] S. Fakhoury, Y. Ma, V. Arnaoudova, and O. Adesope, “The effect of poor source code lexicon and readability on developers’ cognitive load,” in 2018 IEEE/ACM 26th International Conference on Program Comprehension (ICPC). IEEE, 2018, pp. 286–28 610. [15] Y. Tashtoush, Z. Odat, I. M. Alsmadi, and M. Yatim, “Impact of programming features on code readability,” 2013. [16] R. P. Buse and W. R. Weimer, “A metric for software readability,” in Proceedings of the 2008 international symposium on Software testing and analysis, 2008, pp. 121–130. [17] “Stack Exchange data explorer,” https://data.stackexchange.com/, accessed: 2022-04-22. 41 [18] “stackoverflow,” https://stackoverflow.com/questions/3280987/springseparate-datasource-for-read-only-transactions, accessed: 2022-04- 22. [19] “stackoverflow,” https://stackoverflow.com/questions/592496/generatinga-faces-context-manually, accessed: 2022-04-22. [20] “stackoverflow,” https://stackoverflow.com/questions/3280987/springseparate-datasource-for-read-only-transactions, accessed: 2022-04- 22. [21] “stackoverflow,” https://stackoverflow.com/questions/3327137/usingfor-each-over-an-array-of-objects-integer-array-why-does-forint, accessed: 2022-04-22. [22] “stackoverflow,” https://stackoverflow.com/questions/3818284/androidsurfaceholder-unlockcanvasandpost-does-not-cause-redraw, accessed: 2022-04-22. [23] “stackoverflow,” https://stackoverflow.com/questions/3818284/androidsurfaceholder-unlockcanvasandpost-does-not-cause-redraw, accessed: 2022-04-22. [24] “Wikipedia,” https://en.wikipedia.org/wiki/Temporaryvariable, accessed : 2022 − 04 − 22.