论文标题

使用关系问题教授基于财产的测试

Using Relational Problems to Teach Property-Based Testing

论文作者

Wrenn, John, Nelson, Tim, Krishnamurthi, Shriram

论文摘要

上下文:QuickCheck的成功导致了许多语言的基于物业的测试(PBT)库的开发,并且该过程受到越来越多的关注。但是,与常规测试不同,PBT在大学课程中并不普遍。此外,PBT的值不仅限于软件测试。越来越多地使用正式方法,以及软件综合的增长,所有这些都会对培训学生和开发人员进行规范写作的技术提出需求。我们认为,PBT在测试和规范行为之间形成了强大的桥梁:这是测试人员实际编写抽象规范的一种测试形式。 询问:即使是知名的技术人员也提到了为其使用良好的激励示例的困难。我们采取步骤来填补此空隙。 方法和知识:我们发现使用“关系”问题(输入可能会允许多个有效输出的问题)很容易激发PBT的使用。我们还注意到,问题的计算机科学万神殿(例如,许多图形和分类算法)很容易获得。我们已经使用了几年来在大学课程中教PBT。 接地:在本文中,我们描述了我们使用和报告学生的问题?完成它们。我们认为,这些问题克服了上述一些动机问题。我们还表明,对于这些问题,学生可以在PBT方面做得很好,这表明该主题在他们的范围内。在此过程中,我们介绍了一种简单的方法来评估其规格的准确性,并使用它来表征其常见错误。 重要性:根据我们的发现,我们认为关系问题是PBT的充分利用的激励榜样。我们希望本文启动有关教育者(和开发人员)使用此类问题的目录,并提供了一种分析PBT质量的具体方法(尽管绝不是独家)。

Context: The success of QuickCheck has led to the development of property-based testing (PBT) libraries for many languages and the process is getting increasing attention. However, unlike regular testing, PBT is not widespread in collegiate curricula. Furthermore, the value of PBT is not limited to software testing. The growing use of formal methods in, and the growth of software synthesis, all create demand for techniques to train students and developers in the art of specification writing. We posit that PBT forms a strong bridge between testing and the act of specification: it's a form of testing where the tester is actually writing abstract specifications. Inquiry: Even well-informed technologists mention the difficulty of finding good motivating examples for its use. We take steps to fill this lacuna. Approach & Knowledge: We find that the use of "relational" problems -- those for which an input may admit multiple valid outputs -- easily motivates the use of PBT. We also notice that such problems are readily available in the computer science pantheon of problems (e.g., many graph and sorting algorithms). We have been using these for some years now to teach PBT in collegiate courses. Grounding: In this paper, we describe the problems we use and report on students? completion of them. We believe the problems overcome some of the motivation issues described above. We also show that students can do quite well at PBT for these problems, suggesting that the topic is well within their reach. In the process, we introduce a simple method to evaluate the accuracy of their specifications, and use it to characterize their common mistakes. Importance: Based on our findings, we believe that relational problems are an underutilized motivating example for PBT. We hope this paper initiates a catalog of such problems for educators (and developers) to use, and also provides a concrete (though by no means exclusive) method to analyze the quality of PBT.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源