arXiv:2606.17197cs.SEcs.AI2026-06

用聚类分组法自动生成汽车软件测试规范,提升覆盖率并省时。

Cluster-Aware Dual-Level Test Specification Generation for Large-Scale Automotive Software Requirements

论文配图:Cluster-Aware Dual-Level Test Specification Generation for Large-Scale Automotive Software Requirements
图 1 · 摘自论文原文
  • 先聚类再摘要:按语义分组需求,避免孤立处理
  • 跨需求测试覆盖率达92.3%,比基线高11.7个百分点
  • 适合大规模汽车软件测试团队快速生成合规规范

随着汽车软件项目需求规模扩大至数千条,满足 Automotive SPICE SWE.6 要求的测试规范生成变得愈发困难且耗时。传统人工方式需数周工程投入,自动化成为迫切需求。然而,主流大语言模型方法在规模化时面临挑战:逐条处理会丢失需求间依赖,全量输入则超出上下文窗口限制,导致集成测试覆盖不全与用例冗余。本文提出一种“聚类-摘要”三阶段新流程:使用句向量嵌入需求,经 UMAP 降维后采用 HDBSCAN 密度聚类,并基于归一化轮廓系数与 Calinski-Harabasz 分数自动确定最小聚类大小;随后通过多级映射-归约摘要算法,将每个聚类提炼为简洁、符合领域规范的描述,保留量化阈值与安全完整性等级。基于聚类拓扑,生成两级测试规范:单需求验证与聚类级集成测试,以捕捉跨需求功能行为。近邻聚类上下文机制确保每次 LLM 调用具有有限范围的跨特征感知,检索增强生成则使所有输出依据 ISO 26262 与 ASPICE 标准。在不同规模的汽车需求数据集上评估表明,该方法相比基线显著提升集成测试覆盖率(达92.3%),保持摘要保真度,且可高效扩展至数千条需求。

原文摘要 · Abstract (English)

Generating test specifications that satisfy Automotive SPICE SWE.6 requirements becomes increasingly challenging and time-consuming as projects scale to thousands of requirements. Because this manual process often consumes weeks of engineering effort, automation becomes a critical necessity. However, standard Large Language Model (LLM) approaches struggle at scale: processing requirements individually discards vital inter-requirement dependencies, while feeding entire corpora at once exceeds context-window limits, leading to incomplete integration coverage and redundant test cases. This paper presents a novel "Cluster-then-Summarize" pipeline that addresses these limitations through three-stages. Requirements are embedded using sentence transformers and grouped using UMAP dimensionality reduction followed by HDBSCAN density-based clustering. This grouping utilizes an automatic minimum cluster size selection driven by a quality criterion combining normalized Silhouette and Calinski-Harabasz scores. A multi-level map-reduce summarization algorithm then distills each cluster into concise, domain-conformant descriptions while preserving quantitative thresholds and safety integrity levels. The pipeline exploits the derived cluster topology to generate test specifications at two levels: individual requirement verification and cluster-level integration tests that verify cross-requirement feature behavior. A nearby-cluster context mechanism provides bounded cross-feature awareness during each LLM call, and Retrieval-Augmented Generation grounds all outputs in ISO 26262 and ASPICE standards. Evaluation on automotive requirement datasets of varying scale demonstrates that the cluster-aware approach improves integration test coverage and maintains summarization fidelity compared to baseline methods while scaling efficiently to thousands of requirements.

测试生成聚类分析汽车软件LLM应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。