A deep learning-based local software function automatic test optimization system

By constructing a baseline for behavioral state association, identifying and handling state remnants, and optimizing automated testing of local software functions, the problems of test environment reset and repetitive operations caused by state remnants are solved, thereby improving the accuracy and efficiency of testing.

CN123178266APending Publication Date: 2026-11-27HENAN ELECTRONIC PLANNING RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing automated testing, residual states are difficult to utilize effectively, leading to increased test environment resets and repetitive operations, and are prone to false assertions or test chain breaks, making it impossible to optimize subsequent test behaviors.

Method used

By using a deep learning-based local software function automated testing optimization system, a behavior state correlation baseline is constructed, state remnants are identified, reverse behaviors are constructed, the test behavior chain is reconstructed, and the baseline is updated, thereby achieving reversible verification and processing of state remnants.

Benefits of technology

It improves the accuracy of state anomaly identification and recovery in automated testing of local software functions, enhances the integrity and adaptability of the test behavior chain, and reduces the overhead of repeated testing and test result deviation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178266A_ABST
    Figure CN123178266A_ABST
Patent Text Reader

Abstract

The application discloses a kind of local software function automation test optimization systems based on deep learning, it is related to software testing technical field, including: residual identification module, based on the baseline of behavior state association, the target local software function of current version is executed, and the state residual candidate relationship formed by test behavior action is identified;State verification module, based on state residual candidate relationship Corresponding reverse behavior is constructed, and irreversible state verification is executed, and state irreversible verification result is obtained;Behavior reconstruction module, based on state irreversible verification result, for the state residual that is verified as irreversible, state residual is determined as the precondition of subsequent test behavior, and the subsequent test behavior affected by state residual and the test behavior that generates state residual are reorganized as continuous test behavior chain, and the local software function automation test behavior chain is reconstructed;The application improves the integrity and adaptability of local software function automation test behavior chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software testing technology, and in particular to a local software function automated testing optimization system based on deep learning. Background Technology

[0002] As software engineering evolves towards continuous integration, continuous delivery, and rapid version iteration, automated testing is gradually shifting from manual testing to automated testing methods based on test scripts, regression testing, and program execution trajectory analysis. For specific software functionalities, current technologies typically determine the test objects based on functional modules, the scope of code changes, and historical test cases. By executing pre-set test operations and collecting program execution status, interface call results, and test outputs, regression verification of the target function is performed, thereby improving test execution efficiency and defect discovery capabilities during version iteration.

[0003] However, in the process of automated testing with frequent iterations across multiple versions, certain test behaviors are prone to generating state remnants that are difficult to eliminate through reverse actions. Existing testing mechanisms typically handle such irreversible state remnants by forcibly resetting the test environment, clearing the runtime context, or directly announcing errors and halting the test. This not only discards the inherent software state established by preceding test behaviors, forcing subsequent tests to re-execute tedious pre-test preparation operations and increasing unnecessary repetitive testing overhead, but also easily leads to false assertions or test chain breaks due to state remnants directly interfering with subsequent test logic. Furthermore, it fails to utilize the generated state remnants to adaptively reconstruct and optimize subsequent test behaviors. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a deep learning-based local software function automated testing optimization system to solve the problem of insufficient utilization of state residue associations.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] This invention provides a deep learning-based automated testing and optimization system for local software functions, comprising:

[0008] Baseline building module: Obtain multi-version test execution trajectory of target local software functions, and build behavior state correlation baseline;

[0009] The residual identification module, based on the behavioral state association baseline, executes the target local software function of the current version and identifies candidate relationships of state residuals formed by the test behavior.

[0010] The state verification module constructs the corresponding reverse behavior based on the candidate relationship of state residues and performs reversible state verification to obtain the state reversibility verification result.

[0011] The behavior reconstruction module, based on the state reversibility verification results, determines the state residue as the precondition of subsequent test behaviors for state residues that are verified to be irreversible, and reorganizes the subsequent test behaviors affected by the state residues and the test behaviors that generate the state residues into a continuous test behavior chain, thus reconstructing the automated test behavior chain of local software functions.

[0012] The baseline update module re-executes the target local software function based on the automated test behavior chain of local software functions, and updates the behavior state associated baseline according to the state changes obtained from the re-execution.

[0013] Preferably, the method for obtaining the multi-version test execution trajectory includes:

[0014] Obtain the test entry points and test operation sequences for the target local software functions in the current version and multiple historical stable versions, and execute the tests respectively;

[0015] During execution, the preceding state, test behavior, state change and ending state are recorded in the order of test behavior occurrence to generate single-version test execution trajectories for each version, and then mapped and aligned in sequence to form multi-version test execution trajectories.

[0016] Preferably, the method for constructing the behavioral state association baseline includes:

[0017] Cross-version comparison of test execution trajectories across multiple versions is performed to extract state associations that repeatedly occur with the same test behavior in multiple historical stable versions and whose state transitions remain consistent before and after;

[0018] The state associations are linked to subsequent test behaviors according to the order in which the test behaviors occur, forming a test behavior-software state association chain;

[0019] The repeated state associations in multiple test behavior-software state association chains are summarized to form a behavior-state association baseline.

[0020] Preferably, the method of executing the target local software function of the current version includes:

[0021] Based on the behavioral state correlation baseline, restore the previous state and execute the target local software function, record the state changes and the end state, and form the single version test execution trajectory of the current version;

[0022] The current version's single-version test execution trajectory is sequentially associated with the behavior state baseline to form the current version's test execution trajectory.

[0023] Preferably, the method for identifying the candidate state residual relationships formed by the test behavior includes:

[0024] Compare the current version's test execution trajectory with the baseline of the behavior state association to identify state changes where the actual end state after the test behavior is executed is inconsistent with the baseline of the behavior state association;

[0025] In response to state changes, the input, execution environment, and test context outside the test behavior remain unchanged, and the test behavior that caused the state change is re-executed. When the same test behavior repeatedly produces the same state change and the state change still exists after the test behavior ends, the state change is identified as a candidate state residue.

[0026] The candidate state residues are associated with the test behavior, the preceding state, and the actual ending state that generated the candidate state residues, forming a state residue candidate relationship.

[0027] Preferably, the reverse behavior corresponding to the construction includes:

[0028] The test behavior that generates candidate state residues and the actual end state are obtained from the state residue candidate relationship, and the state change and baseline end state corresponding to the test behavior are found in the behavior state association baseline.

[0029] Identify subsequent test behaviors from the multi-version test execution trajectory that enable the software state to return to the baseline end state after a state change occurs, and reverse the connection according to the state recovery order to form reverse behavior.

