Automobile software test generation method and system

By generating temporal logic reductions using event-condition-action requirement tuples and a deterministic compiler, and combining a model checker and product state search, the structural instability of natural language requirements in automotive software testing is solved, enabling efficient generation of high-quality test cases that cover the conditional independence goal of complex automotive software.

CN123178286APending Publication Date: 2026-11-27UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611708343.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-31
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently and automatically generate high-quality automotive software test cases from natural language requirements, especially when dealing with complex automotive software requirements involving changes in door status and multiple operational outputs. They cannot effectively maintain the correlation between trigger branches and output actions, as well as the conditions before and after changes.

Method used

The natural language requirements are structured into five tuples using Event-Condition-Action Requirement Tuples (ERT). A deterministic compiler generates a temporal logic reduction, a model checker generates an reachable state graph, and a complete abstract test trajectory is generated by combining finite value range constraints and product state breadth-first search. The test trajectory is then executed and evidence is traced on an independent simulation model.

Benefits of technology

It significantly improves the executability and traceability of specification generation, generates a compact test set, covers the conditional independence coverage target of multiple functional units, and improves the reliability and efficiency of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178286A_ABST
    Figure CN123178286A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of automobile software testing, and discloses an automobile software test generation method and system. The method comprises the following steps: analyzing natural language requirements and signal definitions of automobile software functions, constructing atomic function units and event-condition-action requirement tuples; performing deterministic semantic verification on the tuples, generating a timing logic specification, and generating a reachable state graph determined by the timing logic specification; solving a standard level correction condition / determination coverage candidate assignment pair, performing a product state breadth-first search on the reachable state graph, and generating a complete abstract test trajectory; and specificating the abstract test trajectory into executable test cases in combination with test bench metadata, executing the test cases on an independently developed simulation model, and recording whole-process traceability evidence. The application realizes automatic generation from natural language requirements to executable test cases, and significantly improves the generation efficiency and traceability of automobile software testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive software testing technology, and specifically to an automotive software test generation method and system. Background Technology

[0002] With the continuous improvement of vehicle intelligence and connectivity, the scale and complexity of automotive software systems are constantly increasing, and their functional safety requirements are becoming increasingly stringent. This has placed clear normative requirements on the development, verification, and testing of automotive electronic systems. Among these, testing, as a key link in ensuring software quality, runs through the entire process from requirements to implementation. Against this backdrop, how to efficiently and automatically generate high-quality test cases from functional requirements written in natural language has become a significant challenge in the field of automotive software engineering.

[0003] In the field of automotive software test generation, existing technologies are mainly developing in the following directions.

[0004] (I) Formalization and test generation based on structured natural language requirements: The Formal Requirements Elicitation Tool (FRET) uses Fresh structured natural language to generate temporal logic formulas based on fields such as scope, conditions, time, and response, providing support for the formal expression and analysis of requirements. This invention further addresses the generation of trigger action associations, pre- and post-change associations, and reachability test trajectories in automotive control requirements, integrating requirement representation, deterministic compilation, and test specification into a unified process. The Digital Object Identifier (DOI) for related FRET literature is 10.1016 / j.infsof.2021.106590.

[0005] (II) Generating action sequence logic and formal specifications directly from natural language: In recent years, large language models have also been used to generate formal reductions from natural language. The work "From Informal to Formal—Incorporating and Evaluating LLMs on Natural Language Requirements to Verifiable Formal Proofs," published by Cao et al. at the 2025 Association for Computational Linguistics Conference, investigated five formal languages ​​and six types of formalization tasks. Coq and Lean4 are interactive theorem proving tools and languages, Dafny is a language supporting program verification, ACSL is a reduction language for C programs, and TLA+ is a formal reduction language based on action-temporal logic. Methods that directly generate the target formal language can use TLA+ as an output; this invention stores the requirement associations through event-condition-action requirement tuples, and then uses a deterministic compiler to generate the target reduction.

[0006] (iii) Test generation based on use case models or controlled natural language intermediate representations: The UMTG test generation method, based on test cases, generates executable and traceable system-level tests based on test case specifications and domain models. This work was published at the 2015 International Symposium on Software Testing and Analysis (DOI: 10.1145 / 2771783.2771812). NAT2TESTSCR is a natural language requirements test generation method based on Software Cost Reduction (SCR) specifications. It converts controlled natural language requirements into SCR specifications through intermediate semantic representation, and then combines this with the test generation tool T-VEC to generate tests. It has already been applied to automotive turn signal systems. The corresponding literature is Carvalho et al., “NAT2TESTSCR: Test Case Generation from Natural Language Requirements Based on SCR Specifications”, Science of Computer Programming, Vol. 95, 2014, pp. 275–297 (DOI: 10.1016 / j.scico.2014.06.007). This invention focuses on the objective of conditional independence in requirements, and further combines the ordered reachability relationships in formal state diagrams to generate test trajectories.

[0007] (iv) Test generation based on model-based state space traversal inspection: Mocket is a test generation tool based on model-checked state graphs. It utilizes the state graph generated by TLA+ model checking, traversing the graph guided by edge coverage to generate test paths for testing distributed system implementations. Unlike edge-coverage-guided traversal, this invention derives specification-level correction conditions / decision coverage targets from formal requirement decisions, searches for the complete trajectory of independence assignment pairs, and concretizes this trajectory into tests oriented towards independent simulation models under test.

[0008] For automotive software requirements involving door state changes, multiple operation sources, and multiple control outputs, test generation needs to maintain the association between trigger branches and output actions, and between pre-change and post-change conditions. For assignment pairs that satisfy conditional independence constraints, it is also necessary to determine whether they can be implemented sequentially from a legal initial state. This invention combines associative semantic representation, deterministic compilation, finite value range candidate solution, and ordered reachability search to associate each implemented conditional independence coverage target with a complete abstract test trajectory. Furthermore, it generates tests for independent simulation models under test through general test bench metadata, recording the association information from requirements to execution results. Summary of the Invention

[0009] To address the aforementioned technical problems, this invention provides a method and system for generating automotive software tests.

[0010] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for generating automotive software tests, comprising: The natural language requirements of automotive software functions and the definitions of signals corresponding to the control functions of the on-board electronic control unit under test are analyzed to construct atomic functional units and event-condition-action requirement tuples. The tuples are five-tuples, representing function name, precondition, trigger condition, output action and exit condition respectively. Signals include input signals and output signals. The tuples are subjected to deterministic semantic verification, a temporal logic reduction is generated by a deterministic compiler based on signal roles, and a reduction parser and a model checker are called to generate an reachable state graph determined by the temporal logic reduction. Based on the finite range constraints of the signals referenced in the decision expression, the canonical-level correction conditions / decision coverage candidate assignment pairs are solved and generated. A product state breadth-first search is performed on the reachable state graph to generate a complete abstract test trajectory from the legal initial state through the state matching the two target assignment vectors. The complete abstract test trajectory is combined with test bench metadata to concretize into executable test cases, which are executed on an independently developed simulation model, and the entire process traceability evidence from requirements to execution results is recorded.

