Computer Science course instructors routinely have to create comprehensive test suites to assess programming assignments. The creation of such test suites is typically not trivial as it involves selecting a limited number of tests from a set of (semi-)randomly generated ones. Manual strategies for test selection do not scale when considering large testing inputs needed, for instance, for the assessment of algorithms exercises. To facilitate this process, we present TestSelector, a new framework for automatic selection of optimal test suites for student projects. The key advantage of TestSelector over existing approaches is that it is easily extensible with arbitrarily complex code coverage measures, not requiring these measures to be encoded into the logic of an exact constraint solver. We demonstrate the flexibility of TestSelector by extending it with support for a range of classical code coverage measures and using it to select test suites for a number of real-world algorithms projects, further showing that the selected test suites outperform randomly selected ones in finding bugs in students' code.
翻译:计算机科学课程指导员通常必须创建全面的测试套件来评估编程任务。 创建这样的测试套件通常并非微不足道, 因为它需要从一组( 半) 随机生成的( 半) 中选择数量有限的测试。 在考虑评估算法练习所需的大量测试投入时, 测试选择的手工战略并不规模。 为了便利这一过程, 我们介绍测试选择器, 一个为学生项目自动选择最佳测试套件的新框架。 测试选择器相对于现有方法的主要优势在于它很容易被任意复杂的代码覆盖措施所扩展, 而不是要求将这些措施编码成精确的制约解算器的逻辑。 我们展示了测试选择器的灵活性, 支持一系列经典代码覆盖措施, 并使用它为一系列真实世界的算法项目选择测试套件, 进一步显示选中的测试套件在查找学生代码中的错误时超越随机选择的套件。