[0030] Preferably, the method for obtaining the state reversibility verification result includes:

[0031] The actual end state is used as the starting state for the execution of the reverse behavior. The reverse behavior is executed in the order of execution, and the state changes during the execution of the reverse behavior and the recovery state after the execution of the reverse behavior are recorded.

[0032] When the restored state after the reverse behavior is consistent with the baseline end state and the state residue in the state residue candidate relationship is eliminated, it is determined that the state residue has been eliminated.

[0033] If the recovery state is inconsistent with the baseline end state or if state residue still exists, it is determined that the state residue has not been eliminated.

[0034] If, after the reverse behavior is executed, there are still new state changes that are not recorded in the residual candidate relationship, it is determined that a non-target state change has occurred.

[0035] When the state residue is eliminated, the restored state is consistent with the baseline end state, and no non-target state change occurs, the state residue candidate relationship is determined as a reversible state change; otherwise, the state residue candidate relationship is determined as an irreversible state change, thus forming a state reversibility verification result.

[0036] Preferably, the method of determining the state residue as a prerequisite context condition for subsequent test actions includes:

[0037] Extract the state residues corresponding to irreversible state changes and the test behaviors that generate these state residues, and find the subsequent test behaviors that continue to be executed after generating state residues in the current version's test execution trajectory.

[0038] According to the execution order of subsequent test behaviors, the same subsequent test behaviors are executed after retaining the state residue and after eliminating the state residue. The state changes produced by the subsequent test behaviors in the two states are compared. When the state change of the subsequent test behaviors when retaining the state residue is inconsistent with the state change of the subsequent test behaviors when eliminating the state residue, the subsequent test behaviors are determined to be the subsequent test behaviors affected by the state residue.

[0039] The actual end state corresponding to the state residue is determined as the precondition for subsequent test behaviors affected by the state residue.

[0040] Preferably, the method for reconstructing the automated testing behavior chain of local software functions includes:

[0041] Based on the sequential relationship between the test behavior that generates state residue, the state residue, and the subsequent test behavior affected by the state residue, the test behavior that generates state residue is regarded as the preceding test behavior, and the state residue is regarded as the state context between the preceding test behavior and the subsequent test behavior affected by the state residue, thus forming a continuous test behavior chain.

[0042] Subsequent test behaviors unaffected by state remnants are separated and aggregated with the continuous test behavior chain to form a local software function automated test behavior chain.

[0043] Preferably, the target local software function is re-executed based on the automated test behavior chain of local software function, and the test behavior, state changes and termination status are recorded according to the continuous test behavior chain to form an updated test execution trajectory;

[0044] The updated test execution trajectory is associated with the behavior state correlation baseline. When the test behavior and state changes remain consistent, the corresponding correlation is retained. When a new state change occurs or the original state change is altered, the behavior state correlation baseline is updated, and the updated behavior state correlation baseline is used for the next round of automated testing of the target local software functions.

[0045] The beneficial effects of this invention are as follows: by obtaining the test behaviors that generate state residues based on the candidate relationship of state residues, and determining the baseline end state by combining the behavior state association baseline, and at the same time searching for subsequent test behaviors that can restore the baseline end state from the multi-version test execution trajectory, a reverse behavior is formed, realizing the analysis of the recovery path of abnormal state changes, enabling the continuous state residues to be verified and processed, and improving the accuracy of state anomaly identification and recovery verification in the automated testing of local software functions.

[0046] By determining the state residues corresponding to irreversible state changes based on the state reversibility verification results, and analyzing the impact of state residues on subsequent test behaviors, the affected subsequent test behaviors are reorganized into a continuous test behavior chain. This realizes the integration of software state dependencies into the automated testing process, enabling test behaviors to adapt to changes in actual operating states and improving the integrity and adaptability of the automated test behavior chain for local software functions. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a schematic diagram of a local software function automated testing and optimization system based on deep learning, as described in this invention.

[0049] Figure 2 This is a flowchart illustrating the process of verifying the reversibility of states in this invention.

[0050] Figure 3 This is a flowchart illustrating the process of forming a chain of automated testing behaviors for local software functions in this invention. Detailed Implementation

[0051] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0052] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0053] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0054] Reference Figure 1 , Figure 2 and Figure 3 This is one embodiment of the present invention, which provides a local software function automated testing and optimization system based on deep learning, including the following steps:

[0055] Methods for obtaining multi-version test execution traces include:

[0056] Extract the code change areas of the current version relative to the previous version from the version change list of the software to be tested, match the functional modules involved in the code change areas with the functional module list of the software to be tested, identify the successfully matched functional modules as the target local software functions that need to be automated tested, and obtain the test entry information and corresponding test operation sequences of the target local software functions in the current version and multiple historical stable versions.

[0057] Among them, the test entry information is used to determine the starting position of the target local software function, and the test operation sequence is used to describe the operation process that needs to be executed sequentially to complete the test of the target local software function;

[0058] For example, when the target local software function is the user permission modification function, the test entry information may include the user management page entry, and the test operation sequence may include continuous operations such as user login, selecting target user, modifying user permissions, submitting permission modification, and exiting the user management page.

[0059] After obtaining the test entry points and test operation sequences in the current version and multiple historical stable versions, the test operation sequences are executed in the corresponding software version runtime environment, so that each software version enters the target local software function according to the corresponding test entry point and triggers the execution process of the target local software function in sequence according to the test operation sequence.

[0060] For example, the current version and three historical stable versions each perform user login, permission modification, and permission submission operations, so that the target local software functions in different software versions all have corresponding execution processes, and the actual running status of the target local software functions under different software versions can be obtained.

[0061] When executing the target local software function in each software version, the software running state before each test behavior, the executed test behavior, the state changes after the test behavior, and the software state after the test behavior ends are continuously recorded according to the actual execution order in the test operation sequence, thereby forming a single version test execution trajectory.

[0062] Among them, the preceding state is used to represent the software state of the target local software function before the test behavior is executed, the test behavior is used to represent the specific operation being executed, the state change is used to represent the software state change caused during the execution of the test behavior, and the ending state is used to represent the final state of the target local software function after the test behavior is executed.

[0063] For example, during the execution of the user permission modification function, the user's identity status before login is recorded as the preliminary state, the user permission modification operation is recorded as the test behavior, the change of user permission from ordinary user status to administrator permission status is recorded as the state change, and the user permission status after the permission modification is completed is recorded as the final state, thus forming the corresponding single-version test execution trajectory.