[0011] In one embodiment, the process of parsing the natural language requirements of automotive software functions and defining the signals corresponding to the control functions of the tested on-board electronic control unit, and constructing atomic functional units and event-condition-action requirement tuples, specifically includes: The atomic functional unit is represented as u=(f,S), where f is a natural language requirement describing a function of automotive software, and S is a set of signals related to the natural language requirement; each signal s in S records the signal name and natural language definition, signal role, finite value range, and test bench metadata; The signal roles are used to distinguish between input signals and output signals, and the target signal assigned a value in the action belongs to the output signal; the finite value range includes Boolean quantities, enumerated quantities, discrete values, or finite intervals divided by continuous physical quantities, which are used for constraint solving and model checking; the test bench metadata includes initial values, inactive values, hold time, input change delay, output sampling rules, comparison tolerance, and port mapping.

[0012] In one embodiment, the tuple is a quintuple, representing the function name, precondition, trigger condition, output action, and exit condition, specifically including: The event-condition-action requirement tuple ERT=(N,P,T,A,E) is used, where N is the function name identifier, P is the precondition, T is the trigger condition, A is the output action, and E is the exit condition. P, T, and E are constrained condition expressions. The output action is represented in one of the following two ways: one or more parallel assignments are recorded in A, or A is set to null and the guard condition and the corresponding set of assignments are recorded in the guard action field. The event-condition-action requirement tuple also sets three types of semantic fields: The transition event field is used to record the pairs of pre-change and post-change conditions in the same input state transition, and to retain the correspondence between each event branch; the pre-change condition limits the signal value before the transition occurs, and the post-change condition limits the signal value after the transition occurs; The guard action field is used to store the correspondence between the trigger branch and the output action. Each rule contains a guard condition and the corresponding set of output assignments. The ambiguity record field is used to record the correspondence between trigger branches and output actions that are not yet clearly defined in the natural language requirements, the correspondence between branches before and after changes, or the above correspondences that were not retained during structured extraction. When there are unresolved ambiguities, subsequent compilation and test generation will be prevented.

[0013] In one embodiment, the deterministic semantic verification of the tuple specifically includes: The tuple checker verifies the following constraints based on the finite range defined by the signal: (a): Each signal in the precondition P, trigger condition T, and exit condition E has been declared and has a non-empty finite value range, and the expressions corresponding to P, T, and E have been fully parsed; (b): When the precondition P and the trigger condition T both refer to the input signal, verify the relationship before and after the change within the declared finite value range; for simple conditions, it must be determined that the corresponding signal has changed; when there are multiple alternative branches, the branch pairing must be uniquely determined, or a verified explicit transition event pairing must be used; each pairing must have at least one input signal that has changed. (c): When using guard actions, the logic of each guard condition is equivalent to the trigger condition T within a finite value range, and rules that are triggered simultaneously will not assign conflicting values ​​to the same output signal.

[0014] In one embodiment, the generation of the timing logic specification using a deterministic compiler based on signal roles specifically includes: The compiler classifies the input signals referenced by preconditions or trigger conditions into three categories: context signals, transition signals, and momentary trigger signals. The context signal is an input signal that appears only in the preconditions, and the compiler reads the input value selected for this environment transition; The migration signal is a signal that has been verified to appear simultaneously in both the precondition and the trigger condition. The compiler reads the old state of the signal in the precondition and the new state of the signal in the trigger condition. The instantaneous trigger signal is an input signal that appears only in the triggering condition, and the compiler reads the input value selected for this environment transition; Based on the above signal classification, the compiler generates constant and variable declarations, type invariants, initial state predicates, environmental change relationships, output update relationships, and complete behavioral specifications for the sequential logic specification, and generates invariant constraints for variables that have not been assigned values ​​in the current state transition step.

[0015] In one embodiment, the step of solving for and generating canonical-level correction condition / decision coverage candidate assignment pairs based on the finite range constraints of the signal referenced in the decision expression specifically includes: Extract or construct a decision expression from the preconditions, trigger conditions, and exit conditions of the event-condition-action requirement tuple; for the atomic condition c in the decision expression D, assign two signal vectors. , A modified condition / decision coverage candidate assignment pair for c is constituted when the following conditions are met simultaneously: (a) Atomic condition c in and The truth value in the text is flipped; (b) Determine the other atomic conditions in expression D. and The truth value remains unchanged; (c) Determine expression D in and The result in the middle is flipped; The decision expression and the finite range of the signals referenced therein are converted into satisfiability modulus constraints. Candidate assignment pairs that satisfy the above conditions are enumerated and deduplicated. , These represent the first signal assignment vector and the second signal assignment vector in the candidate assignment pair, respectively. Each signal assignment vector records the value of the relevant signal for judgment. When a state in the reachable state diagram has the same value on the signal listed in the signal assignment vector, the state is said to match the signal assignment vector. The same signal assignment vector can match multiple complete states.

[0016] In one embodiment, performing a product-state breadth-first search on the reachable state graph to generate a complete abstract test trajectory from a valid initial state through states matching two target assignment vectors specifically includes: For each candidate assignment pair, respectively... and Two sequences determine the first target assignment vector `first` and the second target assignment vector `second`. A breadth-first search is performed on the Cartesian product Q×{0,1} of the reachable state set Q and the Boolean flag set {0,1}. Each state in the reachable state set Q is denoted as `q`, and `b` in the product state (q,b) indicates whether the current search path has already passed through the state that matches `first`. The initial state predicate `Init` in the reachable state set specifies the legal starting state. The search starts from all states that satisfy the initial state predicate `Init`. When `b=1` and `q` matches `second`, a complete abstract test trajectory containing the legal initial state and all intermediate states is returned. Each conditional independence coverage target, consisting of a decision expression and one of its atomic conditions, is recorded as one of four processing states: logically unsatisfiable, satisfiable but without ordered reachable witnesses, reachable and covered, or search failed. The found complete abstract test trajectory is added to the test set and associated with the corresponding conditional independence coverage target. The set of reachable targets is defined as the conditional independence coverage targets for which ordered reachable independence assignment pairs have been confirmed. Coverage is calculated as the ratio of the number of reachable targets actually covered in the test set to the total number of reachable targets. Each conditional independence coverage target is counted once, and the two search directions are not counted repeatedly. This ratio is not calculated when there are no confirmed reachable targets; if a search fails, an unresolved conditional independence coverage target is reported.

