Python coding style compliance on stack overflow

Nikolaos Bafatakis, Niels Boecker, Wenjie Boon, Martin Cabello Salazar,Jens Krinke, Gazi Oznacar,Robert White

Proceedings of the 16th International Conference on Mining Software Repositories(2019)

引用 20|浏览28
暂无评分
摘要
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.
更多
查看译文
关键词
SOTorrent, code style, coding conventions, coding style, python, stack overflow, style guides
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要