[0064] After obtaining the single-version test execution trajectory corresponding to the current version and multiple historical stable versions, the test behaviors, pre-states, state changes and ending states in different software versions are sequentially matched according to the order of test behaviors in each single-version test execution trajectory, so that the continuous execution processes of local software functions targeting the same target in different software versions form a correlation.

[0065] For example, if the test behavior sequence of "selecting a user - modifying permissions - submitting permissions" exists in multiple historical stable versions, then the state changes generated by the corresponding test behaviors in different versions are mapped and associated according to the same execution order, so that the single-version test execution trajectories corresponding to multiple software versions form multi-version test execution trajectories.

[0066] Methods for constructing behavioral state correlation baselines include:

[0067] After obtaining the test execution trajectories of multiple versions, the single-version test execution trajectories of the corresponding target local software functions in different historical stable versions are used as the comparison objects. The preceding states, test behaviors, state changes and ending states are compared item by item according to the order of test behavior occurrence.

[0068] For execution segments triggered by the same test behavior in multiple historical stable versions and whose state changes before and after the test behavior are consistent, the preceding state, test behavior, state change and ending state are identified as state associations. State changes that only occur in a single historical stable version or a single execution process are not considered as state associations. Thus, state associations that can be repeatedly verified through multiple historical stable versions are extracted from the test execution trajectory of multiple versions.

[0069] For example, if all three historical stable versions are executed in the order of selecting the target user, modifying user permissions, and submitting permissions, and the test behavior of modifying user permissions in all three historical stable versions causes the ordinary user's permission status to change to the administrator's permission status, then a status association relationship is formed between the ordinary user's permission status, the modification of user permissions, the permission status change, and the administrator's permission status.

[0070] After extracting the state relationships, find the subsequent test behaviors corresponding to each state relationship according to the order in which the test behaviors occur, and match the ending state in the previous state relationship with the preceding state of the next test behavior.

[0071] When the ending state of a previous state association can be connected to the preceding state of a subsequent test behavior, the subsequent test behavior is connected to the previous state association, so that multiple state associations and subsequent test behaviors are continuously connected to form a test behavior-software state association chain.

[0072] For example, after the test behavior of modifying user permissions is completed, an administrator permission state is formed. If the test behavior of submitting permissions is subsequently executed, the state association corresponding to modifying user permissions will be continuously associated with the submission permission, forming a test behavior-software state association chain.

[0073] After forming the test behavior-software state association chain, the state association relationships corresponding to the same test behavior in multiple test behavior-software state association chains are compared one by one. State association relationships that appear repeatedly in multiple historical stable versions and whose preceding states, test behaviors, state changes and ending states are consistent are merged. Only one association record is retained for the same state association relationship. The order of occurrence of corresponding test behaviors from different historical stable versions is uniformly arranged. At the same time, the subsequent test behaviors corresponding to the state association relationship are retained. The merged state association relationships are connected continuously according to the actual test behavior occurrence order to form a behavior state association baseline.

[0074] For example, if multiple historical stable versions have stable state relationships between ordinary user permission status, modified user permission status, and administrator permission status, then the corresponding state relationships in multiple historical stable versions are merged into a single state relationship record. The corresponding relationships are retained according to the actual order in which user permission is modified and then entered into administrator permission status, forming a behavioral state relationship baseline for subsequent testing of the current version of the target local software function.

[0075] The ways to execute the target local software functions of the current version include:

[0076] After forming the behavior state association baseline, the pre-state and test behavior corresponding to the target local software function are read from the behavior state association baseline in the order of test behavior occurrence. The running state of the target local software function is restored item by item according to the pre-state corresponding to each test behavior. After the pre-state is restored, it is checked whether the current state of the target local software function is consistent with the corresponding pre-state. When the current state of the target local software function is consistent with the corresponding pre-state, the corresponding test behavior is executed.

[0077] During the execution of the test behavior, the state changes triggered by the test behavior are recorded, and the end state is recorded after the test behavior is completed. The end state of the current test behavior is used as the pre-state of the next test behavior for continuous connection, and the next test behavior is executed until all test behaviors of the corresponding target local software function in the behavior state association baseline are completed. The pre-state, test behavior, state change and end state are sequentially formed to form the single version test execution trajectory of the current version.

[0078] For example, if the target local software function is a user permission modification function, first restore the target local software function to the normal user permission state. In the normal user permission state, execute the selection of target user and modification of user permissions, record the change of normal user permission state to administrator permission state, and record the end state after the permission modification is completed. Then, enter the next test behavior with the end state and continue to execute the submission of permission modification until all test behaviors of the user permission modification function are completed, forming the single version test execution trajectory of the current version.

[0079] After forming the single-version test execution trajectory of the current version, the order of test behavior is used as the basis for correspondence. The first test behavior in the single-version test execution trajectory of the current version is associated with the first test behavior of the corresponding target local software function in the behavior state association baseline. Then, the subsequent test behaviors are associated with the test behaviors in the same order in the behavior state association baseline. At the same time, it is checked whether the preceding state, state change and ending state of the corresponding test behavior can be continuously connected.

[0080] When the corresponding test behaviors can be continuously connected, the actual test behaviors and state changes in the single-version test execution trajectory of the current version are retained, and the single-version test execution trajectory of the current version and the behavior state association baseline are continuously corresponding according to the order of test behavior occurrence.

[0081] When a test behavior or state change that does not correspond to the behavior-state association baseline appears in the current version's single-version test execution trajectory, the actual location of the test behavior and state change in the current version's single-version test execution trajectory is retained, so that the current version's single-version test execution trajectory is fully mapped to the behavior-state association baseline, forming the current version's test execution trajectory.

[0082] For example, when the behavior state association baseline contains three test behaviors in sequence: selecting target user, modifying user permissions, and submitting permission changes, the selection target user, modification user permissions, and submission of permission changes in the current version's single-version test execution trajectory are sequentially mapped to the three test behavior positions, and respectively to the preceding state, state change, and ending state, thus forming the current version's test execution trajectory.

[0083] Methods for identifying candidate state residuals formed by test behaviors include:

[0084] After forming the test execution trajectory for the current version, the test behaviors, pre-states, state changes, and actual end states in the test execution trajectory for the current version are matched one by one with the corresponding test behaviors, pre-states, state changes, and end states in the behavior state association baseline, according to the order in which the test behaviors occur.