[0017] In one embodiment, the step of materializing the complete abstract test trajectory and test bench metadata into executable test cases specifically includes: Read the states and transitions in the complete abstract test trajectory sequentially, extract the input assignments and expected outputs derived from the requirements; based on the port mapping, interface type, input update time, retention method, output sampling rules and comparison tolerance in the test bench metadata, generate the input sequence with timestamps, expected output sequence and comparison rules, and organize them into tabular or scriptable executable test cases, retaining all transition steps from the legal initial state to the state matching the target assignment vector.

[0018] In one embodiment, the execution on an independently developed simulation model, and the recording of full-process traceability evidence from requirements to execution results, specifically includes: Read the executable test cases and associated test bench metadata, bind the input and output ports of the independent simulation model under test according to the port mapping in the test bench metadata, and reset the model according to the initialization configuration; The simulation model is driven by the timestamped input sequence in the executable test cases. The model is run within the corresponding hold interval, the actual output is collected according to the sampling rules, and the comparison is performed signal by signal and step by step according to the expected output sequence and comparison rules in the test cases. Each comparison record includes test case identifier, trajectory steps, output signal, expected value, actual value, sampling time and comparison parameters. Each test run is assigned a unique identifier and associated with and stored the requirement version, signal definition and finite value range, event-condition-action requirement tuple, timing logic reduction, output results of the reduction syntax analyzer and model checker, reachable state diagram, condition independence coverage target and complete abstract test trajectory to achieve the condition independence coverage target, test bench metadata, simulation model version and execution results, so that output differences can be traced back to the corresponding requirements and formal transformations.

[0019] In a second aspect, the present invention provides an automotive software testing generation system for implementing the method of any embodiment of the first aspect, comprising: The requirement parsing and tuple construction module is used to parse the natural language requirements of automotive software functions and the definitions of signals corresponding to the control functions of the on-board electronic control unit under test, and to construct atomic functional units and event-condition-action requirement tuples; the tuples are five-tuples, representing the function name, precondition, trigger condition, output action and exit condition respectively; the signals include input signals and output signals. The semantic verification and reduction compilation module is used to perform deterministic semantic verification on the tuples, generate a temporal logic reduction through a deterministic compiler based on signal roles, and call the reduction syntax analyzer and model checker to generate a reachable state graph determined by the temporal logic reduction. The candidate generation and trajectory search module is used to solve for the generation of canonical-level correction conditions / decision coverage candidate assignment pairs based on the finite value range constraints of the signals referenced by the decision expression, perform a product state breadth-first search on the reachable state graph, and generate a complete abstract test trajectory from the legal initial state through the state matching two target assignment vectors in sequence. The test specification and execution module is used to specify the complete abstract test trajectory and test bench metadata into executable test cases, execute them on an independently developed simulation model, and record traceability evidence of the entire process from requirements to execution results.

[0020] The system and method in this invention correspond to each other; the specific technical solutions applicable to the method are also applicable to the system.

[0021] This invention achieves the following beneficial technical effects by employing a four-layer progressive structure: event-condition-action requirement tuples as intermediate representations of requirement semantics, deterministic temporal logic reduction compilation and model checking, canonical-level correction condition / decision coverage search for reachability constraints, and test concretization and independent simulation model execution. First, this invention addresses the problem of unstable output structure and state semantics when directly generating formal specifications from natural language requirements. It structures the requirement name, preconditions, triggering conditions, output actions, and exit conditions using event-condition-action requirement tuples, and uses a deterministic compiler to uniformly generate TLA+ state and transition relationships, thereby significantly improving the executability and traceability of specification generation.

[0022] Second, the correspondence between the previous and subsequent states and triggering actions in the requirement explanation is stored through the associated fields. After well-formed and associated verification, deterministic compilation maintains the state transition semantics defined by the accepted event-condition-action requirement tuple, and generates test expected values ​​accordingly.

[0023] Third, by using finite value range candidate enumeration, bidirectional trial and product state breadth-first search, a complete abstract test trajectory starting from a legal initial state is generated for conditional independence coverage targets with ordered reachable independence assignment pairs. Four types of target processing states and unified reachability coverage statistics are given, so that the coverage evaluation can reflect both logical satisfiability and state graph reachability.

[0024] Fourth, among the 500 method records generated by five methods across 20 industrial functional units, each repeated 5 times, each method covers 5 repeated instances of 96 basic reachable targets, totaling 480 target instances; the median number of test cases generated by the method of this invention is 4.5, the original Mocket method is 8093, and breadth-first search, depth-first search, and random traversal are all 91, reflecting the compactness of the test set; all 218 deterministic reference event-condition-action requirement tuples have been compiled, and the generated reduction has been verified by the parser and TLA+ model checker. Attached Figure Description

[0025] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0026] A preferred embodiment of the present invention will now be described in detail with reference to the accompanying drawings.

[0027] like Figure 1 As shown, this invention provides a method for generating automotive software tests, comprising the following steps: S1, analyze the natural language requirements of the automotive software functions and the definition of signals corresponding to the control functions of the on-board electronic control unit under test, and construct atomic functional units and event-condition-action requirement tuples; the tuples are represented as five-tuples, which respectively represent function name, precondition, trigger condition, output action and exit condition; signals include input signals and output signals; S2, perform deterministic semantic verification on the tuple, generate a temporal logic reduction through a deterministic compiler based on signal roles, and call the reduction syntax analyzer and model checker to generate a reachable state graph determined by the temporal logic reduction; S3, based on the finite range constraints of the signals referenced in the decision expression, solve to generate canonical-level correction conditions / decision coverage candidate assignment pairs, perform a product state breadth-first search on the reachable state graph, and generate a complete abstract test trajectory from the legal initial state through the state matching the two target assignment vectors in sequence; S4 concretizes the complete abstract test trajectory into executable test cases by combining test bench metadata. These test cases are executed on an independently developed simulation model and record traceability evidence from the entire process from requirements to execution results.

[0028] The core concept of this invention lies in parsing natural language requirements into event-condition-action requirement tuples, generating TLA+ temporal logic specifications through deterministic compilation, and then constructing a reachability graph of the requirement specification using a model checker. Candidate assignment pairs for specification-level modified condition / decision coverage are derived from formal requirement decisions, and a complete abstract test trajectory for sequentially implementing these assignment pairs is searched on the reachability graph. After being materialized by test bench metadata, the trajectory is applied to the independent simulation model under test, forming an automated test chain from requirements, temporal logic specifications, condition independence coverage targets, abstract test trajectories to execution results. This embodiment uses the Simulink graphical modeling and simulation environment to support the model under test.

[0029] This method targets control functions such as door locking and lighting in vehicle electronic control units. It takes functional requirements, input / output signal definitions, and test interface configurations as inputs to generate test stimuli and expected outputs derived from requirements. The control function behavior is verified by executing and comparing the outputs of an independent simulation model under test.

