首页> 外文期刊>Science of Computer Programming >Automatic generation of valid and invalid test data for string validation routines using web searches and regular expressions
【24h】

Automatic generation of valid and invalid test data for string validation routines using web searches and regular expressions

机译:使用Web搜索和正则表达式为字符串验证例程自动生成有效和无效的测试数据

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

摘要

Classic approaches to automatic input data generation are usually driven by the goal of obtaining program coverage and the need to solve or find solutions to path constraints to achieve this. As inputs are generated with respect to the structure of the code, they can be ineffective, difficult for humans to read, and unsuitable for testing missing implementation. Furthermore, these approaches have known limitations when handling constraints that involve operations with string data types. This paper presents a novel approach for generating string test data for string validation routines, by harnessing the Internet. The technique uses program identifiers to construct web search queries for regular expressions that validate the format of a string type (such as an email address). It then performs further web searches for strings that match the regular expressions, producing examples of test cases that are both valid and realistic. Following this, our technique mutates the regular expressions to drive the search for invalid strings, and the production of test inputs that should be rejected by the validation routine. The paper presents the results of an empirical study evaluating our approach. The study was conducted on 24 string input validation routines collected from 10 open source projects. While dynamic symbolic execution and search-based testing approaches were only able to generate a very low number of values successfully, our approach generated values with an accuracy of 34% on average for the case of valid strings, and 99% on average for the case of invalid strings. Furthermore, whereas dynamic symbolic execution and search-based testing approaches were only capable of detecting faults in 8 routines, our approach detected faults in 17 out of the 19 validation routines known to contain implementation errors.
机译:自动输入数据生成的经典方法通常是由获得程序覆盖率的目标以及解决此问题或寻找路径约束解决方案的需求所驱动。由于输入是根据代码的结构生成的,因此输入可能无效,难以阅读,并且不适合测试缺少的实现。此外,这些方法在处理涉及字符串数据类型的操作的约束时具有已知的局限性。本文提出了一种利用互联网为字符串验证例程生成字符串测试数据的新颖方法。该技术使用程序标识符为正则表达式构造Web搜索查询,以验证字符串类型(例如电子邮件地址)的格式。然后,它将对匹配正则表达式的字符串进行进一步的Web搜索,从而生成有效且现实的测试用例示例。此后,我们的技术对正则表达式进行了变异,以驱动对无效字符串的搜索,并生成应被验证例程拒绝的测试输入。本文介绍了评估我们的方法的实证研究结果。该研究是对从10个开源项目中收集的24个字符串输入验证例程进行的。虽然动态符号执行和基于搜索的测试方法只能成功生成极少量的值,但对于有效字符串,我们的方法生成的值平均准确度为34%,对于情况为平均99%无效的字符串。此外,虽然动态符号执行和基于搜索的测试方法仅能够检测8个例程中的错误,但是我们的方法在已知包含实现错误的19个验证例程中检测了17个错误。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号