[0085] First, determine the position corresponding to the same test behavior based on the order in which the test behaviors occur. Then, match the states before and after the same test behavior. When the actual end state in the current version test execution trajectory is consistent with the end state in the behavior state association baseline, retain the corresponding state change. When the actual end state in the current version test execution trajectory is inconsistent with the end state in the behavior state association baseline, extract the state where there is a difference between the actual end state and the end state as the state change to be identified. At the same time, record the test behavior, the preceding state and the actual end state that generated the state change to be identified.

[0086] For the state change to be identified, keep the input, execution environment, pre-state and test context corresponding to the test behavior that caused the state change unchanged, re-execute the test behavior that caused the state change, and record the state changes generated during the re-execution and the actual end state after the test behavior ends.

[0087] The actual end state after re-execution is matched with the actual end state after the first execution. When the same state change to be identified exists in both actual end states, the actual end state after re-execution is matched with the end state in the behavior state association baseline. When the state change to be identified still exists after the test behavior ends and has not recovered to the end state in the behavior state association baseline, the state change to be identified is determined as a candidate state residue.

[0088] If the same state change to be identified does not occur after re-execution, or if the state change to be identified has recovered after the test behavior ends, the state change to be identified will not be identified as a candidate state residue, thereby excluding occasional state differences generated during a single execution.

[0089] After identifying the candidate state residues, the candidate state residues are associated one by one with the test behavior that generated them, the preceding state before the test behavior was executed, and the actual ending state after the test behavior was executed. The state correspondence before and after the formation of the candidate state residues is preserved according to the order of the test behavior, so that each candidate state residue can correspond to a specific test behavior and a specific state change process, forming a candidate state residue relationship.

[0090] For example, when the target local software function is the user permission modification function, the actual end state after the current version executes the user permission modification remains the administrator permission state, while the end state in the behavior state association baseline is the ordinary user permission state.

[0091] If, while keeping the input, execution environment, preconditions, and test context unchanged, the modification of user permissions is re-executed, and the administrator permission state is still maintained after the test ends, then the state change corresponding to the administrator permission state is identified as a candidate state residue, and the ordinary user permission state, the modified user permission state, and the administrator permission state are associated to form a candidate relationship of state residue.

[0092] In existing automated testing of partial software functions, the determination of whether a software function is abnormal is usually based solely on the test execution results. Further analysis of the continuous state changes resulting from the test behavior is lacking, making it impossible to accurately distinguish between temporary state changes and state remnants affecting subsequent test behaviors. Furthermore, there is a lack of methods for verifying the recovery of abnormal states, leading to some test results being biased due to the influence of preceding states. Therefore, this invention constructs corresponding reverse behaviors based on candidate relationships of state remnants and determines whether state remnants can be recovered by combining state reversibility verification results. The specific steps are as follows:

[0093] The ways to construct the corresponding reverse behavior include:

[0094] After forming the candidate relation of state residues, the test behavior that generates the candidate state residue, the pre-state before the test behavior is executed, and the actual end state after the test behavior is executed are read from the candidate relation of state residues, and the actual end state is used as the starting state for subsequent recovery processing.

[0095] Based on the test behavior that generates candidate state residue, find the state change and end state corresponding to the same test behavior in the behavior state association baseline, take the end state as the baseline end state, and match the actual end state corresponding to the candidate state residue with the baseline end state to clarify which state of the target local software function was changed by the test behavior that generated the candidate state residue, and which baseline end state the reverse behavior needs to restore the actual end state to.

[0096] For example, if the candidate state residual records that the preceding state before the test behavior of modifying user permissions is a normal user permission state, and the actual ending state after modifying user permissions is an administrator permission state, while the ending state corresponding to modifying user permissions in the behavior state association baseline is a normal user permission state, then it is determined that the state change caused by the test behavior of modifying user permissions is a change from the normal user permission state to the administrator permission state. Furthermore, it is determined that the reverse behavior needs to restore the administrator permission state to the normal user permission state, forming the following state change relationship:

[0097] Normal user permission status → Modify user permissions → Administrator permission status (actual end status).

[0098] Simultaneously, the following is recorded in the behavioral state association baseline:

[0099] Normal user permission status → Modify user permissions → Normal user permission status (baseline end status).

[0100] By establishing the above correspondence, we can clarify the specific test behaviors that generate state residues in the current version, the actual end state, and the baseline end state that needs to be restored, thus providing a direction for subsequent search for reverse behaviors that can eliminate state residues.

[0101] The "→" symbol indicates the process by which the software state changes from the previous state to the next state after the corresponding test behavior is performed. It is used to indicate the sequential relationship between the test behavior and the preceding state, state change and ending state.

[0102] Using the state changes and baseline end states in the candidate state residual relationships as the retrieval basis, we searched for subsequent test behaviors that continued to be executed after the state changes occurred in the multi-version test execution trajectory, and examined the end states after the execution of each subsequent test behavior.

[0103] When the ending state after the execution of a subsequent test behavior is consistent with the ending state of the baseline, the subsequent test behavior is determined to be the subsequent test behavior that can undo the corresponding state change. When a single subsequent test behavior cannot restore the software to the ending state of the baseline, the search for subsequent test behaviors continues along the multi-version test execution trajectory until a series of subsequent test behaviors that can restore the software state to the ending state of the baseline are obtained.

[0104] According to the order in which subsequent test behaviors actually generate state recovery, the subsequent test behavior used for the final state recovery is placed first, and then the preceding subsequent test behaviors are connected in sequence to form the reverse behavior from the actual end state to the baseline end state.

[0105] For example, if the test action of modifying user permissions results in an administrator privilege state, and the multi-version test execution track records that the historical stable version continued to perform the operation of revoking administrator privileges after the administrator privilege state, and after the administrator privileges were revoked, it would restore the user to a normal user privilege state. This would result in the following state recovery process:

[0106] Administrator privilege status (actual end status) → Revoke administrator privileges → Ordinary user privilege status (baseline end status).

[0107] Therefore, revoking administrator privileges is identified as the subsequent test behavior that can undo the state change caused by modifying user privileges, and the corresponding reverse behavior is formed according to the state recovery direction:

[0108] Reverse behavior: Administrator privilege status → Revoke administrator privileges → Ordinary user privilege status;

[0109] When multiple consecutive test behaviors are required to restore the baseline state in the multi-version test execution trajectory, the connections are made according to the actual restoration process, for example:

[0110] Administrator privilege status (actual end status) → Revoke administrator privileges → Save permission configuration → Ordinary user privilege status (baseline end status).

