Unit testing frameworks are nowadays considered a best practice, included in almost all modern software development processes, to achieve rapid development of correct specifications. Knowledge representation and reasoning paradigms such as Answer Set Programming (ASP), that have been used in industry-level applications, are not an exception. Indeed, the first unit testing specification language for ASP was proposed in 2011 as a feature of the ASPIDE development environment. Later, a more portable unit testing language was included in the LANA annotation language. In this paper we revisit both languages and tools for unit testing in ASP. We propose a new unit test specification language that allows one to inline tests within ASP programs, and we identify the computational complexity of the tasks associated with checking the various program-correctness assertions. Test-case specifications are transparent to the traditional evaluation, but can be interpreted by a specific testing tool. Thus, we present a novel environment supporting test driven development of ASP programs.
翻译:单元测试框架如今被视为最佳实践,几乎已纳入所有现代软件开发流程中,以实现正确规范的快速开发。知识表示与推理范式(如答案集编程(ASP))已在工业级应用中得到使用,亦不例外。事实上,首个用于ASP的单元测试规范语言于2011年作为ASPIDE开发环境的一项功能提出。随后,一种更具可移植性的单元测试语言被纳入LANA注释语言。本文重新审视了ASP中用于单元测试的两种语言及工具。我们提出了一种新的单元测试规范语言,允许在ASP程序内联测试,并明确了与检查各种程序正确性断言相关的任务的计算复杂度。测试用例规范对传统评估透明,但可由特定测试工具进行解释。因此,我们提出了一种支持ASP程序测试驱动开发的新型环境。