Test case generation cooperation system and method for automobile BCM
By designing test cases to generate a multi-agent system, the problems of high cost and low efficiency in BCM software testing are solved, and a closed-loop collaboration between structured test case generation and review is achieved, thereby improving testing efficiency and quality.
Patent Information
- Application Number
- CN202512027441.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies in BCM software testing suffer from high manual design costs and insufficient coverage, unstructured test cases generated by LLM, complex integration of heterogeneous toolchains, and a lack of a generation-review closed loop, resulting in low testing efficiency and high quality risks.
Design a multi-agent test case generation system, employing an interface layer, a multi-agent collaboration layer, a model management layer, a data persistence layer, and a tool and log layer to achieve a closed-loop collaborative mechanism of "test case generation agent - test case review agent - human review". Generate a strictly structured test case set through time sequence decomposition, trigger atomication, and signal value binding.
It significantly reduces the cost of test case writing and review, improves coverage and consistency, achieves structured, database-ready, and traceable test cases, and seamlessly integrates with the toolchain, ensuring the stability of the generation and review process.
Smart Images

Figure CN121958102A_ABST
Abstract
Description
A collaborative system and method for test case generation in automotive BCM Technical Field
[0001] This invention relates to the field of automotive electronic software testing technology. Background Technology
[0002] The Body Control Module (BCM) is a core component of modern automobiles, responsible for managing the complex functions of numerous vehicle electrical systems, including windows, doors, lights, wipers, and anti-theft systems. Testing BCM software is an extremely tedious and crucial task, currently facing the following main challenges: 1) High manual design costs and coverage blind spots: BCM functions involve numerous state combinations, timing dependencies, and CAN / LIN bus interactions between multiple ECUs. Manually writing test cases by test engineers is not only extremely time-consuming but also prone to overlooking complex boundary conditions, abnormal scenarios, and concurrent operations, resulting in insufficient test coverage and potential quality risks.
[0003] 2) Limitations of Direct LLM Application: Directly using a general large language model to generate BCM test cases often yields poor results. The output is usually an unstructured natural language description, lacking crucial information executable by the HIL (Hardware-in-the-Loop) test platform, such as CAN signal names, specific signal values (e.g., 0x01, 0x0A), and timing constraints (e.g., a 200ms delay).
[0004] 3) Integration barriers of heterogeneous toolchains and models: The automotive industry testing ecosystem is complex, and companies may introduce multiple LLM providers (such as DeepSeek, Qwen, etc.). Different models have different API interfaces and capabilities, making efficient and stable engineering integration with existing test management platforms and HIL automation toolchains a complex and costly task.
[0005] 4) Lack of an effective "generation-review" closed loop: Most existing automation solutions are "one-time generation" and lack built-in quality gates. Logical fallacies, inconsistencies with requirements, or failure to meet testability requirements may exist in AI-generated use cases, requiring a significant amount of manual review and correction.
[0006] While existing BCM testing systems exist, such as the patent application CN 102681532A, published on September 19, 2012, entitled "A Simulation Testing System for BCM," the disclosed system includes: a simulated load, a state signal conditioning circuit connected to the simulated load, a simulation test host connected to the state signal conditioning circuit, an instruction signal conditioning circuit connected to the simulation test host, and a fault simulation module connected to the instruction signal conditioning circuit. However, such systems struggle to complete the entire process of generation, testing, and review. Therefore, they lack a closed-loop collaborative mechanism of "test case generation agent—test case review agent—human review," and lack methods and systems capable of automatically generating rigorously structured, database-ready test case sets for BCM scenarios. Summary of the Invention
[0007] The technical problem to be solved by this invention is to realize a multi-agent system and method for generating test cases specifically designed for the automotive BCM field. It has a closed-loop collaborative mechanism of "test case generation agent - test case review agent - human review" and automatically generates a strictly structured test case set that can be stored in the database for BCM scenarios.
[0008] To achieve the above objectives, the technical solution adopted in this invention is a collaborative test case generation system for automotive BCM. The system includes: an interface layer that provides files, tasks, reviews, and Q&A, and returns incremental results in a streaming manner using SSE; a multi-agent collaboration layer that connects and interacts with the interface layer, including test case generation agents and test case review agents, using polling dialogue combined with termination condition control; a model management layer that connects to and receives instructions from the multi-agent collaboration layer, used for unified adaptation to multiple models, and for task-level reference tracking and cleanup; a data persistence layer that connects to the interface layer, receives and stores three types of entities: files, tasks, and review history, and records state machines and write-back traces; and a tool and log layer that connects to and sends data to the interface layer, used for robust JSON extraction, unified logging and rotation, and structured download and export.
[0009] The system also includes: a client, which connects to the interface layer and is used to send script data to the interface layer; and a model provider, which connects to the model management layer and is used to receive model data sent by the model management layer.
[0010] A collaborative test case generation method based on the aforementioned collaborative test case generation system for automotive BCM includes the following steps: Step 1, requirement analysis; Step 2, generation and review; Step 3, human-machine collaboration and batch revision; Step 4, result export.
[0011] In step 1, the Excel version of the requirements is imported and converted into JSON; the fields include "requirement number / functional module / sub-function / test purpose / preconditions / test steps / expected results / test level / specification chapter number".
[0012] In step 2, the functions to be executed are generated and decomposed into time sequences; the contents of the functions to be executed in step 2 include: positive actions, negative actions, and boundary conditions.
[0013] In step 2, the generated execution function review is completed, checking the continuity of numbering, coverage gaps, signal accuracy and measurability, and generating an APPROVE or structured rejection report.
[0014] In step 3, the human makes modifications to the triggering conditions, execution output, and signal values, and the AI performs minimal editing on the specified use case number based on the instructions and outputs a complete JSON array.
[0015] In step 4, the task aggregation has been completed and exported as a standard field set for implementation or integration with enterprise toolchains.
[0016] This invention provides a dual-channel fault-tolerant solution of "multi-agent streaming → SSE bridging → direct connection model degradation" to ensure real-time interaction and stability. It constructs a unified model client across vendors and a task-level context recycling mechanism to reduce access and maintenance complexity. It enables a closed-loop collaborative mechanism of "test case generation agent—test case review agent—human review," automatically generating strictly structured, database-compatible test case sets for BCM scenarios. The principles of "time-sequence decomposition + trigger atomization + signal value binding" ensure the testability and coverage completeness of complex functions. Attached Figure Description
[0017] The following is a brief description of the contents expressed in each of the accompanying drawings in this specification: Figure 1 is a system overall architecture diagram; Figure 2 is a generation-review timing diagram; Figure 3 is a schematic diagram of streaming SSE bridging and direct connection degradation; Figure 4 is a flowchart of human-machine co-creation write-back and review history recording; Figure 5 is a schematic diagram of the decomposition and coverage of typical BCM functions (such as door lock / lighting / power mode). Detailed Implementation
[0018] The following description, with reference to the accompanying drawings, details the specific implementation of the present invention, including the shape and structure of each component, the relative positions and connections between the parts, the function and working principle of each part, the manufacturing process, and the operation and use methods, to help those skilled in the art to have a more complete, accurate, and in-depth understanding of the inventive concept and technical solution of the present invention.
[0019] This invention utilizes a Large Language Model (LLM) and Multi-Agent collaborative mechanism to automate the structured generation, quality review, and human-machine collaborative optimization of test cases for the Body Control Module (BCM) and related on-board ECUs (Electronic Control Units). It also achieves a system and method for low-latency interaction and unified adaptation across model providers through streaming SSE bridging.
[0020] As shown in Figure 1, the system mainly consists of an interface layer: providing APIs for files, tasks, reviews, Q&A, etc.; and returning incremental results in SSE streaming mode.
[0021] Multi-agent collaboration layer: includes a test case generation agent (primary) and a test case review agent (critic), using polling dialogue combined with termination condition control (such as stopping upon receiving "APPROVE").
[0022] Model management layer: Unified adaptation to multiple models, supports task-level reference tracking and cleanup; can be switched / reused according to strategy.
[0023] Data persistence layer: three types of entities: files, tasks, and review history; recording state machine and write-back traces.
[0024] Tools and logging layer: robust JSON extraction, unified logging and rotation, structured download and export.
[0025] The client connects to the interface layer and is used to send script data to the interface layer; the model provider connects to the model management layer and is used to receive model data sent by the model management layer.
[0026] Based on the above system architecture, the specific collaborative method for generating test cases for automotive BCM includes: 1. Requirement access: Parse Excel / Markdown / text requirements into standardized JSON; check the completeness and validity of fields, i.e., import the Excel version of the requirements and convert it into JSON; the fields include "requirement number / functional module / sub-function / test purpose / preconditions / test steps / expected results / test level / specification chapter number" 2. Test case generation: Generate Agents to produce test case sets according to the "time sequence decomposition principle"; uniform numbering (e.g., TC_[requirement number]_001…), trigger atomicity, and signal value binding.
[0027] For example, the generation of the Agent to perform the timing decomposition of the "door locking" function is as follows: Forward: ON power, all doors closed → locking action → door state locked (Door_Lock_State=0x1).
[0028] Negative: Left front door half open → Locking request → System remains unlocked and alarm sounds.
[0029] Boundary: Verification of actions near the low voltage threshold.
[0030] The review agent checks for continuity of check numbers, coverage gaps (negative / mutually exclusive / boundary / communication timeout), signal accuracy and measurability, and generates an APPROVE or structured rejection report.
[0031] 3. Quality Review: The review agent conducts a two-tiered review process based on "fatal issues / general issues"; if issues are found, a structured rejection report is generated; if no issues are found, the process returns "APPROVE" to terminate the review.
[0032] 4. Streaming Bridge: Multi-agent incremental segments are segmented according to the "speaking source" boundary and mapped to SSE events; in case of anomalies, it automatically degrades to a direct connection model streaming.
[0033] 5. Human-Machine Collaborative Creation and Writeback: Humans submit feedback → AI batch regenerates → Task results are replaced point-to-point using "use case number" as the key; review history and status are saved.
[0034] Humans propose modifications to the "triggering conditions / execution output / signal values"; the AI performs minimal editing on the specified test case number based on the instructions and outputs a complete JSON array; the task results are updated with the "test case number" as the key, and `ReviewHistory` is retained for audit playback.
[0035] 6. Concurrency and Status: Set thresholds (e.g., ≤3) for concurrent task generation of the same file; the entire task status chain (0 / 1 / 2 / 3, generated / reviewed / completed / failed) is observable. Enable result export; completed tasks are aggregated and exported as a standard set of fields (e.g., test case number, usage condition, test method, preconditions, trigger conditions, execution output, test results, etc.) for implementation or integration with enterprise toolchains.
[0036] Example (excerpt, JSON structured test case): ```json[{"Test Case Number": "TC_DoorLock_001","Test Purpose": "Positive Function Verification of Door Locking in ON State","Preconditions": ["VCU_PowerMode = 0x2: ON", "All_Doors_Closed = true"],"Trigger Conditions": ["Drv_Lock_Button = 0x1: Press"],"Execution Output": ["Door_Lock_State = 0x1: Locked", "Cluster_Door_Indicator= Locked"]},{"Test Case Number": "TC_DoorLock_002","Test Purpose": "Negative Isolation Verification of Left Front Door Half-Open","Preconditions": ["VCU_PowerMode = 0x2: ON", "FL_Door_Ajar = true"],"Trigger Conditions": ["Drv_Lock_Button = 0x1: Press"],"Execution Output": ["Door_Lock_State = 0x0: Unlocked", "Cluster_Warning =Door_Ajar"]}] "Temporal decomposition": Decomposes functional processes containing causal / temporal dependencies into multiple independently verifiable test cases.
[0037] “SSE Bridging”: Maps the incremental output of multi-agent systems to a sequence of text / event-stream events.
[0038] "Point-to-point replacement": Minimizes modifications to the target use case using the use case number as the key while maintaining the array order.
[0039] The above method employs time-series decomposition, meaning that the "execution output" of the preceding use case must be a "precondition" for the following use case; compressing multi-step processes into a single use case trigger condition is strictly prohibited. Trigger atomicity is used, with each use case trigger condition retaining only one core action / signal change. Furthermore, it enables precise signal representation; functional descriptions must include bus signal names and discrete values (e.g., VCU_PowerMode=0x2:ON). It also features write-back alignment, using the "use case number" as the primary key for stable replacement, avoiding misalignment caused by sequential changes.
[0040] In summary, the collaborative test case generation system and method for automotive BCM have the following advantages: 1) Significantly reduces the cost of test case writing and review, and significantly improves coverage and consistency; 2) Stable test case structure, can be stored in the database, and is traceable; seamless integration with front-end and back-end toolchains; 3) Streaming experience with low latency; dual-channel fault tolerance ensures uninterrupted generation / review process; 4) Unified cross-supplier adaptation and task-level recycling reduce the engineering complexity caused by interface heterogeneity.
[0041] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution of the present invention, or the direct application of the inventive concept and technical solution of the present invention to other occasions without modification, are all within the protection scope of the present invention.
Claims
1. A collaborative test case generation system for automotive BCM, characterized in that, The system comprises: an interface layer that provides files, tasks, reviews, and Q&A, returning incremental results in SSE streaming mode; a multi-agent collaboration layer that connects and interacts with the interface layer, including test case generation agents and test case review agents, using polling dialogue combined with termination condition control; a model management layer that connects to and receives instructions from the multi-agent collaboration layer, used for unified adaptation to multiple models, and for task-level reference tracking and cleanup; a data persistence layer that connects to the interface layer, receiving and storing three types of entities: files, tasks, and review history, recording state machines and write-back traces; and a tool and log layer that connects to and sends data to the interface layer, used for robust JSON extraction, unified logging and rotation, and structured download and export.
2. The collaborative test case generation system for automotive BCM according to claim 1, characterized in that, The system also includes: a client, which connects to the interface layer and is used to send script data to the interface layer; and a model provider, which connects to the model management layer and is used to receive model data sent by the model management layer.
3. A collaborative method for generating test cases based on the collaborative test case generation system for automotive BCM as described in claim 1 or 2, characterized in that, Includes the following steps: Step 1: Requirements Analysis; Step 2: Generation and Review; Step 3: Human-Machine Collaboration and Batch Revision; Step 4: Result Export.
4. The collaborative method for generating test cases for automotive BCM according to claim 3, characterized in that: In step 1, the Excel version of the requirements is imported and converted into JSON; the fields include "requirement number / functional module / sub-function / test purpose / preconditions / test steps / expected results / test level / specification chapter number".
5. The collaborative test case generation system for automotive BCM according to claim 3 or 4, characterized in that, In step 2, the functions to be executed are generated and their timing is decomposed.
6. The collaborative test case generation system for automotive BCM according to claim 5, characterized in that, Step 2 includes the following functions: positive actions, negative actions, and boundary conditions.
7. The collaborative test case generation system for automotive BCM according to claim 6, characterized in that, In step 2, the generated execution function review is completed, checking the continuity of numbering, coverage gaps, signal accuracy and measurability, and generating an APPROVE or structured rejection report.
8. The collaborative test case generation system for automotive BCM according to claim 3 or 7, characterized in that, In step 3, the human makes modifications to the triggering conditions, execution output, and signal values, and the AI performs minimal editing on the specified use case number based on the instructions and outputs a complete JSON array.
9. The collaborative test case generation system for automotive BCM according to claim 8, characterized in that, In step 4, the task aggregation has been completed and exported as a standard field set for implementation or integration with enterprise toolchains.
Citation Information
Patent Citations
Simulating test system for BCM (body control module)
CN102681532A