[0030] The following will be introduced in several parts.

[0031] 1. Event-Condition-Action Requirement Tuple.

[0032] Taking natural language functional requirements and signal definitions as input, atomic functional units are constructed according to the correspondence between functional titles, requirement texts and signal tables. Then, the controlled structured extraction module generates event-condition-action requirement tuples, providing a unified input for subsequent deterministic formal compilation.

[0033] (1) Atomic functional units and finite-range signal information: An atomic functional unit is represented as u=(f,S), where f is the natural language requirement describing a function of automotive software, and S is the set of signals related to that requirement. Each signal is associated with the original natural language requirement and the following information is recorded: Signal Names and Natural Language Definitions: Used to connect signal descriptions, formal variables, and test bench interfaces in natural language requirements; Signal Roles: Distinguish between input and output signals. Input signals are vehicle status signals or operation signals received by the tested vehicle control function, while output signals are control requests generated by that function. Action assignment targets belong to output signals, such as the LeftRequest left-side locking request signal in LeftRequest=1.

[0034] Finite range: Provides a Boolean quantity, an enumerated quantity, a discrete numerical value, or a finite interval obtained by dividing a continuous physical quantity, for constraint solving and model checking; Test bench metadata includes initial values, inactive values, hold time, input change delay, output sampling rules, comparison tolerance, and model port mapping. Initial values ​​are the signal values ​​in the initial test state; inactive values ​​are the values ​​taken when the output does not issue a corresponding request.

[0035] The requirements parsing module can read Word documents (DOCX format) or requirements databases and save the requirements identifier, natural language requirements text, signal set, and the association between the limited value range of the signals for each atomic functional unit, so that the event-condition-action requirement tuple, timing logic specification, and test cases can all be traced back to the corresponding natural language requirements.

[0036] Table 1 shows the signal table for the left and right side locking request embodiments. The simulation model under test is named LockRequestSUT, and it is defined with four input ports and two output ports. The interface type is 8-bit unsigned integer (uint8), and the signal encoding directly corresponds to the interface encoding. Other test benches can configure their interfaces through the same metadata structure.

[0037] Table 1. Signal table for simplified embodiment of left and right side locking request

[0038] The input initial values ​​in Table 1 represent a valid initial state selected in this embodiment. The timing logic specification generated subsequently allows each input initial value to take values ​​within the declared finite value range; the initial values ​​listed in the table are one such combination. Signal direction, finite value range, output initial value, and inactive value are used for requirement interpretation and specification compilation; port mapping, interface type, and input and sampling timing are used for test execution. This embodiment uses uint8 interface encoding; other embodiments may use an interface type consistent with the corresponding signal definition.

[0039] (2) Event-condition-action requirement tuple and associated semantics: The event-condition-action requirement tuple is represented as ERT=(N,P,T,A,E): N is the function name, P is the precondition, T is the trigger condition, A is the output action, and E is the exit condition. P, T, and E use constrained condition expressions. The output action is represented in one of two ways: recording one or more parallel assignments in A, or setting A to null and recording the guard conditions and corresponding assignment sets in the guard action field. A null P indicates no additional preconditions, a null E indicates no explicit exit condition, and T is not null.

[0040] To maintain the correspondence across fields in natural language requirements, the event-condition-action requirement tuple sets transition event fields, guarded action fields, and ambiguity fields. These fields, together with the quintuple, constitute the compiler's input; unused associated fields can be empty.

[0041] The guard action field stores the correspondence between trigger branches and output actions. Each rule contains a guard condition and a set of output assignments; rules that are satisfied simultaneously will execute non-conflicting assignments. For example, the driver-side locking command corresponds to the left-side request, and the occupant-side locking command corresponds to the right-side request; both rules can be effective simultaneously.

[0042] The `transition_events` field records pairs of pre-transition and post-transition conditions in the same input state transition, preserving the correspondence between event branches. The pre- and post-transition conditions respectively constrain the signal values ​​at both ends of the transition. For example, when a car door signal changes from closed to open, the `before` predicate records the old state, and the `after` predicate records the new state, allowing the compiler to distinguish the values ​​of the same signal before and after a transition.

[0043] The ambiguity record field is used to indicate that the triggering action or the correspondence before and after the change in the source requirement is not yet clear, or that the structured extraction did not retain this correspondence. When there is unresolved ambiguity, subsequent compilation and test generation are prevented; after clarifying the relationship of the source requirement or correcting the extraction results, semantic verification is performed again, and compilation and test generation continue after passing the verification.

[0044] The natural language requirements in this embodiment are as follows: when the ignition is off and all doors are closed, the driver's side locking command generates a left-side locking request, and the passenger side locking command generates a right-side locking request; when commands are issued from both sides simultaneously, both requests take effect simultaneously. An activated request remains active while the preconditions are met, and reverts to no request when the preconditions fail.

[0045] The corresponding tuples are: N = PEPSLockRequest; P = (Ignition == 0 && DoorsClosed == 1); T = (DriverCommand == 2 || PassengerCommand == 2); A is empty; E is empty. In the conditions, == indicates equality, && indicates logical AND, and || indicates logical OR; the meanings and encodings of the signals are shown in Table 1.

[0046] The guard action contains two rules: the first guard condition is DriverCommand==2, corresponding to LeftRequest=1; the second guard condition is PassengerCommand==2, corresponding to RightRequest=1. The = sign in the assignment statement assigns the value on the right side of the equals sign to the output on the left side. The logical OR of the two guards is equivalent to T, but they can take effect simultaneously even if the assignment targets are different.

[0047] In this example, both the conversion event field and the ambiguity record field are empty; the initial and deactivated values ​​of both outputs are 0. Since E is empty, the compiler uses the language rule that active outputs are maintained while P is true.

[0048] 2. Reachable state diagram.

[0049] The goal of this section is to transform the validated event-condition-action requirement tuples into TLA+ reductions with definite states and transition semantics, and to complete the reduction analysis and reachable state space construction using a parser and a TLA+ model checker.

[0050] (1) Semantic validation of event-condition-action requirement tuples: The tuple validator verifies the following constraints based on a finite range: Each signal in the precondition P, trigger condition T, and exit condition E has been declared and has a non-empty finite range, and all expressions have been fully parsed; When both the precondition P and the trigger condition T reference the input signal, the relationship before and after the change is verified within the declared finite value range. For simple conditions, it must be determined that the corresponding signal has changed. When there are multiple alternative branches, the branch pairing must be uniquely determined, or a verified explicit transition event pairing must be used. Each pairing must have at least one commonly referenced input signal that has changed. For example, if the driver's side door state (DriverDoor) and the passenger side door state (PassengerDoor) are both 0 for closed and 1 for open, the door opening event is either "driver's side door was 0 before the change and is 1 after the change" or "passenger side door was 0 before the change and is 1 after the change." If both the driver's side door is closed and the passenger side door is open before and after the change, then neither event branch is valid, indicating that no door opening change occurred.