[0111] The reverse behaviors formed in the above way all come from the subsequent test behaviors that already exist in the multi-version test execution trajectory, and can correspond to the actual end state in the state residual candidate relationship and the baseline end state in the behavior state association baseline, which can be used for subsequent execution of reversible state verification.

[0112] The ways to obtain the state reversibility verification result include:

[0113] After the reverse behavior is formed, the actual end state is read from the candidate relation of state residues and the actual end state is used as the starting state of the reverse behavior. The subsequent test behaviors in the reverse behavior are executed in the order of state recovery.

[0114] Before executing each subsequent test action, the ending state of the previous subsequent test action is read as the current state. The next subsequent test action is then executed in the current state, while the state changes that occur during the execution of the subsequent test action and the ending state after the execution of the subsequent test action are recorded. This process continues until all subsequent test actions in the reverse process are completed. The ending state of the last subsequent test action is then used as the recovery state, and the reverse process is formed into a continuous state recovery process.

[0115] For example, if the actual ending state is the administrator privilege state, and the reverse behavior includes revoking administrator privileges, then the execution process is: administrator privilege state → revoke administrator privileges → ordinary user privilege state, where the administrator privilege state is the starting state for the execution of the reverse behavior, and the ordinary user privilege state is the recovery state after the execution of the reverse behavior.

[0116] After obtaining the recovery status, the recovery status is matched with the baseline end status of the corresponding test behavior in the behavior status association baseline. At the same time, it is checked whether the state residue recorded in the state residue candidate relationship still exists after the reverse behavior is executed.

[0117] When the recovery state is consistent with the target local software function state represented by the baseline end state, and the state residue in the state residue candidate relationship has been eliminated from the running state of the target local software function, it is determined that the reverse behavior has restored the target local software function to the normal state, and the state change corresponding to the state residue candidate relationship is determined to have been eliminated.

[0118] For example, if the current version's user permission modification state is administrator privilege state, and the normal ending state in the behavior state association baseline is ordinary user privilege state, and the reverse behavior is executed, the user is restored to ordinary user privilege state, and the administrator privilege state no longer exists, then the following sequence is formed: administrator privilege state → revoked administrator privileges → ordinary user privilege state, indicating that the residual state has been eliminated.

[0119] After obtaining the recovery status, the recovery status is matched with the baseline end status, and the state residue in the state residue candidate relationship is checked again. When the recovery status is inconsistent with the baseline end status, it indicates that the reverse behavior has not restored the target local software function to the normal end status. When the recovery status is consistent with the baseline end status but the state residue in the state residue candidate relationship still exists, it indicates that the surface state has been restored but the actual state has not been eliminated. In both cases, it is determined that the state residue has not been eliminated.

[0120] For example, if the actual ending state is administrator privileges and the baseline ending state is ordinary user privileges, and the restored state after performing the reverse action is still administrator privileges, then the following pattern occurs: administrator privileges → revoked administrator privileges → administrator privileges, indicating that the residual state has not been eliminated; or the restored state shows ordinary user privileges, but the background privileges are still administrator privileges, which also indicates that the residual state has not been eliminated.

[0121] During the execution of reverse behavior, the existing state changes before the execution of reverse behavior are matched with the state changes generated during the execution of reverse behavior, and after the execution of reverse behavior, it is checked whether the newly added state changes still exist. When a new state change that is not recorded in the state residual candidate relationship appears after the execution of reverse behavior, and the new state change is still maintained after the execution of reverse behavior, it is determined that the reverse behavior has generated a non-target state change.

[0122] When a new state change only appears briefly during the execution of the reverse behavior and disappears after the reverse behavior ends, it is not considered a non-target state change. For example, if the actual ending state is administrator privileges, and after revoking administrator privileges, the user returns to normal user privileges, but simultaneously a new and persistent account lockout state is created, the result is: Administrator privileges → Revoked administrator privileges → Normal user privileges + Account lockout state. The account lockout state is a continuously added state change that is not recorded in the residual candidate relationship, therefore it is considered a non-target state change.

[0123] After completing the elimination of state residues, the judgment of the restored state and the non-target state change, when the state residues have been eliminated, the restored state is consistent with the baseline end state and there is no continuous non-target state change after the reverse behavior is executed, the candidate relationship of the state residues is determined as a reversible state change.

[0124] When state residues are not eliminated, the recovered state is inconsistent with the baseline end state, or there are continuous non-target state changes, the candidate relationship of state residues is determined as an irreversible state change, and the actual end state, reverse behavior, recovered state, and reversible or irreversible state changes are associated to form a state reversibility verification result.

[0125] For example, under normal circumstances, the state is: administrator privilege state → administrator privilege revocation → ordinary user privilege state. If the administrator privilege state is eliminated and restored to the same state as the baseline end state and there are no new continuous state changes, then a reversible state change is formed.

[0126] If the following sequence occurs: administrator privilege state → administrator privilege revoked → administrator privilege state, and the administrator privilege state still exists, then an irreversible state change has occurred.

[0127] By constructing reverse behavior based on the candidate relationship of state residues and performing state reversibility verification as described above, recovery path analysis of abnormal state changes generated by test behavior is realized. This allows unrecoverable state residues to further influence the analysis of subsequent test behaviors. Furthermore, the automated test behavior chain of local software functions is reconstructed based on the actual impact of state residues on subsequent test behaviors. This reduces the interference of continuous state changes generated by preceding test behaviors on the subsequent test process and improves the accuracy of test behavior correlation analysis and test execution result judgment in the automated test of local software functions.

[0128] However, in the process of automated testing of local software functions, there are strong state transit relationships between test behaviors. Irreversible state changes formed after the execution of some test behaviors may continue to affect the execution results of subsequent test behaviors. Existing automated testing methods usually treat such abnormal states as interference factors, making it difficult to further analyze the correlation between state residues and subsequent test behaviors. This results in the software running state already formed during the testing process being unable to participate in subsequent test optimization. Therefore, this invention analyzes the influence relationship of state residues corresponding to irreversible state changes, transforms state residues into pre-context conditions in the execution of subsequent test behaviors, and reconstructs the automated testing behavior chain of local software functions based on the effect relationship of state residues on subsequent test behaviors. The specific steps are as follows:

[0129] Methods for determining state remnants as prerequisite context conditions for subsequent test behaviors include:

[0130] Filter out the candidate relationships of state residues that are determined to be irreversible state changes from the state reversibility verification results, and read the state residues corresponding to the irreversible state changes, the test behaviors that generate the state residues, the pre-states before the test behaviors are executed, and the actual end states after the test behaviors are executed.

