Test Case Prioritization (TCP) is a critical technique for improving efficiency in CI/CD pipelines. While applying Large Language Models (LLMs) to this task is a promising direction due to their advanced code comprehension, naively using them as monolithic tools fails to address key engineering challenges of scale, tool-integration, and structured reasoning. To address these shortcomings, we propose AgentTCP, a novel collaborative multi-agent framework for change-aware test case prioritization. Our framework decomposes the TCP task into a structured, three-stage workflow managed by specialized, LLM-driven agents: 1) a Code Change Analyst assesses the intent and risk of new commits; 2) a Test Coverage Strategist correlates changes with test cases by interacting with coverage data via tool-integration; 3) a Risk-aware Prioritizer synthesizes all information to generate a final, ranked list with reasoning. By delegating distinct responsibilities, AgentTCP mitigates the context and reasoning issues of monolithic models and produces verifiable intermediate results, enhancing overall trustworthiness. Experimental results on the widely used Defects4J benchmark demonstrate that AgentTCP surpasses the monolithic-LLM baseline by 11.75 points in terms of the APFD metric, highlighting its superior effectiveness in prioritizing fault-revealing test cases.
更多
查看译文
关键词
Test case prioritization,Large language model,Agent,Regression testing