首页> 外文会议>IEEE/ACM International Conference on Mining Software Repositories >Mining Rule Violations in JavaScript Code Snippets
【24h】

Mining Rule Violations in JavaScript Code Snippets

机译:挖掘规则违反JavaScript代码片段

获取原文

摘要

Programming code snippets readily available on platforms such as StackOverflow are undoubtedly useful for software engineers. Unfortunately, these code snippets might contain issues such as deprecated, misused, or even buggy code. These issues could pass unattended, if developers do not have adequate knowledge, time, or tool support to catch them. In this work we expand the understanding of such issues (or the so called "violations") hidden in code snippets written in JavaScript, the programming language with the highest number of questions on StackOverflow. To characterize the violations, we extracted 336k code snippets from answers to JavaScript questions on StackOverflow and statically analyzed them using ESLinter, a JavaScript linter. We discovered that there is no single JavaScript code snippet without a rule violation. On average, our studied code snippets have 11 violations, but we found instances of more than 200 violations. In particular, rules related to stylistic issues are by far the most violated ones (82.9% of the violations pertain to this category). Possible errors, which developers might be more interested in, represent only 0.1% of the violations. Finally, we found a small fraction of code snippets flagged with possible errors being reused on actual GitHub software projects. Indeed, one single code snippet with possible errors was reused 1,261 times.
机译:在STACKOVERFLOW等平台上随时可用的编程代码片段无疑对软件工程师有用。不幸的是,这些代码片段可能包含弃用,误用甚至错误代码等问题。如果开发人员没有足够的知识,时间或工具支持来捕捉它们,这些问题可能会通过无人看管。在这项工作中,我们扩展了对隐藏在JavaScript编写的代码片段中的此类问题(或所谓的“违规”)的理解,该编程语言具有最高的StackOverFlow的问题。为了表征违规行为,我们将336k代码片段从Sackoverflow上的JavaScript Question中提取了336k代码片段,并使用eslinter静态分析了它们的JavaScript Linter。我们发现没有规则违规的单个JavaScript代码片段。平均而言,我们研究的代码片段有11个违规行为,但我们发现200多个违规行为的情况。特别是,与风格问题相关的规则是迄今为止最违反的规则(违规行为的82.9%属于此类别)。可能的错误,开发人员可能更感兴趣,只占违规行为的0.1%。最后,我们发现一小部分代码片段标记,在实际的GitHub软件项目上可以重复使用可能的错误。实际上,一个具有可能错误的单个代码片段重用了1,261次。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号