The application discloses a RAG and MCP-based structured
test case generation method and
system, and relates to the technical field of tool calling.The method comprises the following steps: constructing a RAG
knowledge base, carrying out blocking, vectorization and storage on test-related documents, and storing a test parameter set.Making use of a test task parser, a user
system-level test task is decomposed into an atomic task
package.A RAG retrieval interface is called, the atomic task
package text is converted into a vector query condition, relevant fragments are matched in the vector
database, and the original text is reserved.A large
language model extracts parameters from the test parameter set and generates structured test cases according to the matched fragments, the original text and generation requirements, calls an interface of a
test case generator through an MCP protocol, and stores the structured test cases in a
test case storage module for calling and execution by an automatic test framework.The method solves the problem that existing test case design mainly relies on manual experience and consumes a large amount of time and labor cost.