arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1901.08718cs.SE
收藏

Java开发人员采用的异常处理指南

Unveiling Exception Handling Guidelines Adopted by Java Developers

Hugo Melo, Roberta Coelho, Christoph Treude

摘要:

尽管Java异常处理代码是一种古老的语言特性,但它是许多系统中最不容易理解的部分之一。一些研究分析了异常处理代码的特征,试图识别常见的实践,甚至将这些实践与软件错误联系起来。然而,很少有作品,从开发人员的角度来研究异常处理问题。没有一项工作关注于发现当前系统所采用的异常处理准则--这些准则很可能是常见实践的驱动因素。在这项工作中,我们进行了定性研究的基础上半结构化的访谈和调查,其目标是调查的指导方针,是(或应该)开发人员在他们的项目。最初,我们对七位经验丰富的开发人员进行了半结构化的采访,这些采访被用来为针对更广泛的Java开发人员群体(即,一群来自GitHub上顶级项目的活跃Java开发人员)。我们向863名开发人员发送了电子邮件,收到了98个有效答案。研究表明,异常处理准则通常存在(70%),通常是隐含的和未记录的(54%)。我们的研究确定了与七个不同类别相关的48个异常处理准则。我们还调查了这些指导方针如何传播给项目团队,以及如何验证代码和指导方针之间的符合性;我们可以观察到,根据一半以上的受访者,指导方针通过代码检查或代码审查进行传播和验证。我们的研究结果为软件开发团队提供了一种改进异常处理指南的方法,该方法基于87个软件项目实践状态的见解。

英文摘要:

Despite being an old language feature, Java exception handling code is one of the least understood parts of many systems. Several studies have analyzed the characteristics of exception handling code, trying to identify common practices or even link such practices to software bugs. Few works, however, have investigated exception handling issues from the point of view of developers. None of the works have focused on discovering exception handling guidelines adopted by current systems -- which are likely to be a driver of common practices. In this work, we conducted a qualitative study based on semi-structured interviews and a survey whose goal was to investigate the guidelines that are (or should be) followed by developers in their projects. Initially, we conducted semi-structured interviews with seven experienced developers, which were used to inform the design of a survey targeting a broader group of Java developers (i.e., a group of active Java developers from top-starred projects on GitHub). We emailed 863 developers and received 98 valid answers. The study shows that exception handling guidelines usually exist (70%) and are usually implicit and undocumented (54%). Our study identifies 48 exception handling guidelines related to seven different categories. We also investigated how such guidelines are disseminated to the project team and how compliance between code and guidelines is verified; we could observe that according to more than half of respondents the guidelines are both disseminated and verified through code inspection or code review. Our findings provide software development teams with a means to improve exception handling guidelines based on insights from the state of practice of 87 software projects.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