[0051] When using guard actions, the logic of each guard condition is equivalent to the top-level trigger condition T within a finite value range, and rules that are triggered simultaneously will not assign conflicting values ​​to the same output signal.

[0052] For output signals with inactive values, the tuple checker determines the inactive and initial values ​​based on the action assignment, finite value range, and explicit signal metadata. Binary numerical outputs can use the unique complement of the action value; default values ​​required for multi-valued outputs and identifier assignments are given by explicit metadata; the initial value is determined according to the verified explicit configuration or a language rule that the initial value equals the inactive value. Guard assignments covering all finite values ​​of the output without any special inactive values ​​are handled according to the following complete value range initialization and retention rules.

[0053] (2) TLA+ deterministic compilation based on signal roles: The compiler categorizes input signals referenced by P or T into context signals, transition signals, and transient trigger signals: context signals appearing only in P read the input value selected for the current environment transition; transition signals, verified to appear in both P and T, read the old value in P and the current input value in T; transient trigger signals appearing only in T read the current input value. Based on this, the compiler generates constants and variables, type and range constraints (TypeOK), initial state predicates (Init), environment change relationships (EnvChange), output update relationships, and complete behavior specifications (Spec).

[0054] TypeOK specifies the finite range of values ​​for the variable; Init specifies the legal starting state; EnvChange describes an input change and the corresponding output update; Next specifies the legal transition between adjacent states; Spec combines Init and Next to specify the complete behavior; UNCHANGED specifies that the variables remain unchanged in this step.

[0055] Transition events are evaluated in pairs based on the before and after conditions of each branch, reading the old state and the current environment input value respectively. Guard actions update the corresponding output when both the basic activation condition and the corresponding guard condition are true. Environment inputs and all outputs are determined in the same transition relation, generating UNCHANGED constraints or equivalent before-and-after value equality constraints for variables not updated in this step.

[0056] For outputs with inactive values, the update order is: assign a value when activated, otherwise retain the old output if the hold condition is met, and otherwise take the inactive value. When E is empty, the hold condition is that the old output is activated and the current P is true; when E is not empty, the old output is activated and E is not true. When the guard assignment covers all finite values ​​of the output and there is no special inactive value, the initial output takes a value within the finite value range, and retains the old value if the guard is not triggered. One reduction organization method is Next == EnvChange, Spec == Init / \ [][Next]_vars. Where == means definition, / \ means logical AND, and [] means always; vars is a tuple of all state variables, and [Next]_vars means that either Next or all vars remain unchanged, the latter is called an invariant step. In this embodiment, vars includes the six signals in Table 1 and the auxiliary variable pc.

[0057] This embodiment compiles and generates a TLA+ specification file named PEPSLockRequest.tla, distinct from the simulation model LockRequestSUT. Init allows four inputs to take values ​​within their respective finite domains, with both outputs initially set to 0. The auxiliary variable pc marks the state stage, initially taking the string value "Init" and changing to the string value "EnvChange" after each environment transition. EnvChange selects the current input within its finite domain and simultaneously calculates the output: P is calculated based on the current input; if P is true and DriverCommand=2, then LeftRequest's new value is 1; otherwise, if the old LeftRequest=1 and the current P is true, it remains 1; otherwise, it is 0. RightRequest uses the same rule for PassengerCommand, with both outputs having an inactive value of 0. The next state relationship is defined as Next == EnvChange.

[0058] (3) Specification verification and reachability graph construction: The system first calls the specification syntax and semantic analyzer SANY to analyze the generated TLA+ module, and then calls the TLA+ model checker TLC to explore the finite state space according to Init and Next steps to obtain the reachable state graph of the requirement specification. Q represents the set of states reachable from a valid initial state. Each node records the input, expected output, and necessary auxiliary variables. It is the set of directed transition edges that satisfy Next, and is a subset of Q×Q. The edges of the graph are distinguished from the exit condition E in the requirement tuple. The reachable state graph paths constitute an abstract test trajectory.

[0059] The TLA+ module is the output of deterministic compilation, which organizes variables, finite ranges, initializations, state transitions, and complete behavioral specifications by module name; in this example, PEPSLockRequest.tla is the file form of this module.

[0060] The set of states that satisfy the initial state predicate is denoted as Where q is a complete state in Q, and Init(q) indicates that the state satisfies the initial state predicate; from The selected specific state is denoted as TLC from Starting from the state in the diagram, the reachable state graph is explored along the allowed transitions of Next. This graph is derived from the requirements specification, and the generated test is used for the independent simulation model under test. In this embodiment, ERT compilation, SANY analysis, TLC exploration, and trajectory checking (described later) have all passed. The resulting graph has 37 states and 592 directed edges, and all four conditional independence coverage targets have ordered reachable witnesses.

[0061] 3. Abstract test trajectory.

[0062] This section generates conditional independence coverage targets from the formal requirement determination of event-condition-action requirement tuples, and finds complete abstract test trajectories of sequential implementation candidate assignment pairs in the reachable state graph, including candidate assignment pair generation and product state search.

[0063] (1) Generation of canonical-level correction conditions / decision coverage candidate assignment pairs: The decision expression D is a Boolean expression extracted or constructed from the conditions and associated semantics of the event-condition-action requirement tuple. For example, D=(Ignition==0&&DoorsClosed==1), whose atomic conditions are Ignition==0 and DoorsClosed==1. This invention adopts a specification-level modified condition / decision coverage (MC / DC), that is, a modified condition / decision coverage at the requirement logic level, covering the defined formal requirement decisions. The independent simulation model is the object under test, and the coverage here is different from the structural coverage within the model or the generated code. In the following condition expressions, == represents equality comparison, && represents logical AND, || represents logical OR, and ! represents logical NOT; == in the TLA+ specification is a definition symbol.

[0064] For the atomic condition c in the decision expression D, the signal assignment vector pair A modified condition / decision coverage candidate assignment pair for c is constituted when the following conditions are met: Condition c is and The truth value in the text is flipped; Other atomic conditions in the determination expression D and The truth value remains unchanged; The judgment expression D is in and The result in the middle is reversed, which shows that c can independently influence the decision outcome.

[0065] The system converts the decision expression and the finite range of the signals referenced within it into satisfiability modulus theory (SMT) constraints, enumerates candidate assignment pairs that satisfy the independence condition, and removes duplicates. Each unordered candidate pair is processed according to... and Two sequences are given to graph search. The conditional independence coverage target can be achieved as long as either sequence has a complete trajectory. The arrows indicate the order in which the two vectors are implemented, and it is not required that their states be directly adjacent.