[0131] Among them, state residue is used to represent the continuous state change of the target local software function in the current version after the execution of the test behavior, which has not recovered to the end state corresponding to the behavior state-related baseline. The test behavior that generates state residue is used to represent the specific test behavior that triggers the generation of state residue. The actual end state is used to represent the current software state of the target local software function after the generation of state residue.

[0132] After obtaining the state residue corresponding to the irreversible state change, the test behavior corresponding to the irreversible state change is located in the execution position of the test behavior in the current version test execution trajectory, and the test behavior to be executed is searched for backward along the order of the test behavior in the current version test execution trajectory.

[0133] The test behaviors that follow the test behaviors that generate state residues and are executed sequentially are identified as candidate subsequent test behaviors. The preceding state, test behavior, state change and ending state corresponding to the candidate subsequent test behaviors are retained so that each candidate subsequent test behavior can correspond to the actual execution process after the state residues are generated.

[0134] For example, when the target local software function is a user permission modification function, the current version's test execution trajectory is recorded as follows:

[0135] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission modification → Permission saving completed;

[0136] Among them, modifying user permissions is a test behavior that generates state residue, and the administrator permission state is a state residue corresponding to an irreversible state change. Therefore, we will look for two subsequent test behaviors that continue to be executed after modifying user permissions in the current version test execution trajectory, namely, submitting permission modification and permission saving completion, and use them as candidate objects for subsequent test behaviors.

[0137] After obtaining the subsequent test behaviors, two execution states are constructed: one with retained state residue and the other with eliminated state residue. The corresponding subsequent test behaviors are executed in the same order of test behaviors under the two execution states.

[0138] Among them, the retention of state residue is used to indicate that the actual end state corresponding to the irreversible state change remains unchanged, so that subsequent test behaviors continue to be executed in the target local software functional state where state residue exists.

[0139] Eliminating state residue is used to represent restoring the target local software function state based on the reverse behavior corresponding to the state reversibility verification result, so that the target local software function is restored to the baseline end state corresponding to the behavior state associated baseline, and then the same subsequent test behavior is executed.

[0140] During execution, the state changes generated by subsequent test behaviors under the two execution states and the end state after the execution of subsequent test behaviors are recorded respectively, and the corresponding state changes under the two execution states are compared according to the order in which the test behaviors occur.

[0141] If the state remnant is retained, and the state change produced by the subsequent test behavior is different from the state change produced by the same subsequent test behavior after the state remnant is removed, or the ending state after the execution of the subsequent test behavior is different, it indicates that the state remnant has changed the execution result of the subsequent test behavior, and the corresponding subsequent test behavior is identified as the subsequent test behavior affected by the state remnant.

[0142] If the state changes and the ending state are consistent when the state residue is retained and when the same subsequent test behavior is executed after the state residue is removed, it indicates that the state residue does not affect the execution process of the subsequent test behavior, and the corresponding subsequent test behavior is not identified as the subsequent test behavior affected by the state residue.

[0143] For example, the current version's test execution track contains:

[0144] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission changes → Permissions saved successfully;

[0145] Submitting permission changes while retaining administrator privileges results in:

[0146] Administrator privilege status → Submit permission changes → Administrator privileges saved status;

[0147] After performing the reverse behavior to restore the system, and then committing the permission changes, the following occurs:

[0148] Regular user permission status → Submit permission modification → Regular user permission save status;

[0149] Since the ending states of submitting permission modifications differ between the two states, submitting permission modifications is determined to be a subsequent test behavior affected by the residual administrator permission state.

[0150] After determining the subsequent test behaviors affected by state residue, read the actual end state after the corresponding test behavior is executed from the state residue candidate relationship, and associate the actual end state with the subsequent test behaviors affected by state residue;

[0151] The actual end state represents the actual running state of the target local software function before the subsequent test behaviors affected by the state residue begin to be executed, and is used to describe the state environment inherited when the subsequent test behaviors are executed.

[0152] The actual end state is taken as the software state condition that must be met before the execution of subsequent test behaviors affected by the state residue. This enables subsequent test behaviors to be associated with the test behaviors that generate the state residue and the impact process after the state residue continues to exist, forming the pre-context conditions corresponding to the state residue.

[0153] For example, the state residual candidate relation records:

[0154] Regular user permission status → Modify user permissions → Administrator permission status (actual end status)

[0155] And if it is determined that submitting permission changes is a subsequent test behavior affected by residual state, then the administrator permission state is determined as the precondition for executing the submit permission change, forming:

[0156] Administrator privilege status (status residual) → Submit permission modification → Administrator privilege status saved;

[0157] By using the above method, the state residue corresponding to the irreversible state change is converted into a prerequisite context condition that needs to be considered when executing subsequent test behaviors. This enables subsequent test behaviors to be associated with the actual impact process after the state residue is generated, and can be used for impact analysis of subsequent test behaviors.

[0158] The methods for refactoring the automated testing behavior chain for local software functions include:

[0159] After obtaining the state residue corresponding to the irreversible state change, the test behavior that generates the state residue, and the subsequent test behavior affected by the state residue, the relationship between the test behavior that generates the state residue, the state residue, and the subsequent test behavior is reorganized according to the actual execution order in the test execution trajectory of the current version.

[0160] First, read the position of the test behavior that generates state residue and determine the test behavior that generates state residue as the starting test behavior of the continuous test behavior chain. Then, read the actual ending state after the execution of the test behavior that generates state residue and use the state residue corresponding to the irreversible state change as the state context between the test behavior that generates state residue and the subsequent test behavior affected by the state residue.

[0161] Subsequently, the subsequent test behaviors affected by the state residue are sequentially connected to the state residue according to the actual execution order in the current version's test execution trajectory, so that the test behaviors that generate state residue, the state residue, and the subsequent test behaviors affected by the state residue form a continuous association, thereby forming a continuous test behavior chain.

[0162] For example, if the target software function is to modify user permissions, and the current version generates a residual administrator privilege state after modifying user permissions, and subsequent executions of submitting permission modifications are affected by this residual administrator privilege state, then the following chain of continuous test behaviors is formed:

[0163] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission modification → Permission submission completed;

[0164] Among them, the status of ordinary user permissions is the state before the execution of the test behavior that generates state residue, modifying user permissions is the test behavior that generates state residue, the status of administrator permissions is state residue, and submitting permission modification is the subsequent test behavior affected by state residue. The complete process of state residue affecting subsequent test behavior is preserved through the above continuous association.

[0165] After forming a continuous chain of test behaviors, continue to read all subsequent test behaviors executed after the test behavior that generates state residue in the current version's test execution trajectory, and distinguish the subsequent test behaviors based on the impact of state residue;

