《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (1): 215-220.DOI: 10.11772/j.issn.1001-9081.2021111891

• 计算机软件技术 • 上一篇    下一篇

析取回答集程序设计结构化测试方法

杨东, 王以松   

  1. 贵州大学 计算机科学与技术学院,贵阳 550025
  • 收稿日期:2021-11-08 修回日期:2022-04-21 发布日期:2023-01-12
  • 通讯作者: 王以松(1975—),男,贵州思南人,教授,博士,CCF会员,主要研究方向:人工智能、知识表示与推理。yswang@gzu.edu.cn
  • 作者简介:杨东(1987—),男,贵州六盘水人,硕士研究生,CCF会员,主要研究方向:人工智能、知识表示与推理;
  • 基金资助:
    国家自然科学基金资助项目(61976065)。

Structural testing methods of disjunctive answer set programs

YANG Dong, WANG Yisong   

  1. College of Computer Science and Technology, Guizhou University, Guiyang Guizhou 550025, China
  • Received:2021-11-08 Revised:2022-04-21 Online:2023-01-12
  • Contact: WANG Yisong, born in 1975, Ph.D., professor. His research interests include artificial intelligence, knowledge representation and reasoning.
  • About author:YANG Dong, born in 1987, M. S. candidate. His research interests include artificial intelligence, knowledge representation and reasoning;
  • Supported by:
    This work is partially supported by National Natural Science Foundation of China (61976065).

摘要: 针对析取回答集程序的结构化测试基础理论匮乏的问题,系统化地提出析取回答集程序结构化测试覆盖的概念。首先,定义针对析取回答集程序的测试用例,确立析取回答集程序的主要测试实体为程序中的逻辑规则;其次,通过对规则的头、规则的体、规则的集合等不同测试目标构建了规则覆盖、定义覆盖、环覆盖等基本概念来模拟结构化测试中的语句覆盖、分支覆盖等概念;最后,提出了析取回答集程序的测试覆盖率计算公式,并举例说明各种覆盖下的覆盖率计算方法,并讨论了析取回答集程序的部分特殊性质和关键指标。

关键词: 回答集程序设计, 测试理论, 析取回答集程序, 结构化测试方法, 覆盖

Abstract: Focused on the lack of basic theories for structural testing of disjunctive answer set programs, concepts of structured test coverage for disjunctive answer set programs was proposed systematically. Firstly, the test cases of disjunctive answer set programs were defined, and the logic rules in the program were determined to be the main test entities of disjunctive answer set programs. Then, the basic concepts such as rule coverage, definition coverage and loop coverage were constructed for different test targets such as rule header, rule body, and rule set to simulate the concepts such as statement coverage and branch coverage in structural testing. Finally, the calculation formula of test coverage rate for disjunctive answer set programs was proposed, and different coverage calculation methods under different types of coverage were illustrated in samples. At the same time, some special characteristics and key indicators of the disjunctive answer set programs were discussed.

Key words: Answer Set Programming (ASP), testing theory, disjunctive answer set program, structural testing method, coverage

中图分类号: