Programming Not Only by Example

Programming Not Only by Example
复制标题

编程不仅仅通过示例

DOI:
--
复制
发表时间:
2017
期刊:
International Conference on Software Engineering
影响因子:
--
通讯作者:
Eran Yahav
Eran Yahav
中科院分区:
--
文献类型:
--
作者:
Hila Peleg;Sharon Shoham;Eran Yahav

文献摘要

被引文献

相似文献

近年来,自动合成技术取得了巨大的进步,它可以根据程序员表达的意图自动生成代码,但传达这种意图仍然是一个主要挑战。当表达的意图是粗粒度的(例如,对表达式的预期类型的限制)时,合成器通常会生成一长串结果供程序员选择,将繁重的工作转移给用户。在最终用户综合中成功使用的另一种方法是通过示例编程(PBE),其中用户利用示例交互和迭代地改进意图。然而,对于程序员来说,只使用示例是不够的,他们可以观察生成的程序,并通过直接与生成的程序的部分相关来改进意图。我们提出了一种使用颗粒交互模型与合成器交互的新方法。我们的方法采用了一个丰富的交互模型,其中(i)合成器用调试信息装饰候选程序,帮助理解程序并识别好或坏的部分,以及(ii)用户不仅可以提供对程序预期输出的反馈,还可以提供对程序本身的反馈。在识别程序(部分)正确或不正确之后,用户还可以明确地指出好的或坏的部分,以允许合成器接受或丢弃部分程序,而不是丢弃整个程序。我们在一个受控的用户研究中展示了我们的方法的价值。我们的研究表明,参与者更喜欢细粒度反馈,而不是示例,并且可以更快地提供细粒度反馈。
Recent years have seen great progress in automated synthesis techniques that can automatically generate code based on some intent expressed by the programmer, but communicating this intent remains a major challenge. When the expressed intent is coarse-grained (for example, restriction on the expected type of an expression), the synthesizer often produces a long list of results for the programmer to choose from, shifting the heavy-lifting to the user. An alternative approach, successfully used in end-user synthesis, is programming by example (PBE), where the user leverages examples to interactively and iteratively refine the intent. However, using only examples is not expressive enough for programmers, who can observe the generated program and refine the intent by directly relating to parts of the generated program. We present a novel approach to interacting with a synthesizer using a granular interaction model. Our approach employs a rich interaction model where (i) the synthesizer decorates a candidate program with debug information that assists in understanding the program and identifying good or bad parts, and (ii) the user is allowed to provide feedback not only on the expected output of a program but also on the program itself. After identifying a program as (partially) correct or incorrect, the user can also explicitly indicate the good or bad parts, to allow the synthesizer to accept or discard parts of the program instead of discarding the program as a whole. We show the value of our approach in a controlled user study. Our study shows that participants have a strong preference for granular feedback instead of examples and can provide granular feedback much faster.