arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.07924cs.SE
收藏

基于上下文驱动的问题生成测试问答软件

Testing Question Answering Software with Context-Driven Question Generation

Renmin University of China(中国人民大学);Tianjin University(天津大学)

Shuang Liu, Zhirun Zhang, Jinhao Dong, Zan Wang, Qingchao Shen, Junjie Chen, Wei Lu, Xiaoyong Du

AI总结:

针对现有问答软件测试方法生成问题不自然、缺乏上下文多样性的局限,提出上下文驱动的CQ²A方法,通过提取上下文实体关系生成问题并验证,实验表明其在错误检测等多方面优于现有方法,还能降低被测软件微调后的错误率。

摘要:

问答软件正日益融入我们的日常生活,典型示例包括Apple Siri和Amazon Alexa。确保此类系统的质量至关重要,因为错误答案可能导致严重危害。当前最先进的测试方法将蜕变关系应用于现有测试数据集,基于这些关系生成测试问题。然而,这些方法存在两个关键局限性:一是常生成人类不太可能提出的不自然问题,降低了生成问题在识别现实场景中可能出现的错误的有效性;二是这些问题从预先存在的测试数据集生成,忽略了更广泛的上下文,从而限制了生成问题的多样性和相关性。在这项工作中,我们引入CQ²A,一种用于测试问答系统的上下文驱动问题生成方法。具体而言,CQ²A从上下文中提取实体和关系以形成真实答案,并利用大型语言模型基于这些真实答案和周围上下文生成问题。我们还提出一致性验证和约束检查以提高LLM输出的可靠性。在三个数据集上进行的实验表明,CQ²A在错误检测能力、生成问题的自然性以及上下文覆盖方面优于最先进的方法。此外,CQ²A生成的测试用例在用于微调被测问答软件时降低了错误率。

英文摘要:

Question-answering software is becoming increasingly integrated into our daily lives, with prominent examples including Apple Siri and Amazon Alexa. Ensuring the quality of such systems is critical, as incorrect answers could lead to significant harm. Current state-of-the-art testing approaches apply metamorphic relations to existing test datasets, generating test questions based on these relations. However, these methods have two key limitations. First, they often produce unnatural questions that humans are unlikely to ask, reducing the effectiveness of the generated questions in identifying bugs that might occur in real-world scenarios. Second, these questions are generated from pre-existing test datasets, ignoring the broader context and thus limiting the diversity and relevance of the generated questions. In this work, we introduce CQ^2A, a context-driven question generation approach for testing question-answering systems. Specifically, CQ^2A extracts entities and relationships from the context to form ground truth answers, and utilizes large language models to generate questions based on these ground truth answers and the surrounding context. We also propose the consistency verification and constraint checking to increase the reliability of LLM's outputs. Experiments conducted on three datasets demonstrate that CQ^2A outperforms state-of-the-art approaches on the bug detection capability, the naturalness of the generated questions as well as the coverage of the context. Moreover, the test cases generated by CQ^2A reduce error rate when utilized for fine-tuning the QA software under test

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