首页> 外文OA文献 >Random Test Data Generation for Java Classes Annotated with JML Specifications
【2h】

Random Test Data Generation for Java Classes Annotated with JML Specifications

机译:使用JmL规范注释的Java类的随机测试数据生成

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

The hidden states of objects create a barrier to designing and generating test data automatically. For example, the state of an object has to be established indirectly through a sequence of method invocations. For a non-trivial class, however, it is extremely unlikely that a randomly-chosen sequence of method invocations can construct an object successfully, as each invocation has to satisfy the state invariants. Nonetheless, automated random testing can reduce the cost of testing dramatically and has potential for finding errors that are difficult to find in other ways because it eliminates the subjectiveness in constructing test data. We propose a new approach to generating test data automatically for Java classes annotated with JML specifications. The key idea behind our approach is to construct an object incrementally in that each method call in the sequence is checked before the next call is chosen. We use JMLu27s runtime assertion checker to check the validity of a method invocation. Other ingredients of our approach include object pooling and object equivalence checking. These are to increase the probability of constructing feasible call sequences and to remove redundancy among the successfully-built sequences. We have implemented our approach for JET, a fully-automated testing tool for Java, and our experiment with JET showed a promising result, 10 to 200% increase in the number of generated test cases.
机译:对象的隐藏状态为自动设计和生成测试数据提供了障碍。例如,必须通过一系列方法调用间接建立对象的状态。但是,对于非平凡的类,随机选择的方法调用序列不可能成功构造对象,因为每个调用必须满足状态不变式。但是,自动随机测试可以大大降低测试成本,并且有可能发现其他方式难以发现的错误,因为它消除了构建测试数据的主观性。我们提出了一种新方法来自动为带有JML规范注释的Java类生成测试数据。我们的方法背后的关键思想是逐步构造对象,因为在选择下一个调用之前,将检查序列中的每个方法调用。我们使用JML u27的运行时断言检查器来检查方法调用的有效性。我们方法的其他要素包括对象池和对象等效性检查。这些是为了增加构建可行的呼叫序列的可能性,并消除成功构建的序列之间的冗余。我们已经针对JET(一种针对Java的全自动测试工具)实施了我们的方法,并且我们对JET的实验显示了令人鼓舞的结果,生成的测试用例数量增加了10%到200%。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号