Bafatakis, N;
Boecker, N;
Boon, W;
Cabello Salazar, M;
Krinke, J;
Oznacar, G;
White, R;
(2019)
Python Coding Style Compliance on Stack Overflow.
In:
Proceedings of the 2019 IEEE/ACM 16th International Conference on Mining Software Repositories (MSR).
(pp. pp. 210-214).
IEEE: Montreal, Canada.
Preview |
Text
msr19.pdf - Accepted Version Download (373kB) | Preview |
Abstract
Software developers all over the world use Stack Overflow (SO) to interact and exchange code snippets. Research also uses SO to harvest code snippets for use with recommendation systems. However, previous work has shown that code on SO may have quality issues, such as security or license problems. We analyse Python code on SO to determine its coding style compliance. From 1,962,535 code snippets tagged with 'python', we extracted 407,097 snippets of at least 6 statements of Python code. Surprisingly, 93.87% of the extracted snippets contain style violations, with an average of 0.7 violations per statement and a huge number of snippets with a considerably higher ratio. Researchers and developers should, therefore, be aware that code snippets on SO may not representative of good coding style. Furthermore, while user reputation seems to be unrelated to coding style compliance, for posts with vote scores in the range between -10 and 20, we found a strong correlation (r = -0.87, p <; 10^-7) between the vote score a post received and the average number of violations per statement for snippets in such posts.
Type: | Proceedings paper |
---|---|
Title: | Python Coding Style Compliance on Stack Overflow |
Event: | 2019 IEEE/ACM 16th International Conference on Mining Software Repositories (MSR) |
ISBN-13: | 9781728134123 |
Open access status: | An open access version is available from UCL Discovery |
DOI: | 10.1109/MSR.2019.00042 |
Publisher version: | https://doi.org/10.1109/MSR.2019.00042 |
Language: | English |
Additional information: | This version is the author accepted manuscript. For information on re-use, please refer to the publisher’s terms and conditions. |
Keywords: | Stack Overflow, Style Guides, Code Style, Coding Style, Coding Conventions, SOTorrent, Python |
UCL classification: | UCL UCL > Provost and Vice Provost Offices UCL > Provost and Vice Provost Offices > UCL BEAMS UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Chemical Engineering UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Computer Science |
URI: | https://discovery-pp.ucl.ac.uk/id/eprint/10083504 |
Archive Staff Only
View Item |