[0066] The coverage target derivation module determines the decision set, identifies the atomic conditions in each decision, and establishes independence constraints in conjunction with the finite value range of the signal. One selection method is to include a non-empty precondition P and a triggering condition T; when the exit condition E is non-empty, a precondition / exit derived decision is constructed: when P is non-empty, the derived decision is !P || E; when P is empty, the derived decision is E. In this embodiment, E is empty, and the decision set uses P and T. The coverage decision describes the combination of conditions to be tested, and the output update relationship is calculated according to the activation, hold, and exit semantics to calculate the expected output; the derived coverage decision is not directly equivalent to the output closing condition in each hold mode.

[0067] Let the conditional independence coverage objective be denoted as (D, c). The goal is to find the independence assignment pairs for the atomic condition c, and the complete abstract test trajectory that sequentially realizes these pairs starting from a valid initial state; this trajectory is also called the reachability witness of the objective. Under the conditions of a finite value domain, a complete reachable state graph, and the completion of candidate enumeration and graph search, the algorithm generates the corresponding trajectory for each objective with an ordered reachable independence assignment pair.

[0068] (2) Reachability product state search: For each candidate assignment pair, let (first, second) be... and Here, `first` and `second` are the target assignment vectors implemented in the current order. The system performs a breadth-first search on Q×{0,1}. In the product state (q,b), `q` is the complete state in the graph, and `b` indicates whether the current path has already matched the state of `first`. The search starts from... Starting with all states in the array, return the complete abstract test path from the valid initial state through the state matching first to the state matching second, only if b=1 and q matches second.

[0069] Each conditional independence coverage target is recorded as one of the four processing states in Table 2. After obtaining the reachable witness, the corresponding complete abstract test trajectory is added to the test set, and the target is recorded as reachable and covered; other results retain their judgment criteria or failure reasons respectively.

[0070] Table 2. Four types of processing states for targets covered by conditional independence

[0071] Let R be the set of proven achievable conditional independence coverage targets (D, c), TestSuite be the set of abstract test tracks to be evaluated, and Covered(TestSuite) be the set of targets that actually contain valid independence witnesses. Coverage is calculated using the following formula: Coverage = ; In the formula, ∩ represents the intersection of sets, and |·| represents the number of elements in the set. Only targets in R are included in the denominator, each (D,c) is counted once, and the two directions are summed once; when R is empty, no confirmed reachable targets are reported, and the ratio is not calculated. When there is a search failure, the coverage results of both the unresolved targets and the resolved parts are reported simultaneously. Table 3 shows the main process.

[0072] Table 3. Canonical-level modification conditions / decision algorithms for reachability constraints, covering trajectory search algorithms.

[0073] In Table 3, rows 1 to 4 initialize variables and create candidate enumeration tasks for each conditional independence coverage target; Lines 5-9 retrieve candidate assignment pairs, or end the candidate loop based on the failure or normal exhaustive state; Lines 10-17 attempt two search directions and save the complete abstract test trajectory that is successfully returned; Line 18 exits the candidate loop for the current target if a trajectory is found or a failure occurs; Lines 19 and 20 continue enumerating if there is no reachable witness for the current candidate; Lines 21-24 classify targets that failed to generate trajectories; Lines 25-26 return the test trajectory set and processing result mapping after all targets have been processed.

[0074] ProductBFS represents a breadth-first search process for the product state. Each Corresponding ( Match( First is enqueued and marked as visited, with its predecessor set to empty. (q, b) is retrieved in queue order: if b is true and Match(q, second) is true, backtrack along the predecessor and project onto the graph node, returning the complete trajectory; otherwise, for each edge (q, q') originating from q, calculate b' = b∨Match(q', first), record the predecessor for unvisited (q', b') and enqueue it. q' is the successor state of q, b' indicates whether the path to that successor state has matched first, and ∨ represents logical OR. A normally empty queue indicates no reachable witnesses in that direction; failure and the reason are returned if there is a timeout, budget exhaustion, or an exception. Match(q, V) determines the matching of states and vectors: it is true when all signals listed in V have the same value in the complete state q, otherwise it is false; unspecified output components of V can be different, therefore the same vector can match multiple complete states. Independence constraints preserve the truth values ​​of other atomic conditions, but do not require that all the signal values ​​involved remain unchanged.

[0075] Using (q, b) instead of just q as the access key allows us to distinguish the same state before and after reaching first. For unweighted graphs and fixed candidate directions, a full breadth-first search is performed from all legal initial product states to obtain the shortest witness trajectory in that direction; minimizing the overall test set is another optimization objective.

[0076] In this embodiment, P and T are selected as criteria, each containing two atomic conditions, for a total of four conditions covering the target independence. For the ignition condition in P, we can take... ={Ignition:1,DoorsClosed:1}、 ={Ignition:0,DoorsClosed:1}. Selected from the reachable state graph. As an illustration of the trajectory. The selected valid initial state corresponds to an initial node in the diagram; each row of Table 4 lists the input and output projections of the complete state. Inputs are arranged in (Ignition, DoorsClosed, DriverCommand, PassengerCommand), and expected outputs are arranged in (LeftRequest, RightRequest). Timestamps are calculated according to the test bench configuration described later.

[0077] Table 4 Example Abstract Test Trajectory and Execution Sequence

[0078] The input and expected output are held until 0.50 s. and , and The independent effects of the ignition condition and the door condition in the prerequisite condition P are shown separately. and , and The independent effects of the driver-side command condition and the passenger-side command condition in trigger condition T are shown separately. Left-side requests are maintained by hold rules, while right-side requests are activated by crew-side instructions; The preconditions fail, and the requests on both sides return to 0. The outputs in the table are the expected values ​​derived from the requirements; the actual outputs of the independent tested models are collected during the execution phase.

[0079] 4. Executable test cases.

[0080] The generated complete abstract test trajectory is combined with the test bench metadata to concretize into executable test cases, which are then executed on the independent simulation model under test; this embodiment uses a Simulink model.

[0081] (1) Concretization of abstract trajectory: The concretization module reads the abstract test trajectory state by state, extracts the input assignments and expected outputs derived from the requirements, and retains all transition steps between valid initial states and the target. Based on the interface mapping, input update time, retention method, sampling rules, and comparison tolerance, it forms a timestamped input sequence, expected output sequence, and comparison rules.

[0082] The above sequence and rules together form an executable test case, which can be saved as an Excel spreadsheet test file or a test script in the MATLAB numerical computing environment; the execution module reads the test case, applies the input, and compares the output.

[0083] The test bench metadata defines the mapping between logical signals and model interfaces, including interface type, unit or encoding correspondence, initialization method, input update time, hold or interpolation method, output sampling rules, and comparison tolerance. Based on this, the specification module completes interface binding, specification of valid initial states, and generation of time series and comparison rules. By configuring the interfaces and execution parameters of different test benches and calling the corresponding execution backend, requirement logic and abstract test trajectories can be reused, achieving test specification and execution driven by general test bench metadata.

[0084] This embodiment uses the following test bench configuration, with the model, port, and interface types specified in Table 1: Initialization: The execution module resets the simulation model under test according to the initialization configuration in the test bench metadata and applies pressure to the input ports. The input is assigned, and with The output in the function is assigned as the expected value for the initial check.

[0085] Input timing: Nominal step interval h = 0.1 s, update offset δ = 0.01 s; initial state input update time The input update time for the k-th subsequent state is , where k is the state step number starting from 1.

[0086] Hold method: zero-order hold, that is, the current input value is maintained between adjacent input update times.

[0087] Sampling rule: The sampling offset relative to the input update ε = 0.01 s, in When comparing the corresponding expected output, the initial state is... The comparison is performed at the same time; the configuration is executed so that the input has been used in the model calculation and the sampling time is still within the hold-up interval of this state.

[0088] Comparison and Conclusion: In this embodiment, the discrete outputs are compared for exact equality of the encoded values, with a numerical tolerance of 0, and the final state is maintained for 0.50 seconds. The timing and interface values ​​described above are the execution configuration for this embodiment; other test benches can configure the corresponding parameters under the same metadata structure.

[0089] (2) Comparison of independent model execution with expected output: The execution module runs the specific tests according to the following procedure: Drive the input ports of the Simulink model according to the timestamped input sequence in the executable test cases, and run the model within the corresponding hold interval; Collect the actual output of the model according to the output sampling rules in the use case, and compare it with the corresponding value in the expected output sequence signal by signal and step by step. Based on the comparison tolerance and timing rules, record whether the comparison passes or the output is inconsistent, and save the sampling time, expected value, actual value and comparison parameters for subsequent use in requirements, specifications, test configuration and the model under test to locate the cause of the difference.

[0090] (3) Full-process evidence recording: The system assigns a unique identifier to each test run, and associates and saves requirements and versions, signal definitions and finite value ranges, event-condition-action requirement tuples, timing logic reduction and SANY / TLC processing results, reachability state diagrams, conditional independence coverage targets and corresponding complete abstract test trajectories, test bench metadata, the version of the model under test, and execution results. Each output comparison record includes the test case identifier, trajectory steps, output signal, expected value, actual value, sampling time, and comparison parameters, enabling output differences to be traced step by step along the generation and execution chain.

[0091] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0092] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple steps or stages, which are not necessarily completed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0093] This invention also provides a system. The system can be a system that uses software (applications), modules, components, servers, clients, etc., employing the methods described in the embodiments of this specification, combined with necessary hardware implementation. Since the implementation schemes and methods for solving the problem are similar, the specific system implementations in the embodiments of this specification can be found in the implementations of the foregoing methods, and repeated details will not be elaborated upon. Although the system is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0094] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0095] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention, and no reference numerals in the claims should be construed as limiting the scope of the claims.

