Unit Testing in ASP Revisited: Language and Test-Driven Development Environment
This work addresses the problem of improving software correctness and development efficiency for users of Answer Set Programming, though it is incremental as it builds on prior unit testing languages in ASP.
The paper tackles the lack of integrated unit testing in Answer Set Programming (ASP) by proposing a new specification language that allows inlining tests within ASP programs and analyzing their computational complexity, resulting in a novel test-driven development environment for ASP.
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.