[0166] For subsequent test behaviors that are not affected by state residues during execution, including state changes, termination states, and test behavior execution results, the subsequent test behaviors are separated from the continuous test behavior chain, while retaining the original execution order of the subsequent test behaviors.

[0167] For subsequent test behaviors that have been affected by state residues, they are retained in the chain of consecutive test behaviors, so that state residues and subsequent test behaviors affected by state residues remain continuously associated.

[0168] Finally, the continuous test behavior chain and the subsequent test behaviors that are not affected by the separated state residues are recombined according to the order of test behavior occurrence in the test execution trajectory of the current version, so that the test behaviors that generate state residues, state residues, subsequent test behaviors affected by state residues, and subsequent test behaviors that are not affected by state residues together form a local software function automated test behavior chain.

[0169] For example, the current version's test execution track executes the following sequentially:

[0170] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission modification → Permission submission completed → Exit user management page;

[0171] Among these, submitting permission modifications is affected by the administrator's permission status, while exiting the user management page is not affected by the administrator's permission status. This creates a continuous test behavior chain involving modifying user permissions, administrator permission status, and submitting permission modifications.

[0172] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission modification;

[0173] Meanwhile, exiting the user management page was separated as a subsequent test behavior unaffected by residual state, and finally summarized according to the actual execution order:

[0174] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission changes → Exit user management page;

[0175] This forms a chain of automated testing behaviors for local software functions.

[0176] By correlating irreversible state changes with subsequent test behaviors, the subsequent test behaviors affected by the state residues are identified. The state residues are then used as the preconditions for the execution of subsequent test behaviors, thus enabling the identification of the continuous impact of abnormal states. This allows the automated testing process to retain and utilize the existing software running state. Simultaneously, by reorganizing the continuous test behavior chain based on the impact relationship of state residues, the test behaviors that generate state residues are kept correlated with the affected subsequent test behaviors, reducing test behavior breaks caused by state residues and improving the continuity and adaptability of the automated test behavior chain for local software functions.

[0177] The ways to update the behavior state association baseline include:

[0178] The chain of automated testing behaviors for local software functions will be used as the basis for the execution order of the next round of automated testing of the target local software function.

[0179] First, restore the initial running state of the target local software function according to the order of test behavior occurrence in the local software function automated test behavior chain, and start executing the target local software function from the test behavior that generated state residue;

[0180] During the execution of a continuous chain of test behaviors, the state before the test behavior is executed, the state change after the test behavior takes effect, and the final state after the test behavior is completed are recorded according to the actual execution order of each test behavior. The execution results of subsequent test behaviors affected by the state residue are recorded in particular.

[0181] Once all test behaviors in the continuous test behavior chain have been executed, the test behaviors that produce state residues, the state residues, the subsequent test behaviors affected by the state residues, and the test behaviors, state changes, and end states corresponding to the subsequent test behaviors that are not affected by the state residues will be associated in the actual order of occurrence to form an updated test execution trajectory.

[0182] For example, a chain of automated testing behaviors based on local software functions:

[0183] Regular user permission status → Modify user permissions → Administrator permission status (status residual) → Submit permission changes → Exit user management page;

[0184] When re-executing the user permission modification function, record the change in user permission status from ordinary user permission status to administrator permission status after the user permission modification is executed, and continue to record the permission submission status change after submitting the permission modification and the ending status after exiting the user management page, thus forming the corresponding update test execution trajectory.

[0185] After the updated test execution trajectory is formed, the test behaviors, pre-states, state changes and ending states in the updated test execution trajectory are matched one by one with the corresponding test behaviors, state changes and ending states in the behavior state association baseline according to the order in which the test behaviors occur.

[0186] When the test behaviors, state changes, and termination states in the updated test execution trajectory are consistent with the corresponding relationships in the behavior-state association baseline, the original relationships in the behavior-state association baseline are retained, so that the state relationships that remain stable after repeated verification in the current version can continue to serve as the basis for automated testing of the target local software functions.

[0187] When a new state change that was not recorded in the behavior state correlation baseline appears in the updated test execution trajectory, first confirm whether the new state change is generated by the stable automated test behavior of the target local software function. That is, while keeping the test entry, test operation sequence, execution environment and test context consistent, re-execute the corresponding test behavior and respond accordingly to the state changes generated during the re-execution.

[0188] When the same new state change is continuously generated after re-execution, and the new state change does not conflict with the state association relationship in the existing behavior state association baseline, the test behavior, the previous state, the state change and the ending state corresponding to the new state change are added to the behavior state association baseline.

[0189] When the original state changes in the updated test execution trajectory, the original relationship in the behavior state association baseline is not directly replaced. Instead, the state changes in the current version are judged based on the re-execution results to determine whether they have remained stable after multiple test verifications. When it is confirmed that the new state change has become a stable state transition relationship in the automated testing process of the target local software function, the corresponding state association relationship in the behavior state association baseline is adjusted according to the actual execution results in the updated test execution trajectory.

[0190] For example, the original behavioral state is associated with the baseline record:

[0191] Regular user permission status → Modify user permissions → Administrator permission status;

[0192] In the next round of automated testing of the target local software functions, the following will remain after re-executing the test behavior of modifying user permissions:

[0193] Regular user permission status → Modify user permissions → Administrator permission status;

[0194] Then the corresponding relationship in the original behavior state relationship baseline is retained;

[0195] If a subsequent change in the status corresponding to the test action of submitting permission modification is found, the original behavior status will be associated with the baseline record:

[0196] Administrator privilege status → Submit permission changes → Permission submission completed;

[0197] The current version update test execution track shows that multiple attempts to commit permission modifications have resulted in the following:

[0198] Administrator privilege status → Submit permission changes → Regular user privilege status;

[0199] And if the above state changes are maintained after re-execution, it is determined that the state association relationship corresponding to the submission permission modification has undergone a stable change, and the original behavior state association baseline is:

[0200] Administrator privilege status → Submit permission changes → Permission submission completed;

[0201] Updated to:

[0202] Administrator privilege status → Submit permission changes → Regular user privilege status;

[0203] Finally, the adjusted behavior state correlation baseline will be used as the state reference for the next round of automated testing of the target local software functions, so that the behavior state correlation baseline can be continuously updated according to the stable state changes during the actual execution of the target local software functions.

[0204] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the present invention.

Claims

