Understanding the syntactic rule usage in java

Understanding the syntactic rule usage in java
复制标题

理解java中语法规则的用法

DOI:
10.1016/j.jss.2016.10.017
复制
发表时间:
2017
期刊:
J. Syst. Softw.
影响因子:
--
通讯作者:
Z. Su
Z. Su
中科院分区:
--
文献类型:
--
作者:
Dong Qiu;Bixin Li;Earl T. Barr;Z. Su

文献摘要

相似文献

上下文:语法是任何编程语言的基础:语法定义了有效的程序。在20世纪70年代,计算机科学家严格地和经验性地研究编程语言,以指导和告知语言设计。从那时起,语言设计一直是艺术的,由语言设计师的美学关注和直觉驱动。尽管最近的研究小套选定的语言功能,我们缺乏一个全面的,定量的,实证分析如何现代的,现实世界的源代码行使其programminglanguage.Objective语法:本研究的目的是了解如何在实际开发中的编程语言语法,并探讨其潜在的应用程序的基础上的结果的语法用法analysis.Method:我们提出了我们的研究结果的第一个这样的研究Java,一个现代的,成熟的,广泛使用的编程语言。我们的语料库包含超过5000个开源Java项目,总计1.5亿行源代码(SLoC)。我们既独立研究(即,单个语法规则的应用)和依赖结果:我们的研究提供了详细的定量信息,并产生了深刻的见解,特别是(i)证实了语法规则的使用是Zipfian的传统智慧;(ii)表明新规则的采用及其对现有规则使用的影响随时间变化显着;和(iii)显示规则的使用是高度contextual.Conclusions:我们的研究结果表明,跨语言设计,代码建议和完成,自动句法sugaring,和语言限制的潜在应用。
Context:Syntax is fundamental to any programming language: syntax defines valid programs. In the 1970s, computer scientists rigorously and empirically studied programming languages to guide and inform language design. Since then, language design has been artistic, driven by the aesthetic concerns and intuitions of language architects. Despite recent studies on small sets of selected language features, we lack a comprehensive, quantitative, empirical analysis of how modern, real-world source code exercises the syntax of its programming language.Objective:This study aims to understand how programming language syntax is employed in actual development and explore their potential applications based on the results of syntax usage analysis.Method:We present our results on the first such study on Java, a modern, mature, and widely-used programming language. Our corpus contains over 5000 open-source Java projects, totalling 150 million source lines of code (SLoC). We study both independent (i.e.applications of a single syntax rule) and dependent (i.e.applications of multiple syntax rules) rule usage, and quantify their impact over time and project size.Results:Our study provides detailed quantitative information and yields insight, particularly (i) confirming the conventional wisdom that the usage of syntax rules is Zipfian; (ii) showing that the adoption of new rules and their impact on the usage of pre-existing rules vary significantly over time; and (iii) showing that rule usage is highly contextual.Conclusions:Our findings suggest potential applications across language design, code suggestion and completion, automatic syntactic sugaring, and language restriction.