论文标题
描述用于测试Haskell学生提交的学生提交的控制台I/O行为
Describing Console I/O Behavior for Testing Student Submissions in Haskell
论文作者
论文摘要
我们提出了一种用于指定简单控制台I/O程序的行为的小型正式语言。该设计是由测试学生编写的互动Haskell程序的具体应用程序驱动的。规范在结构上与词汇分析的正则表达式相似,但具有诸如跟踪程序运行状态和历史的全局变量之类的功能,从而表达了有趣的动态行为范围。我们基于接受执行跟踪的方式为我们的规范语言提供语义。从该语义中,我们得出了对给定规范有效的所有跟踪集的定义。采样设置使我们能够以概率方式机械地检查程序行为。除了测试外,在教育环境中,规范语言的其他可能用途还包括相关活动,例如提供更多有用的反馈,生成样本解决方案,甚至产生随机锻炼任务。
We present a small, formal language for specifying the behavior of simple console I/O programs. The design is driven by the concrete application case of testing interactive Haskell programs written by students. Specifications are structurally similar to lexical analysis regular expressions, but are augmented with features like global variables that track state and history of program runs, enabling expression of an interesting range of dynamic behavior. We give a semantics for our specification language based on acceptance of execution traces. From this semantics we derive a definition of the set of all traces valid for a given specification. Sampling that set enables us to mechanically check program behavior against specifications in a probabilistic fashion. Beyond testing, other possible uses of the specification language in an education context include related activities like providing more helpful feedback, generating sample solutions, and even generating random exercise tasks.