用部分求值生成Prolog测试数据
On the Generation of Test Data for Prolog by Partial Evaluation
摘要:
在最近的工作中,我们提出了一种方法来测试数据生成(TDG)的命令式字节码的部分评价(PE)的CLP,它包括两个阶段:(1)字节码程序首先转换成一个等价的CLP程序通过解释编译的PE,(2)第二个PE是为了监督生成的测试用例的CLP反编译程序的执行。由PE的TDG的主要优点包括灵活地处理新的覆盖标准,获得测试用例生成器的可能性和它的简单性来实现。该方法原则上可以直接应用于任何命令式语言的TDG。然而,当人们试图将其应用于像Prolog这样的声明性语言时,我们发现作为一个主要困难的测试用例的生成,该测试用例覆盖了Prolog更复杂的控制流。从本质上讲,问题是,PE的一个内在特征是,它只计算非失败的推导,而在TDG的Prolog它是必不可少的,以产生相关的测试用例失败的计算。基本上,我们建议将原来的Prolog程序转化为一个等价的Prolog程序与明确的失败部分评估的Prolog解释器捕获失败的派生w.r.t.输入程序。另一个问题,我们讨论的文件是,虽然在字节码的情况下,基本的约束域只操纵整数,在Prolog中,它应该正确地处理由程序操纵的符号数据。由此产生的方案是感兴趣的,使其固有的优势,在TDG的PE的逻辑编程领域。
英文摘要:
In recent work, we have proposed an approach to Test Data Generation (TDG) of imperative bytecode by partial evaluation (PE) of CLP which consists in two phases: (1) the bytecode program is first transformed into an equivalent CLP program by means of interpretive compilation by PE, (2) a second PE is performed in order to supervise the generation of test-cases by execution of the CLP decompiled program. The main advantages of TDG by PE include flexibility to handle new coverage criteria, the possibility to obtain test-case generators and its simplicity to be implemented. The approach in principle can be directly applied for TDG of any imperative language. However, when one tries to apply it to a declarative language like Prolog, we have found as a main difficulty the generation of test-cases which cover the more complex control flow of Prolog. Essentially, the problem is that an intrinsic feature of PE is that it only computes non-failing derivations while in TDG for Prolog it is essential to generate test-cases associated to failing computations. Basically, we propose to transform the original Prolog program into an equivalent Prolog program with explicit failure by partially evaluating a Prolog interpreter which captures failing derivations w.r.t. the input program. Another issue that we discuss in the paper is that, while in the case of bytecode the underlying constraint domain only manipulates integers, in Prolog it should properly handle the symbolic data manipulated by the program. The resulting scheme is of interest for bringing the advantages which are inherent in TDG by PE to the field of logic programming.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。