[0096] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for generating automotive software tests, characterized in that, include: The natural language requirements of automotive software functions and the definitions of signals corresponding to the control functions of the on-board electronic control unit under test are analyzed to construct atomic functional units and event-condition-action requirement tuples. The tuples are five-tuples, representing function name, precondition, trigger condition, output action and exit condition respectively. Signals include input signals and output signals. The tuples are subjected to deterministic semantic verification, a temporal logic reduction is generated by a deterministic compiler based on signal roles, and a reduction parser and a model checker are called to generate an reachable state graph determined by the temporal logic reduction. Based on the finite range constraints of the signals referenced in the decision expression, the canonical-level correction conditions / decision coverage candidate assignment pairs are solved and generated. A product state breadth-first search is performed on the reachable state graph to generate a complete abstract test trajectory from the legal initial state through the state matching the two target assignment vectors. The complete abstract test trajectory is combined with test bench metadata to concretize into executable test cases, which are executed on an independently developed simulation model, and the entire process traceability evidence from requirements to execution results is recorded.

2. The automotive software test generation method according to claim 1, characterized in that, The process involves analyzing the natural language requirements of automotive software functions and defining the signals corresponding to the control functions of the tested vehicle's electronic control unit, constructing atomic functional units and event-condition-action requirement tuples, specifically including: The atomic functional unit is represented as u=(f,S), where f is a natural language requirement describing a function of automotive software, and S is a set of signals related to the natural language requirement; each signal s in S records the signal name and natural language definition, signal role, finite value range, and test bench metadata; The signal roles are used to distinguish between input signals and output signals, and the target signal assigned a value in the action belongs to the output signal; the finite value range includes Boolean quantities, enumerated quantities, discrete values, or finite intervals divided by continuous physical quantities, which are used for constraint solving and model checking; the test bench metadata includes initial values, inactive values, hold time, input change delay, output sampling rules, comparison tolerance, and port mapping.

3. The automotive software test generation method according to claim 1, characterized in that, The tuple is a quintuple, representing the function name, precondition, trigger condition, output action, and exit condition, specifically including: The event-condition-action requirement tuple ERT=(N,P,T,A,E) is used, where N is the function name identifier, P is the precondition, T is the trigger condition, A is the output action, and E is the exit condition. P, T, and E are constrained condition expressions. The output action is represented in one of the following two ways: one or more parallel assignments are recorded in A, or A is set to null and the guard condition and the corresponding set of assignments are recorded in the guard action field. The event-condition-action requirement tuple also sets three types of semantic fields: The transition event field is used to record the pairs of pre-change and post-change conditions in the same input state transition, and to retain the correspondence between each event branch; the pre-change condition limits the signal value before the transition occurs, and the post-change condition limits the signal value after the transition occurs; The guard action field is used to store the correspondence between the trigger branch and the output action. Each rule contains a guard condition and the corresponding set of output assignments. The ambiguity record field is used to record the correspondence between trigger branches and output actions that are not yet clearly defined in the natural language requirements, the correspondence between branches before and after changes, or the above correspondences that were not retained during structured extraction. When there are unresolved ambiguities, subsequent compilation and test generation will be prevented.

4. The automotive software test generation method according to claim 3, characterized in that, The deterministic semantic verification of the tuple specifically includes: The tuple checker verifies the following constraints based on the finite range defined by the signal: (a): Each signal in the precondition P, trigger condition T, and exit condition E has been declared and has a non-empty finite value range, and the expressions corresponding to P, T, and E have been fully parsed; (b): When the precondition P and the trigger condition T both refer to the input signal, verify the relationship before and after the change within the declared finite value range; for simple conditions, it must be determined that the corresponding signal has changed; when there are multiple alternative branches, the branch pairing must be uniquely determined, or a verified explicit transition event pairing must be used; each pairing must have at least one input signal that has changed. (c): When using guard actions, the logic of each guard condition is equivalent to the trigger condition T within a finite value range, and rules that are triggered simultaneously will not assign conflicting values ​​to the same output signal.

