首页> 外文会议>International Conference on Software Engineering Research and Practice >Random Test Data Generation for Java Classes Annotated with JML Specifications
【24h】

Random Test Data Generation for Java Classes Annotated with JML Specifications

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

获取原文

摘要

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 difficult for a randomly-chosen sequence of method invocations to 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 a 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 underlying 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 JML's 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的运行时断言检查器检查方法调用的有效性。我们方法的其他成分包括对象池和对象等价检查。这些是增加构建可行呼叫序列的概率,并在成功构建的序列中删除冗余。我们已经实施了我们对Java完全自动化的测试工具的方法,以及我们对JAV的实验表明,产生的测试用例的数量增加了10%至200%。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号