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.
Why did developers migrate Android applications from Java to Kotlin?
目前,大多数在移动设备上运行的应用程序都是用Java开发的Android应用程序。然而,开发人员现在可以使用一种新的程序设计语言编写Android应用程序:Kotlin,谷歌在2017年将其作为开发Android应用程序的官方程序设计语言。从那时起,Android开发人员已经能够:a)使用Kotlin从头开始编写Android应用程序,b)通过添加Kotlin代码(可能归功于两种语言之间的互操作性)来改进现有的Java Android应用程序,或者c)将其Android应用程序从Java迁移到Kotlin。本文旨在研究这最后一种情况。我们进行了一项定性研究,以了解Android开发人员将Java代码迁移到Kotlin的原因,并将他们在此过程中的经验汇总在一起,以确定他们面临的主要困难。为了执行这项研究,我们首先确定了来自开源Android项目的提交,这些项目已经将Java代码迁移到Kotlin。然后,我们给编写这些迁移的开发人员发了电子邮件。因此,我们从98名将代码从Java迁移到Kotlin的开发人员那里获得了信息。本文介绍了研究确定的进行迁移的主要原因。我们发现开发人员将Java代码迁移到Kotlin是为了访问程序设计语言功能(例如,扩展函数,扩展函数,智能转换),这些功能在Java for Android开发中不可用,并获得更安全的代码(即,避免空指针异常)。我们还确定了研究…
University of California at Riverside(加州大学河滨分校);CISPA Helmholtz Center for Information Security(CISPA亥姆霍兹信息安全中心);New Jersey Institute of Technology(新泽西理工学院)