1. A local software function automated testing and optimization system based on deep learning, characterized in that, include: Baseline building module: Obtain multi-version test execution trajectory of target local software functions, and build behavior state correlation baseline; The residual identification module, based on the behavioral state association baseline, executes the target local software function of the current version and identifies candidate relationships of state residuals formed by the test behavior. The state verification module constructs the corresponding reverse behavior based on the candidate relationship of state residues and performs reversible state verification to obtain the state reversibility verification result. The behavior reconstruction module, based on the state reversibility verification results, determines the state residue as the precondition of subsequent test behaviors for state residues that are verified to be irreversible, and reorganizes the subsequent test behaviors affected by the state residues and the test behaviors that generate the state residues into a continuous test behavior chain, thus reconstructing the automated test behavior chain of local software functions. The baseline update module re-executes the target local software function based on the automated test behavior chain of local software functions, and updates the behavior state associated baseline according to the state changes obtained from the re-execution.

2. The deep learning-based automated testing and optimization system for local software functions as described in claim 1, characterized in that, The methods for obtaining the multi-version test execution trajectory include: Obtain the test entry points and test operation sequences for the target local software functions in the current version and multiple historical stable versions, and execute the tests respectively; During execution, the preceding state, test behavior, state change and ending state are recorded in the order of test behavior occurrence to generate single-version test execution trajectories for each version, and then mapped and aligned in sequence to form multi-version test execution trajectories.

3. The deep learning-based automated testing and optimization system for local software functions as described in claim 2, characterized in that, The methods for constructing the behavior state association baseline include: Cross-version comparison of test execution trajectories across multiple versions is performed to extract state associations that repeatedly occur with the same test behavior in multiple historical stable versions and whose state transitions remain consistent before and after; The state associations are linked to subsequent test behaviors according to the order in which the test behaviors occur, forming a test behavior-software state association chain; The repeated state associations in multiple test behavior-software state association chains are summarized to form a behavior-state association baseline.

4. The deep learning-based automated testing and optimization system for local software functions as described in claim 3, characterized in that, The methods for executing the target local software function of the current version include: Based on the behavioral state correlation baseline, restore the previous state and execute the target local software function, record the state changes and the end state, and form the single version test execution trajectory of the current version; The current version's single-version test execution trajectory is sequentially associated with the behavior state baseline to form the current version's test execution trajectory.

5. The deep learning-based automated testing and optimization system for local software functions as described in claim 4, characterized in that, The methods for identifying residual candidate relationships of states formed by the effects of testing behaviors include: Compare the current version's test execution trajectory with the baseline of the behavior state association to identify state changes where the actual end state after the test behavior is executed is inconsistent with the baseline of the behavior state association; In response to state changes, the input, execution environment, and test context outside the test behavior remain unchanged, and the test behavior that caused the state change is re-executed. When the same test behavior repeatedly produces the same state change and the state change still exists after the test behavior ends, the state change is identified as a candidate state residue. The candidate state residues are associated with the test behavior, the preceding state, and the actual ending state that generated the candidate state residues, forming a candidate state residue relationship.

6. The deep learning-based automated testing and optimization system for local software functions as described in claim 5, characterized in that, The methods for constructing the corresponding reverse behavior include: The test behavior that generates candidate state residues and the actual end state are obtained from the state residue candidate relationship, and the state change and baseline end state corresponding to the test behavior are found in the behavior state association baseline. Find subsequent test behaviors from the multi-version test execution trajectory that can restore the software state to the baseline end state after the state change occurs, and reverse connect them according to the state restoration order to form reverse behavior.

7. The deep learning-based automated testing and optimization system for local software functions as described in claim 6, characterized in that, The methods for obtaining the state reversibility verification result include: The actual end state is used as the starting state for the execution of the reverse behavior. The reverse behavior is executed in the order of execution, and the state changes during the execution of the reverse behavior and the recovery state after the execution of the reverse behavior are recorded. When the restored state after the reverse behavior is consistent with the baseline end state and the state residue in the state residue candidate relationship is eliminated, it is determined that the state residue has been eliminated. If the recovery state is inconsistent with the baseline end state or if state residue still exists, it is determined that the state residue has not been eliminated. If, after the reverse behavior is executed, there are still new state changes that are not recorded in the residual candidate relationship, it is determined that a non-target state change has occurred. When the state residue is eliminated, the restored state is consistent with the baseline end state, and no non-target state change occurs, the state residue candidate relationship is determined as a reversible state change; otherwise, the state residue candidate relationship is determined as an irreversible state change, thus forming a state reversibility verification result.

8. The deep learning-based automated testing and optimization system for local software functions as described in claim 7, characterized in that, The methods for determining state residues as prerequisite context conditions for subsequent test behaviors include: Extract the state residues corresponding to irreversible state changes and the test behaviors that generate these state residues, and find the subsequent test behaviors that continue to be executed after generating state residues in the current version's test execution trajectory. According to the execution order of subsequent test behaviors, the same subsequent test behaviors are executed after retaining the state residue and after eliminating the state residue. The state changes produced by the subsequent test behaviors in the two states are compared. When the state change of the subsequent test behaviors when retaining the state residue is inconsistent with the state change of the subsequent test behaviors when eliminating the state residue, the subsequent test behaviors are determined to be the subsequent test behaviors affected by the state residue. The actual end state corresponding to the state residue is determined as the precondition for subsequent test behaviors affected by the state residue.

9. The deep learning-based automated testing and optimization system for local software functions as described in claim 8, characterized in that, The methods for reconstructing the automated testing behavior chain of local software functions include: Based on the sequential relationship between the test behavior that generates state residue, the state residue, and the subsequent test behavior affected by the state residue, the test behavior that generates state residue is regarded as the preceding test behavior, and the state residue is regarded as the state context between the preceding test behavior and the subsequent test behavior affected by the state residue, thus forming a continuous test behavior chain. Subsequent test behaviors unaffected by state remnants are separated and aggregated with the continuous test behavior chain to form a local software function automated test behavior chain.

10. The deep learning-based automated testing and optimization system for local software functions as described in claim 9, characterized in that, The methods for updating the behavior state associated with the baseline include: Based on the automated test behavior chain of local software functions, the target local software function is re-executed, and the test behavior, state changes and termination status are recorded according to the continuous test behavior chain to form an updated test execution trajectory. The updated test execution trajectory is associated with the behavior state correlation baseline. When the test behavior and state changes remain consistent, the corresponding correlation is retained. When a new state change occurs or the original state change is altered, the behavior state correlation baseline is updated, and the updated behavior state correlation baseline is used for the next round of automated testing of the target local software functions.