5. The automotive software test generation method according to claim 1, characterized in that, The generation of timing logic specifications through a deterministic compiler based on signal roles specifically includes: The compiler classifies the input signals referenced by preconditions or trigger conditions into three categories: context signals, transition signals, and momentary trigger signals. The context signal is an input signal that appears only in the preconditions, and the compiler reads the input value selected for this environment transition; The migration signal is a signal that has been verified to appear simultaneously in both the precondition and the trigger condition. The compiler reads the old state of the signal in the precondition and the new state of the signal in the trigger condition. The instantaneous trigger signal is an input signal that appears only in the triggering condition, and the compiler reads the input value selected for this environment transition; Based on the above signal classification, the compiler generates constant and variable declarations, type invariants, initial state predicates, environmental change relationships, output update relationships, and complete behavioral specifications for the sequential logic specification, and generates invariant constraints for variables that have not been assigned values ​​in the current state transition step.

6. The automotive software test generation method according to claim 1, characterized in that, The process of generating canonical-level correction conditions / decision coverage candidate assignment pairs based on the finite range constraints of the signals referenced in the decision expression specifically includes: Extract or construct a decision expression from the preconditions, trigger conditions, and exit conditions of the event-condition-action requirement tuple; for the atomic condition c in the decision expression D, assign two signal vectors. , A modified condition / decision coverage candidate assignment pair for c is constituted when the following conditions are met simultaneously: (a) Atomic condition c in and The truth value in the text is flipped; (b) Determine the other atomic conditions in expression D. and The truth value remains unchanged; (c) Determine expression D in and The result in the middle is flipped; The decision expression and the finite range of the signals referenced therein are converted into satisfiability modulus constraints. Candidate assignment pairs that satisfy the above conditions are enumerated and deduplicated. , These represent the first signal assignment vector and the second signal assignment vector in the candidate assignment pair, respectively. Each signal assignment vector records the value of the relevant signal for judgment. When a state in the reachable state diagram has the same value on the signal listed in the signal assignment vector, the state is said to match the signal assignment vector. The same signal assignment vector can match multiple complete states.

7. The automotive software test generation method according to claim 6, characterized in that, The process of performing a product-state breadth-first search on the reachable state graph to generate a complete abstract test trajectory that sequentially passes through states matching two target assignment vectors from a valid initial state includes: For each candidate assignment pair, respectively... and Two sequences determine the first target assignment vector `first` and the second target assignment vector `second`. A breadth-first search is performed on the Cartesian product Q×{0,1} of the reachable state set Q and the Boolean flag set {0,1}. Each state in the reachable state set Q is denoted as `q`, and `b` in the product state (q,b) indicates whether the current search path has already passed through the state that matches `first`. The initial state predicate `Init` in the reachable state set specifies the legal starting state. The search starts from all states that satisfy the initial state predicate `Init`. When `b=1` and `q` matches `second`, a complete abstract test trajectory containing the legal initial state and all intermediate states is returned. Each conditional independence coverage target, consisting of a decision expression and one of its atomic conditions, is recorded as one of four processing states: logically unsatisfiable, satisfiable but without ordered reachable witnesses, reachable and covered, or search failed. The found complete abstract test trajectory is added to the test set and associated with the corresponding conditional independence coverage target. The set of reachable targets is defined as the conditional independence coverage targets for which ordered reachable independence assignment pairs have been confirmed. Coverage is calculated as the ratio of the number of reachable targets actually covered in the test set to the total number of reachable targets. Each conditional independence coverage target is counted once, and the two search directions are not counted repeatedly. This ratio is not calculated when there are no confirmed reachable targets; if a search fails, an unresolved conditional independence coverage target is reported.

8. The automotive software test generation method according to claim 1, characterized in that, The process of concretizing the complete abstract test trajectory and test bench metadata into executable test cases specifically includes: Read the states and transitions in the complete abstract test trajectory sequentially, extract the input assignments and expected outputs derived from the requirements; based on the port mapping, interface type, input update time, retention method, output sampling rules and comparison tolerance in the test bench metadata, generate the input sequence with timestamps, expected output sequence and comparison rules, and organize them into tabular or scriptable executable test cases, retaining all transition steps from the legal initial state to the state matching the target assignment vector.

9. The automotive software test generation method according to claim 1, characterized in that, The process involves executing the simulation on an independently developed model and recording traceability evidence throughout the entire process from requirements to execution results, specifically including: Read the executable test cases and associated test bench metadata, bind the input and output ports of the independent simulation model under test according to the port mapping in the test bench metadata, and reset the model according to the initialization configuration; The simulation model is driven by the timestamped input sequence in the executable test cases. The model is run within the corresponding hold interval, the actual output is collected according to the sampling rules, and the comparison is performed signal by signal and step by step according to the expected output sequence and comparison rules in the test cases. Each comparison record includes test case identifier, trajectory steps, output signal, expected value, actual value, sampling time and comparison parameters. Each test run is assigned a unique identifier and associated with and stored the requirement version, signal definition and finite value range, event-condition-action requirement tuple, timing logic reduction, output results of the reduction syntax analyzer and model checker, reachable state diagram, condition independence coverage target and complete abstract test trajectory to achieve the condition independence coverage target, test bench metadata, simulation model version and execution results, so that output differences can be traced back to the corresponding requirements and formal transformations.

10. An automotive software test generation system, used to implement the method as described in any one of claims 1 to 9, characterized in that, include: The requirement parsing and tuple construction module is used to parse the natural language requirements of automotive software functions and the definitions of signals corresponding to the control functions of the on-board electronic control unit under test, and to construct atomic functional units and event-condition-action requirement tuples; the tuples are five-tuples, representing the function name, precondition, trigger condition, output action and exit condition respectively; the signals include input signals and output signals. The semantic verification and reduction compilation module is used to perform deterministic semantic verification on the tuples, generate a temporal logic reduction through a deterministic compiler based on signal roles, and call the reduction syntax analyzer and model checker to generate a reachable state graph determined by the temporal logic reduction. The candidate generation and trajectory search module is used to solve for the generation of canonical-level correction conditions / decision coverage candidate assignment pairs based on the finite value range constraints of the signals referenced by the decision expression, perform a product state breadth-first search on the reachable state graph, and generate a complete abstract test trajectory from the legal initial state through the state matching two target assignment vectors in sequence. The test specification and execution module is used to specify the complete abstract test trajectory and test bench metadata into executable test cases, execute them on an independently developed simulation model, and record traceability evidence of the entire process from requirements to execution results.