首页> 外文会议>Software Testing, Verification and Validation (ICST), 2012 IEEE Fifth International Conference on >@tComment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies
【24h】

@tComment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies

机译:@tComment:测试Javadoc注释以检测注释代码不一致

获取原文
获取原文并翻译 | 示例

摘要

Code comments are important artifacts in software. Javadoc comments are widely used in Java for API specifications. API developers write Javadoc comments, and API users read these comments to understand the API, e.g., reading a Javadoc comment for a method instead of reading the method body. An inconsistency between the Javadoc comment and body for a method indicates either a fault in the body or, effectively, a fault in the comment that can mislead the method callers to introduce faults in their code. We present a novel approach, called @TCOMMENT, for testing Javadoc comments, specifically method properties about null values and related exceptions. Our approach consists of two components. The first component takes as input source files for a Java project and automatically analyzes the English text in Javadoc comments to infer a set of likely properties for a method in the files. The second component generates random tests for these methods, checks the inferred properties, and reports inconsistencies. We evaluated @TCOMMENT on seven open-source projects and found 29 inconsistencies between Javadoc comments and method bodies. We reported 16 of these inconsistencies, and 5 have already been confirmed and fixed by the developers.
机译:代码注释是软件中的重要工件。 Javadoc注释在Java中广泛用于API规范。 API开发人员编写Javadoc注释,并且API用户阅读这些注释以了解API,例如,阅读方法的Javadoc注释而不是阅读方法主体。 Javadoc注释与方法的主体之间的不一致表示主体中的错误,或者实际上是注释中的错误,可能会误导方法调用者在其代码中引入错误。我们提供了一种称为@TCOMMENT的新颖方法,用于测试Javadoc注释,特别是有关空值和相关异常的方法属性。我们的方法包括两个部分。第一个组件用作Java项目的输入源文件,并自动分析Javadoc注释中的英文文本,以推断文件中方法的一组可能的属性。第二个组件为这些方法生成随机测试,检查推断的属性,并报告不一致之处。我们在七个开源项目上对@TCOMMENT进行了评估,发现Javadoc注释与方法主体之间存在29个不一致之处。我们报告了其中16个不一致的地方,其中5个已经得到开发商的确认和解决。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号