A Deep Learning-Based Method and System for Predicting Expected Results in Software Testing
By fusing multi-source heterogeneous data through deep learning technology, test results that conform to system constraints and business logic are generated, solving the problems of difficult manual maintenance and insufficient data integration in existing methods, and improving the efficiency and accuracy of software testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-03
AI Technical Summary
Existing methods for generating expected results in software testing rely on manually written rules, which are difficult to maintain, struggle to handle complex business logic and unknown scenarios, and cannot effectively integrate heterogeneous data from multiple sources, resulting in low testing efficiency and insufficient accuracy.
A deep learning-based approach is adopted to extract feature vectors through multi-source heterogeneous data fusion analysis using text encoders, structured data encoders, and temporal feature encoders. Multi-head self-attention mechanism and cross-modal attention fusion are combined to generate multi-dimensional prediction results, and dynamic verification and conflict resolution are performed to generate test expected results that meet system constraints and business logic.
It reduces human intervention, improves the efficiency and accuracy of software testing, better adapts to system iterations and changes, and generates more reliable test results.
Smart Images

Figure CN121434100B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing technology, and in particular to a method and system for predicting expected results in software testing based on deep learning, which is used to automatically predict expected results in the software testing process and improve testing efficiency and accuracy. Background Technology
[0002] Software testing is a crucial step in ensuring software quality, and predicting expected results is a core task within software testing. Traditional software testing expected result generation techniques primarily rely on testers manually writing business rules and assertion logic. This requires defining expected outputs based on requirements documents to verify whether the actual behavior of the system under test conforms to expectations.
[0003] Currently, common methods for generating expected test results mainly include rule-based methods and statistical learning-based methods. Rule-based methods infer output results through predefined if-then rule sets, which are easy to understand and implement; statistical learning-based methods, on the other hand, use historical test data to train prediction models and extract patterns through data mining.
[0004] The most advanced existing technology is pattern matching-based prediction, which retrieves the most similar case to the current input from a historical test case library and uses its corresponding output as the expected result. This method can adapt to a certain degree of business change, but its effectiveness is highly dependent on the quality and coverage of historical data, and it is difficult to handle new scenarios that have not appeared before.
[0005] However, existing technologies have several technical shortcomings: First, the high dependence of traditional methods on domain knowledge leads to high testing manpower costs; second, rules need to be updated synchronously when the system iterates frequently, which is difficult to maintain and prone to omissions; third, existing methods cannot effectively integrate design-time metadata such as API specifications and database schemas with runtime data such as real-time logs, resulting in limited predictive capabilities for unknown scenarios; and finally, existing technologies lack the necessary semantic understanding capabilities when dealing with complex business logic, making it difficult to capture the deep nonlinear relationships between input parameters and output results. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for predicting expected results of software testing based on deep learning. This method can automatically generate expected test results that conform to system constraints and business logic through the fusion analysis of multi-source heterogeneous data and deep learning technology, thereby reducing manual intervention and improving testing efficiency.
[0007] To achieve the above objectives, the technical solution provided by this invention is: a method for predicting expected results of software testing based on deep learning, comprising the following steps: acquiring multi-source heterogeneous data of the system under test, and preprocessing and fusing the multi-source heterogeneous data to determine a multimodal dataset; extracting features from the multimodal dataset using a text encoder, a structured data encoder, and a temporal feature encoder to obtain several feature vectors, and fusing the feature vectors to generate a feature vector set; performing deep learning inference on the feature vector set, and generating a multidimensional prediction result through multi-head self-attention mechanism and cross-modal attention fusion, wherein the multidimensional prediction result includes predicted data structure, anomalies, and confidence scores; and performing dynamic verification and conflict resolution on the multidimensional prediction result to generate expected test results that conform to system constraints and business logic.
[0008] Further, determining the multimodal dataset based on the multi-source heterogeneous data includes: scanning the system under test to identify interface specifications in the application programming interface gateway, database structure definitions, historical test cases in the test repository, and production environment logs in the log system to form an original multi-source heterogeneous dataset; cleaning and transforming the original multi-source heterogeneous dataset to convert the interface specifications into a unified interface description language, convert the database structure definitions into a graph structure representation, process the historical test cases into a standard key-value pair format, and parse the production environment logs into a structured time series to obtain structured data; and establishing association mappings between different data sources based on the structured data using entity matching algorithms and relationship inference techniques to form the multimodal dataset.
[0009] Further, the step of extracting features from the multimodal dataset using a text encoder, a structured data encoder, and a temporal feature encoder to obtain several feature vectors, and then fusing these feature vectors to generate a feature vector set, includes: inputting the text portion of the multimodal dataset into a pre-trained BERT model for semantic feature extraction to generate a semantic vector representation; constructing a graph structure based on the structured data portion of the multimodal dataset and modeling the graph structure using a message passing mechanism of a graph neural network to generate a structural feature vector; inputting the temporal data portion of the multimodal dataset into a bidirectional LSTM network for processing to generate a temporal feature vector; and fusing the semantic vector representation, the structural feature vector, and the temporal feature vector using a linear projection and attention mechanism to generate the feature vector set.
[0010] Furthermore, deep learning inference is performed on the feature vector set, generating multi-dimensional prediction results through multi-head self-attention mechanism and cross-modal attention fusion. This includes: applying multi-head self-attention mechanism to the feature vector set to project each feature vector onto a query, key, and value space to obtain several projection results, and obtaining context-aware feature representations by calculating the attention scores of each projection result; performing cross-modal attention fusion on the feature representations to establish semantic associations between text modal features, structural modal features, and temporal modal features to obtain fused feature representations; performing nonlinear transformation on the fused feature representations through a multi-layer feedforward neural network to generate target feature vectors; and based on the target feature vectors, predicting the data structure of normal responses, abnormal situations and error codes, and the confidence scores of prediction results through three parallel branches of a gated prediction head to generate the multi-dimensional prediction results.
[0011] Furthermore, the multidimensional prediction results are dynamically verified and conflict resolved to generate expected test results that conform to system constraints and business logic. This includes: performing preliminary verification on the multidimensional prediction results, ensuring that the multidimensional prediction results conform to basic constraints through type consistency checks, value range verification, and format validation, and correcting prediction results that violate the basic constraints to generate preliminary verification results; matching and verifying the preliminary verification results with implicit and explicit rules in the business rule base to generate business rule verification results; performing conflict detection and consistency analysis on the business rule verification results to generate analysis results containing conflict markers and consistency scores; and performing intelligent conflict resolution based on the analysis results to generate the expected test results.
[0012] Further, the step of performing a nonlinear transformation on the fused feature representation through a multi-layer feedforward neural network to generate a target feature vector includes: normalizing the fused feature representation to generate a preprocessed standard feature representation; constructing a secant derivative approximation function based on the standard feature representation, and taking two similar points for each weight parameter—the current weight and the weight after a small perturbation—and calculating the rate of change of the secant derivative approximation function between these two similar points as the derivative approximation to generate a derivative approximation result; applying multi-scale regularization constraints based on the derivative approximation result to generate a regularization constraint result; performing parameter updates based on global rate optimization based on the derivative approximation result and the regularization constraint result to generate optimized network parameters; and performing a nonlinear transformation on the fused feature representation based on the network parameters, and applying hierarchical residual connections and feature selection mechanisms to generate a regularized optimized target feature vector.
[0013] Furthermore, the multi-scale regularization constraints include parameter-level regularization, hierarchical regularization, and global regularization. Specifically, it includes: applying norm 1 regularization and norm 2 regularization to each weight parameter in the multi-layer feedforward neural network, controlling the parameter scale by calculating the sum of the absolute values and the sum of squares of the parameters to generate parameter-level regularization; applying norm constraints to the output features of each layer of the multi-layer feedforward neural network, calculating the norm 2 of the feature vector and setting an upper bound threshold to generate hierarchical regularization; dynamically adjusting the regularization strength based on the overall network complexity and data distribution characteristics to generate global regularization; and adaptively adjusting the regularization coefficients of each layer based on the parameter-level regularization, the hierarchical regularization, and the global regularization through a monitoring and validation set performance feedback mechanism to generate the regularization constraint results.
[0014] Further, the step of generating the feature vector set by performing feature fusion based on the semantic vector representation, the structural feature vector, and the temporal feature vector through linear projection and attention mechanisms includes: performing feature space transformation on the semantic vector representation, the structural feature vector, and the temporal feature vector; constructing a second-order polynomial basis to capture the nonlinear interaction relationship between features, generating a polynomial feature space; constructing an scalable quadratic sum-square constraint structure based on the polynomial feature space to model the feature fusion process as an optimization problem with a polynomial objective function and constraints, and generating a corresponding constrained optimization problem based on the optimization problem; transforming the constrained optimization problem into a second-order cone programming problem, and solving it using a second-order cone programming solver to generate a programming solution result; calculating the optimal feature fusion weights based on the programming solution result, and mapping the feature fusion weights back to the original problem space to extract the fusion matrix coefficients, generating a dynamic weight allocation scheme; and fusing the semantic vector representation, the structural feature vector, and the temporal feature vector based on the dynamic weight allocation scheme to obtain preliminary fused features, and performing uncertainty estimation and batch normalization processing on the preliminary fused features to generate a feature vector set.
[0015] Further, the step of calculating the optimal feature fusion weights based on the planning solution results and mapping the feature fusion weights back to the original problem space to extract fusion matrix coefficients and generate a dynamic weight allocation scheme includes: extracting the coefficient vector of the fusion matrix based on the planning solution results and converting the coefficient vector into weight components of three feature modes to generate a preliminary weight allocation; performing sparsification processing on the preliminary weight allocation to generate a sparse weight allocation; performing normalization processing on the sparse weight allocation to generate a normalized weight allocation; adaptively adjusting the normalized weight allocation, dynamically correcting the weight ratio according to the characteristics of different test scenarios, calculating the scenario relevance score and adjusting the weight bias to generate a target allocation weight; and determining the dynamic weight allocation scheme based on the target allocation weight.
[0016] This invention also provides a deep learning-based software testing expected result prediction system, comprising: a data acquisition and preprocessing module for acquiring multi-source heterogeneous data of the system under test and determining a multimodal dataset based on the multi-source heterogeneous data; a multimodal feature encoding module for extracting features from the multimodal dataset using a text encoder, a structured data encoder, and a temporal feature encoder to obtain several feature vectors, and fusing the feature vectors to generate a feature vector set; a deep prediction model inference module for performing deep learning inference on the feature vector set, generating a multidimensional prediction result through multi-head self-attention mechanism and cross-modal attention fusion, wherein the multidimensional prediction result includes predicted data structure, anomalies, and confidence scores; and a dynamic verification and conflict resolution module for dynamically verifying and resolving conflicts in the multidimensional prediction result to generate expected test results that conform to system constraints and business logic.
[0017] The beneficial effects of this invention include: by acquiring multi-source heterogeneous data from the system under test, combining deep learning technology, automatically extracting and fusing multimodal features, and utilizing multi-head self-attention mechanisms and cross-modal attention fusion to generate multidimensional prediction results, and finally generating expected test results that conform to system constraints and business logic through dynamic verification and conflict resolution. This method not only reduces the workload of manually writing expected test results and improves the efficiency of software testing, but also better adapts to iterative changes in the system, improving the accuracy and reliability of test results. Attached Figure Description
[0018] Figure 1 A flowchart of the deep learning-based software testing expected result prediction method provided in Embodiment 1 of the present invention;
[0019] Figure 2 This is a structural block diagram of the deep learning-based software testing expected result prediction system provided in Embodiment 2 of the present invention. Detailed Implementation
[0020] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0021] Example 1
[0022] like Figure 1 As shown in the figure, the deep learning-based software testing expected result prediction method provided in this embodiment includes the following steps:
[0023] Step S1: Obtain multi-source heterogeneous data of the system under test, and perform preprocessing and correlation fusion based on the multi-source heterogeneous data to determine the multimodal dataset.
[0024] This step aims to collect and integrate various data sources from the software system under test, providing comprehensive input for subsequent deep learning models. Multi-source heterogeneous data refers to data sets from different sources with different structures and formats; in the field of software testing, this mainly includes API specifications, database structures, historical test cases, and system logs. Multimodal datasets, on the other hand, refer to unified data sets containing different modalities (such as text, structured data, and time-series data), which can comprehensively reflect the system's design specifications, data constraints, and operational behavior. By establishing such datasets, the system can comprehensively understand the business logic and technical characteristics of the software under test, providing a solid foundation for predicting expected test results.
[0025] This step first collects different types of data from various data sources of the system under test. Then, through a series of preprocessing and correlation fusion operations, a high-quality multimodal dataset is constructed for subsequent deep learning model training and inference. Multi-source heterogeneous data refers to a collection of data from different sources with different structures, formats, and characteristics. In software testing scenarios, this data typically includes five key categories: system documentation data, code repository data, test history data, runtime data, and interface interaction data. System documentation data includes API documents, requirements specifications, design documents, and user manuals, providing formal descriptions of system functions, interface definitions, and business rules. Code repository data includes source code, comments, configuration files, and change history, reflecting the system's internal implementation logic and technical constraints. Test history data includes historical test cases, test results, and defect reports, recording the system's expected behavior and known issues. Runtime data includes system logs, performance metrics, and error tracking data, demonstrating the system's behavior patterns in a real environment. Interface interaction data includes API call records, request-response pairs, and data flow logs, revealing the interaction patterns and data flow patterns between system components. The data acquisition process employs a multi-channel parallel acquisition strategy, including automated crawlers to collect API documentation and technical forum data, code repository connectors to extract source code and comments, test management system APIs to obtain historical test data, log collectors to capture runtime logs, and API proxies to record real-time interface interactions.
[0026] After acquiring the raw data, the system performs comprehensive data preprocessing, transforming raw data of different formats and structures into a structured and standardized form. Preprocessing includes four key stages: data cleaning, structure transformation, feature extraction, and quality assessment. The data cleaning stage removes irrelevant information, repairs damaged data, standardizes formats, and eliminates duplicates; for text data, it performs word segmentation, stop word removal, and grammatical correction; for structured data, it handles missing values, detects outliers, and standardizes formats; for time-series data, it performs time alignment, outlier smoothing, and imputation of missing segments. The structure transformation stage converts unstructured and semi-structured data (such as documents and logs) into a structured format, using named entity recognition technology to extract API parameters and return value definitions from documents, and using pattern matching to extract key events and state changes from logs. The feature extraction stage applies specific feature extraction techniques to different data types: text data uses TF-IDF, Word2Vec, or BERT to extract semantic features; structured data uses statistical analysis and feature engineering to extract numerical features; and time-series data uses sliding window, Fourier transform, or wavelet analysis to extract temporal pattern features. The quality assessment process uses multi-dimensional indicators (such as completeness, consistency, accuracy, and timeliness) to evaluate the quality of preprocessed data, ensuring that the data meets the requirements for subsequent model training.
[0027] After preprocessing, the system performs Correlation Fusion, linking and fusing data from different sources into a unified multimodal dataset. The Correlation Fusion process comprises three key technologies: entity alignment, relation building, and modality fusion. Entity alignment addresses the inconsistency in entity representations across different data sources by using entity matching algorithms (such as string similarity and semantic similarity calculation) to identify and link records referring to the same entities from different data sources, such as linking API documentation interface descriptions with code implementations and test cases. Relationship building analyzes and establishes logical relationships between data entities, using graph building algorithms to create entity relationship networks and capture complex relationships such as "API call dependencies," "test case verification functions," and "error log-associated code locations." Modality fusion integrates different types of data (text, structured, and time-series) into a unified multimodal representation while preserving the characteristics and information of each modality. The system employs a multi-view learning framework, constructing a specific representation space for each data type, and then achieving information interaction and complementarity between modalities through shared feature spaces or collaborative training methods.
[0028] The resulting multimodal dataset is a structured collection containing rich test-related information, with clear relationships established between various data types. Each test scenario (such as a specific API call) is associated with multiple modalities of data: descriptive text (such as API documentation and requirement descriptions), structured parameters (such as input parameters and system configurations), historical response records, and temporal behavior patterns. This multimodal dataset provides a comprehensive information foundation for subsequent deep learning models, enabling them to understand system behavior and test requirements from multiple dimensions, thereby generating more accurate expected test results. Through this systematic data processing flow, this invention effectively solves the problems of data fragmentation, strong heterogeneity, and complex relationships in the field of software testing, laying a solid data foundation for subsequent deep learning model training and inference.
[0029] Step S1.1: Scan the system under test to identify the interface specifications in the application programming interface gateway, the database structure definition, the historical test cases in the test repository, and the production environment logs in the log system, so as to form an original multi-source heterogeneous dataset.
[0030] This step begins by using a dedicated data acquisition agent to scan all components of the system under test, automatically identifying and collecting four key data sources. The Application Programming Interface (API) gateway serves as the unified entry point for the system's exposed functions. Its interface specifications are typically defined in standard formats such as Swagger or OpenAPI, including interface URLs, parameter types, and response formats. Database structure definitions refer to the table structure, field types, and relational constraints within the database, usually existing in the form of SQL DDL (Data Definition Language) statements. Historical test cases refer to previously executed test cases, including input parameters and corresponding expected output results, typically stored in JSON or XML format. Production environment logs record the system's actual runtime behavior and state changes, providing crucial information for understanding the system's actual operation. The data acquisition agent establishes connections with these systems, extracts raw data, and forms an initial multi-source heterogeneous dataset, laying the foundation for subsequent processing.
[0031] Step S1.2: Clean and transform the original multi-source heterogeneous dataset to convert the interface specification into a unified interface description language, convert the database structure definition into a graph structure representation, process the historical test cases into a standard key-value pair format, and parse the production environment logs into a structured time series to obtain structured data.
[0032] This sub-step standardizes the raw data, enabling data from different sources to be analyzed in a unified format. Data cleaning involves removing invalid, duplicate, or erroneous data records, filling in missing values, and standardizing the format. Interface Description Language (IDL) is a standardized language for describing software component interfaces. Converting API specifications of different formats into IDL allows for a unified representation of the structure and semantics of various interfaces. Graph representation is a method of modeling relational data as nodes and edges, where nodes represent entities (such as tables or fields) and edges represent relationships (such as foreign key associations). This representation better captures the interdependencies between data entities. Standard key-value pair format represents the input parameters and output results in test cases as a unified set of "key-value" pairs, facilitating subsequent processing and analysis. Structured time series refers to organizing raw logs in chronological order and extracting structured event, parameter, and status information, enabling quantitative analysis of system behavior. Through these transformations, raw heterogeneous data is converted into structured data in a unified format, facilitating subsequent correlation analysis.
[0033] Step S1.3: Based on the structured data, establish the association mapping between different data sources through entity matching algorithms and relationship inference techniques to form the multimodal dataset.
[0034] This sub-step establishes semantic relationships between different data sources, forming a multimodal dataset with rich internal connections. Entity matching algorithms are techniques for identifying entities representing the same concept in different data sources, such as matching API request parameters with database fields. These algorithms typically calculate matching scores based on multiple features, including name similarity, type compatibility, and contextual relevance, and select the most likely match. Relationship inference techniques, based on known entity matching and data patterns, infer more complex semantic relationships, such as identifying the correspondence between API operations and database operations, or the mapping relationship between test cases and related APIs. The output of this step is a multimodal dataset where data from different sources are connected through explicit relationships, forming a semantically rich knowledge network that comprehensively reflects the structure, behavior, and constraints of the system under test, providing high-quality input for subsequent feature extraction.
[0035] Step S2: Extract features from the multimodal dataset using a text encoder, a structured data encoder, and a temporal feature encoder to obtain several feature vectors. Then, fuse these feature vectors to generate a feature vector set.
[0036] This step utilizes a specially designed neural network encoder to process different types of data in the multimodal dataset, converting them into fixed-dimensional vector representations and fusing them to form a unified feature representation. Feature vectors are methods of representing the features of data objects using numerical vectors, capable of capturing the semantic information and structural characteristics of the data. Multimodal feature encoding is a key technology in deep learning for processing various types of data. By mapping textual, structural, and temporal data to the same feature space through different encoders, machine learning models can uniformly process these heterogeneous data. The goal of this step is to convert complex multimodal data into a standardized numerical representation, preserving the core semantic and structural information of the original data, providing well-structured input for subsequent deep learning inference.
[0037] This step utilizes a specially designed multimodal feature extraction architecture to perform deep feature extraction on the multimodal dataset generated in step S1, and fuses the feature vectors from different modalities into a unified representation, providing high-quality input for subsequent deep learning inference. Feature extraction is the process of converting raw data into a numerical representation that better expresses the essential characteristics of the data. It plays a crucial role in deep learning systems, directly affecting the model's learning performance and prediction accuracy. To address the multimodal characteristics of the test expectation result prediction task, this invention designs three dedicated encoders: a text encoder, a structured data encoder, and a temporal feature encoder, each processing different types of data.
[0038] The text encoder is responsible for processing various text data in the system, including API documentation, requirement descriptions, code comments, and test descriptions. The text encoder employs a pre-trained language model based on the Transformer architecture, such as BERT, RoBERTa, or the domain-adaptive CodeBERT. These models, through self-attention mechanisms, can capture long-range dependencies and contextual semantics in text, making them ideal for handling technical terminology and complex semantics in technical documents. The text encoding process consists of three main stages: text standardization, tokenization, and semantic encoding. The text standardization stage performs character-level processing, including case conversion, special character handling, and URL and code snippet recognition. The tokenization stage uses a dedicated tokenizer to segment the text into a sequence of tokens, while also handling technical terminology, code snippets, and structured expressions specific to technical documents. The semantic encoding stage inputs the tokenized sequences into the pre-trained language model to obtain context-sensitive word embeddings. To adapt to the specificities of the software testing domain, the text encoder has undergone domain-adaptive fine-tuning, using software documentation and test data for secondary training, enhancing its ability to understand specific content such as technical terminology, API descriptions, and test specifications. The text encoder ultimately outputs a fixed-dimensional feature vector that represents the semantic content of the text data. The dimension is usually 768 or 1024, depending on the specifications of the base pre-trained model.
[0039] A Structured Data Encoder (SDA) is specifically designed to process various types of structured data in a system, such as API parameters, system configurations, environment variables, and test inputs. Unlike text encoders that process natural language, SDAs need to handle information with clearly defined field definitions and data types. SDAs employ a hybrid neural network architecture, combining the advantages of feature transformation networks and graph neural networks. The encoding process comprises four main stages: field type processing, feature transformation, relation modeling, and representation aggregation. The field type processing stage applies specialized methods to different data types: numeric fields are processed through normalization and binning; categorical fields are represented through one-hot encoding or embedding; string fields are encoded using n-gram features or bag-of-words models; and complex structures (such as JSON and XML) are processed through recursive decomposition. The feature transformation stage uses a multilayer perceptron network to perform non-linear transformations on the initial representation of each field, capturing the complex patterns within the field. The relation modeling stage constructs a relation graph between fields, capturing dependencies and interaction patterns between fields through graph neural networks. This is particularly important for understanding the constraints between API parameters and the mutual influence of configuration items. The aggregation phase represents the process of combining the features and relationships of each field into a unified structured data representation. The structured data encoder outputs a fixed-dimensional feature vector, typically 512 or 768 dimensions, which encodes the content, type, and relationship information of the structured data.
[0040] A Temporal Feature Encoder (TFE) is specifically designed to process temporal data within a system, such as API call sequences, system state changes, and performance metric variations. Temporal data reflects the dynamic behavior of a system and is crucial for predicting system responses. The TFE employs a hybrid temporal model architecture, combining the advantages of Long Short-Term Memory (LSTM), Gated Recurrent Units (GRUs), and Temporal Convolutional Networks (TCNs). The encoding process comprises three main stages: temporal preprocessing, multi-scale feature extraction, and sequence representation learning. The temporal preprocessing stage performs data alignment, outlier handling, and time window segmentation. The multi-scale feature extraction stage uses one-dimensional convolutional layers with different kernel sizes to extract short-term, medium-term, and long-term patterns from the temporal data. The sequence representation learning stage uses bidirectional LSTMs or GRU networks to capture long-range dependencies and contextual information from the temporal data. To handle temporal data of varying lengths, the encoder employs an attention pooling mechanism to adaptively aggregate information from important time points. The temporal feature encoder outputs a fixed-dimensional feature vector, typically 512-dimensional, which encodes the trend, periodicity, anomaly patterns, and state transition information of the time series data.
[0041] After feature extraction from each modality, the system performs feature fusion, integrating feature vectors from different modalities into a unified representation. Feature fusion is a core challenge in multimodal learning, requiring the handling of semantic differences, inconsistent representation spaces, and uneven importance among different modalities. This invention employs a multi-level hierarchical fusion architecture, comprising three fusion levels: feature-level fusion, attention-level fusion, and decision-level fusion. Feature-level fusion maps features from different modalities to a shared feature space through projection transformation, adjusts feature dimensions using fully connected layers or linear projection, and then combines features through operations such as concatenation, weighted summation, or bilinear pooling. Attention-level fusion uses a cross-modal attention mechanism to calculate the relevance weights between features from different modalities, enabling selective information interaction between modalities, such as text descriptions focusing on structured parameters or historical response patterns focusing on the current input. Decision-level fusion combines prediction results from different modalities in the later stages of the model, dynamically adjusting the contribution weights of each modality using gating mechanisms or meta-learners, and selecting the most relevant information source based on the characteristics of the current test scenario.
[0042] Through this multimodal feature extraction and fusion process, the system ultimately generates a FeatureVector Collection, where each vector represents a comprehensive feature representation of a test scenario, encompassing integrated information on textual semantics, structured parameters, and temporal behavior. These high-quality feature vectors provide ideal input for the next step of deep learning inference, enabling the model to make accurate predictions based on multidimensional information. The innovation of this step lies in the dedicated multimodal coding architecture designed for the software testing domain. This architecture effectively handles the specificities of technical documents, API specifications, code, and test data, significantly improving the quality and information richness of feature representations and laying the foundation for accurately predicting expected test results.
[0043] This step is the core of multimodal feature extraction and fusion, aiming to transform different types of data into a unified feature representation that can be processed by neural networks. Feature extraction refers to the process of converting raw data into a numerical representation that better expresses the essential characteristics and inherent laws of the data; it is a crucial step in machine learning and deep learning systems. In software testing prediction scenarios, due to the involvement of multiple heterogeneous data sources, specialized feature extraction methods need to be designed for different data types. This invention employs three dedicated encoders to process data from different modalities, and then integrates these features into a unified representation through a multi-level fusion mechanism.
[0044] A text encoder is a neural network module specifically designed to process natural language text data. Its goal is to convert unstructured text into fixed-dimensional semantic vector representations. In software testing scenarios, text data includes API documentation, requirements specifications, use case descriptions, error messages, and code comments. Text encoders use pre-trained language models as their infrastructure, such as BERT (Bidirectional Encoder Representations from Transformers), RoBERTa, or the domain-adapted CodeBERT. These models are based on the Transformer architecture and capture long-distance dependencies and contextual semantics in text through a self-attention mechanism, demonstrating superior performance in various natural language processing tasks. The text encoding process comprises four key steps: text preprocessing, tokenization and encoding, semantic representation generation, and domain adaptation. The text preprocessing step cleans and standardizes the raw text, including removing HTML tags, unifying capitalization, handling special characters and technical symbols, and identifying and preserving technical text-specific elements such as code snippets, API paths, and parameter names. The tokenization and encoding step uses a model-specific tokenizer to segment the text into a sequence of tokens, handling technical terms and out-of-vocabulary words. Unlike general domains, software testing texts contain a large number of technical terms, variable names, and technical abbreviations, requiring special handling from the tokenizer. The system employs subword tokenization strategies, such as WordPiece or Byte-Pair Encoding, to decompose unknown technical terms into meaningful sub-units while preserving the integrity of common technical terms. The semantic representation generation step inputs the token sequence into a pre-trained language model to obtain context-sensitive word embeddings. The model generates a deep semantic representation for each token, capturing its precise meaning within the current technical document context. The system integrates token-level representations using various pooling strategies to obtain document-level semantic vectors, such as [CLS] token representation, average pooling, or attention-weighted pooling. The domain adaptation step enhances the model's understanding of technical documents through fine-tuning on software testing domain data. The fine-tuning process utilizes parallel data within the domain, such as API documentation and corresponding test cases, error descriptions and solutions, and designs multi-objective learning tasks, including document classification, key information extraction, and semantic matching. Through these specially designed steps, the text encoder can transform technical documents into high-quality semantic vectors, typically with dimensions of 768 or 1024, effectively capturing key information such as API function descriptions, parameter constraints, and error handling logic.
[0045] A structured data encoder is specifically designed to handle structured data with well-defined field definitions and type constraints, such as API parameters, system configurations, test inputs, and environment variables. The goal of a structured data encoder is to capture the inherent characteristics of data items and the relationships between them, generating a feature representation that comprehensively reflects the data structure and content. Structured data is characterized by high organization but also strong heterogeneity; different fields may have different data types, value ranges, and semantic meanings. To address this, the encoder employs a multi-branch heterogeneous neural network architecture, combining the advantages of feature transformation networks and graph neural networks (GNNs). The structured data encoding process includes five key steps: schema analysis, type-specific encoding, feature transformation, relationship modeling, and representation aggregation. The schema analysis step examines the schema definition of the structured data, identifying field types, constraints, and nested structures. The system constructs a field metadata dictionary, recording information such as the name, path, data type, optionality, and value range of each field as a reference for subsequent encoding. The type-specialized encoding step applies specific initial encoding methods to different data types: numeric fields are standardized and binned to convert them into floating-point vectors; categorical fields are converted into semantic vectors through one-hot encoding or embedding representation; string fields combine bag-of-words model, n-gram features, and semantic encoding to capture their textual characteristics; Boolean fields are directly mapped to binary values; date and time fields are decomposed into multiple time component features, such as year, month, day, day of the week, and whether it is a holiday; complex structures (such as JSON objects and arrays) are processed through recursive decomposition to preserve their hierarchical relationships. The feature transformation step uses a multi-layer perceptron (MLP) network to perform non-linear transformations on the initial representation of each field, enhancing its expressive power. The system configures specialized transformation networks for different types of fields, such as a scaling network for numeric fields and an embedding network for categorical fields. Each network contains multiple fully connected layers and non-linear activation functions, mapping the original features to a high-dimensional semantic space. The relationship modeling step uses graph neural networks to capture the dependencies and interaction patterns between fields. The system constructs a field relationship graph, where nodes represent fields and edges represent relationships between fields, such as parameter dependencies, configuration item influences, and conditional constraints. These relationships are identified through prior knowledge (such as API specifications) and data analysis (such as correlation analysis and frequent pattern mining). The constructed relationship graph is input into a graph neural network, which updates the node representations through multiple rounds of message passing, enabling each field's features to incorporate information from its related fields. A representation aggregation step integrates the enhanced features of each field into a unified structured data representation.The system employs a hierarchical attention mechanism, dynamically adjusting the importance weights of different fields and field groups based on the characteristics of the current testing task to generate the final structured data feature vector, typically with dimensions of 512 or 768. Through this specially designed encoding architecture, the structured data encoder can effectively handle complex and varied parameter combinations and configuration items in software testing, providing key input features for predicting expected test results.
[0046] A temporal feature encoder is specifically designed to process data with time-series characteristics, such as API call sequences, system state changes, performance metric curves, and error log sequences. Time-series data reflects the dynamic behavior of a system over time and is crucial for predicting system response patterns under specific conditions. The goal of a temporal feature encoder is to capture the temporal dependencies, periodic patterns, trends, and anomalous changes in the data, generating a comprehensive feature representation that reflects the temporal dynamics. Addressing the characteristics of time-series data in software testing—variable lengths, sparse and variable characteristics, and the coexistence of multi-scale features—the encoder employs a hybrid temporal model architecture, combining the advantages of Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Temporal Convolutional Network (TCN). The temporal feature encoding process includes four key steps: temporal preprocessing, multi-scale feature extraction, sequence representation learning, and feature integration. The time-series preprocessing step cleans and standardizes the raw time-series data, including missing value imputation (through linear interpolation, forward imputation, or advanced methods based on similar patterns), outlier detection and handling (through moving average, median filtering, or statistical anomaly detection methods), time alignment (adjusting time-series data with different sampling rates to a uniform time scale), and time window segmentation (segmenting long sequences into fixed-size or variable-size time windows). The multi-scale feature extraction step uses a multi-branch convolutional network to capture patterns at different time scales. The system designs multiple parallel one-dimensional convolutional branches, each using convolutional kernels of different sizes (e.g., 3, 5, 7, 11, etc.) to extract short-term local patterns, medium-term trends, and long-term periodic features, respectively. Each convolutional branch contains multiple layers of convolution, batch normalization, and activation functions, forming a deep feature extraction channel. This multi-scale architecture is particularly suitable for software testing scenarios, capable of simultaneously capturing instantaneous system responses (e.g., API response time fluctuations) and long-term behavioral patterns (e.g., performance degradation trends under system load). The sequence representation learning step uses a recurrent neural network to capture long-range dependencies and state evolution patterns in the time-series data. The system employs bidirectional LSTM or GRU networks, considering both past and future contexts to gain a more comprehensive understanding of behavioral characteristics at the current time point. Recurrent network layers process the output of multi-scale convolutional features, further fusing information from different time scales to learn complex temporal dependencies, such as system state transition sequences, error triggering conditions, and performance fluctuation patterns. The feature integration step transforms temporal features of varying lengths into fixed-dimensional representation vectors.The system employs an attention pooling mechanism to calculate the importance weight of each time point in the sequence, focusing on key moments relevant to the current testing task, such as the system state before an error occurs and resource usage during performance bottlenecks. Through attention-weighted aggregation, the system generates a fixed-dimensional temporal feature vector, typically with 512 dimensions, comprehensively reflecting the key dynamic characteristics of the temporal data. This specially designed temporal coding architecture effectively handles diverse temporal data in software testing, providing crucial information for predicting the system's response behavior under specific conditions.
[0047] After feature extraction from each modality, the system performs feature fusion, integrating feature vectors from different encoders into a unified representation. Feature fusion is a core challenge in multimodal learning, requiring solutions to the heterogeneity, complementarity, and correlation of features from different modalities. This invention designs a multi-level progressive fusion architecture, gradually integrating information from different modalities through multiple fusion layers, balancing the preservation of modal characteristics with the promotion of modal interaction. The feature fusion process comprises three key layers: a feature alignment layer, an interaction enhancement layer, and an adaptive integration layer. The feature alignment layer maps modal features of different dimensions and distributions to a shared feature space through linear projection and normalization operations. The system designs a dedicated projection network for each modality, including fully connected layers, batch normalization, and activation functions, converting the original feature vectors into aligned features of a unified dimension (typically 768). The alignment process also includes feature normalization, adjusting the feature distribution through L2 normalization or layer normalization to reduce statistical differences between modalities and create conditions for subsequent fusion. The interaction enhancement layer achieves information exchange and complementarity between features from different modalities through an attention mechanism. The system designs a bidirectional cross-modal attention module, allowing each modality to selectively focus on relevant information from other modalities. For example, API parameter descriptions in the text modality can focus on actual parameter values in the structured modality, while performance fluctuations in the time-series modality can focus on system constraint descriptions in the text modality. This attention mechanism generates attention weights by calculating the correlation matrix between modalities, and then weighted aggregates the features of the target modality to form an interaction-enhanced representation. Through multiple rounds of interaction, information from different modalities is fully exchanged and complemented, generating a more comprehensive feature representation. The adaptive ensemble layer dynamically adjusts the importance weights of different modalities according to the characteristics of the current test task, generating the final fused features. The system designs a meta-learning-based adaptive weighting network, which predicts the relevance and reliability of each modality in the current scenario based on the features of the test input and historical patterns. The weighted network considers multiple factors, such as data integrity (some modalities may be missing), data quality (signal-to-noise ratio of different modalities), and task relevance (different test tasks may depend on different modalities). Through weighted fusion or attention hybridization, the system generates the final feature vector, which comprehensively reflects the core information of the multimodal data.
[0048] Through the aforementioned feature extraction and fusion processes, the system ultimately generates a Feature Vector Collection, where each vector represents a comprehensive feature representation of a test scenario, encompassing integrated information on textual semantics, structured parameters, and temporal behavior. These high-quality feature vectors provide ideal input for subsequent deep learning inference and form the foundation for accurately predicting expected test results. The typical dimension of the feature vector collection is 1024 or 2048, effectively supporting the modeling and prediction of various complex test scenarios. The technical innovation of this step lies in its dedicated multimodal coding architecture designed for the software testing domain. It specifically considers the unique characteristics of technical documents, API parameters, and system behavior, achieving efficient extraction and fusion of test-related information, significantly improving the accuracy and reliability of predicting expected test results.
[0049] Implementing this step significantly improves the level of software testing automation, enabling the system to fully understand test inputs and context, and accurately predict expected system responses. Compared to traditional rule-based or simple machine learning methods, this deep multimodal feature extraction and fusion method can handle more complex test scenarios and API behaviors, making it particularly suitable for the automated testing needs of modern software systems.
[0050] Step S2.1: Input the text portion of the multimodal dataset into the pre-trained BERT model to extract semantic features and generate semantic vector representations.
[0051] This sub-step processes text data from multimodal datasets, such as API descriptions, error messages, and annotations. BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained natural language processing model capable of generating rich semantic representations through bidirectional context learning. The core of BERT is the encoder part of the Transformer architecture, which captures long-distance dependencies and contextual information in text through self-attention and positional encoding. In this system, the text data is first preprocessed, including word segmentation, adding special tags ([CLS] and [SEP]), and constructing a word index; then, the processed text sequence is input into the pre-trained BERT model; finally, specific layer outputs of BERT are extracted as semantic representations of the text. To adapt to the specific terminology and expressions in the software testing field, the system uses a BERT model fine-tuned on a technical documentation corpus, enabling it to better understand the technical terms in API documents and technical specifications. The output semantic vector has a dimension of 384, comprehensively capturing the semantic information of the text, including key content such as functional descriptions, parameter meanings, and business rules.
[0052] Step S2.2: Construct a graph structure based on the structured data portion of the multimodal dataset, and model the graph structure using the message passing mechanism of a graph neural network to generate structural feature vectors.
[0053] This sub-step processes structured data in multimodal datasets, such as JSON schemas, database table structures, and object relationships. Graph Neural Networks (GNNs) are a class of neural network models specifically designed for processing graph-structured data, capable of learning node and edge representations through message passing between nodes. In this system, the structured data is first constructed as a graph structure, where nodes represent data entities (such as API parameters and database fields), and edges represent relationships between entities (such as containment and reference relationships). Then, graph neural networks are applied for modeling, employing a combined architecture of Graph Convolutional Networks (GCNs) and Graph Attention Networks (GATs). GCNs update the representation of the current node by aggregating information from neighboring nodes, while GATs introduce an attention mechanism, performing weighted aggregation based on the importance of neighboring nodes. This message passing mechanism allows information to flow within the graph, ensuring that each node's representation includes not only its own information but also its contextual information within the overall structure. After processing by multiple layers of graph neural networks, the system extracts the node embeddings and performs pooling operations to generate a 256-dimensional structural feature vector. This vector encodes the data's structural characteristics, relational constraints, and domain rules, providing a structured knowledge representation for subsequent tasks.
[0054] Step S2.3: Input the time-series data portion of the multimodal dataset into a bidirectional LSTM network for processing to generate a time-series feature vector.
[0055] This sub-step processes time-series data from multimodal datasets, such as API call sequences, state transitions, and log event streams. Long Short-Term Memory (LSTM) networks are a special type of recurrent neural network designed to address the long-term dependency problem in traditional RNNs. By introducing gating mechanisms (input gate, forget gate, and output gate) to control information flow, they can effectively learn patterns in long sequences. Bidirectional LSTM (Bi-LSTM) further extends the capabilities of LSTM by simultaneously processing sequences from both forward and backward directions, capturing more comprehensive contextual information. In this system, the time-series data is first converted into symbol sequences, such as representing API call sequences as opcode sequences or log event streams as event type sequences. Then, these symbols are mapped into dense vectors through embedding layers. These vector sequences are then simultaneously input into both the forward and backward LSTMs for processing. Finally, the final hidden states from both directions are connected to form a 512-dimensional time-series feature vector. This bidirectional processing approach enables the system to consider both past and future contextual information, better understand dependencies and patterns in time-series data, such as capturing the dependency order between API calls or the transition patterns of system states, providing important time-series information for predicting test results.
[0056] Step S2.4: Based on the semantic vector representation, the structural feature vector, and the temporal feature vector, feature fusion is performed through linear projection and attention mechanism to generate the feature vector set.
[0057] This sub-step fuses the different modal feature vectors generated in the first three sub-steps to form a unified feature representation. Feature fusion is a key step in multimodal learning, aiming to effectively integrate information from different sources to obtain a more comprehensive data representation. Linear projection refers to mapping vectors of different dimensions to a feature space of the same dimension through linear transformation (matrix multiplication), allowing them to be directly compared and combined. Attention mechanism is a technique that allows the model to focus on the most relevant parts of the input data, and can dynamically adjust the importance weights of different modal features during the fusion process. In this system, firstly, the three feature vectors are linearly projected to map them to the same dimensional space; then, the weights of each modality are calculated through the attention mechanism, and these weights are dynamically adjusted based on the characteristics of the current test scenario; next, the projected feature vectors are weighted and summed according to these weights; finally, the fusion result is batch normalized to ensure the stability of the feature distribution. This fusion method can adaptively adjust the importance of each modality feature according to the needs of different test scenarios. For example, it focuses more on structural features when validating data structures and more on temporal features when checking state transitions, thereby generating the feature vector set most suitable for the current task, providing comprehensive and targeted input for subsequent deep learning inference.
[0058] In this embodiment, the feature fusion process based on semantic vector representation, structural feature vector, and temporal feature vector employs a more complex and efficient optimization method. This method not only captures the linear relationships between different features but also models their nonlinear interactions. This method includes the following detailed steps:
[0059] First, a feature space transformation is performed on the semantic vector representation, structural feature vector, and temporal feature vector to construct a second-order polynomial basis to capture the nonlinear interactions between features, generating a polynomial feature space. A second-order polynomial basis refers to a method of expanding the original feature space by calculating the quadratic and cross terms of the original features. Specifically, for elements from feature vectors of different modalities, the system considers not only their original values but also their squared values and pairwise products. For example, if the text feature vector contains element x and the structural feature vector contains element y, then the polynomial feature space will contain features such as x, y, x², y², and xy. This transformation significantly expands the expressive power of the feature space, enabling the model to capture more complex nonlinear patterns and interactions between features, especially deep connections that may exist between features of different modalities. In this way, the system can identify complex patterns such as "test results often exhibit certain characteristics when API documents contain specific terms and database schemas have a specific structure."
[0060] Next, based on the polynomial feature space, the system constructs a Scalable Diagonally Dominant Sum of Squares (SDSOS) constraint structure to model the feature fusion process as an optimization problem with a polynomial objective function and constraints, and generates a corresponding constrained optimization problem based on this problem. SDSOS is a special polynomial structure that approximates the traditional semidefinite programming problem into a more computationally efficient form. In the context of feature fusion, the system formalizes the fusion process as an optimization problem: the objective is to minimize the distance between the fused features and the ideal representation, while satisfying specific structural constraints (such as sparsity and smoothness). SDSOS constraints ensure that the optimization problem has good mathematical properties, maintaining both high expressiveness and efficient solvability. By constructing the feature fusion matrix W and imposing SDSOS constraints on it, the system represents the optimization problem as a series of scalable quadratic forms. This structure makes the problem more suitable for subsequent efficient solution algorithms.
[0061] The system then transforms the constrained optimization problem into a Second-Order Cone Programming (SOCP) problem and solves it using a SOCP solver, generating the programming solution. SOCP is a special type of convex optimization problem whose constraints contain second-order cones (a special type of convex set). SOCP problems can be solved efficiently using specialized solvers, exhibiting good theoretical properties and practical performance. The system transforms the original optimization problem into a standard form of SOCP by decomposing the SDSOS constraints into the intersection of a series of second-order cone constraints. The system then uses a specialized SOCP solver (such as MOSEK or ECOS) to solve this type of problem. Compared to traditional semidefinite programming (SDP), SOCP is more computationally efficient when dealing with large-scale problems, making it particularly suitable for high-dimensional feature fusion tasks. The system also introduces a relaxation accuracy control mechanism, adjusting the relaxation parameters to balance computational efficiency and optimization accuracy, ensuring efficient computation while maintaining good performance.
[0062] Based on the planning solution results, the system calculates the optimal feature fusion weights and maps them back to the original problem space to extract the fusion matrix coefficients, generating a dynamic weight allocation scheme. This process includes several sub-steps: First, based on the planning solution results, the system extracts the coefficient vector of the fusion matrix and converts it into weight components for three feature modalities (text, structure, and time series), generating a preliminary weight allocation. These coefficients directly reflect the importance of each feature in the optimal fusion strategy. Next, the preliminary weight allocation is sparsified to generate a sparse weight allocation. Sparsification means setting small values close to zero in the weight vector to zero, retaining the truly important weights, which reduces computational complexity and improves the interpretability of the model. Then, the sparse weight allocation is normalized to generate a normalized weight allocation. Normalization ensures that the sum of all weights is 1, making the weight allocations in different scenarios comparable. Finally, the normalized weight allocation is adaptively adjusted, dynamically correcting the weight ratios according to the characteristics of different test scenarios, calculating the scenario relevance score and adjusting the weight bias to generate the target allocation weights. This adaptive adjustment mechanism enables the system to adjust the fusion strategy according to the specific needs of the current test task. For example, it can increase the weight of structural features when verifying data structures and increase the weight of text features when checking error messages. Based on the target weight allocation, the system ultimately determines a dynamic weight allocation scheme, achieving feature fusion optimization for different test scenarios.
[0063] Finally, based on a dynamic weight allocation scheme, the system fuses semantic vector representations, structural feature vectors, and temporal feature vectors to obtain preliminary fused features. These preliminary fused features are then subjected to uncertainty estimation and batch normalization to generate the final feature vector set. Specifically, the system weights the three feature vectors according to the optimized weights to generate the preliminary fusion result. Uncertainty estimation is a technique for evaluating the reliability of the fusion result. By calculating the variance or confidence interval of the fused features, it identifies potentially unstable fusion regions. For these regions, the system may apply additional processing strategies, such as increasing the regularization strength or adjusting the weight distribution. Batch normalization is a commonly used neural network training technique. By calculating the mean and variance of each batch of data, and then standardizing and scaling, the feature distribution becomes more stable, which is beneficial for subsequent model processing. Through these steps, the system ultimately generates a high-quality unified feature vector set, providing a comprehensive feature representation that considers both linear relationships and captures nonlinear interactions for subsequent deep learning inference.
[0064] Compared to simple linear combination or attention mechanisms, this feature fusion method based on optimization theory has a more solid mathematical foundation and stronger expressive power. It not only effectively captures the complex relationships between features of different modalities but also provides theoretical performance guarantees and better interpretability. Especially when dealing with complex tasks such as software testing that require comprehensive consideration of multiple factors, this method can automatically discover and utilize the inherent connections between different types of data, improving the accuracy and reliability of prediction results.
[0065] Step S3: Perform deep learning inference on the feature vector set, and generate multi-dimensional prediction results through multi-head self-attention mechanism and cross-modal attention fusion. The multi-dimensional prediction results include prediction data structure, anomalies and confidence scores.
[0066] This step utilizes an advanced deep learning architecture to perform deep inference on the feature vector set generated in step S2, generating a multi-dimensional prediction of the expected test results. Deep learning inference is the process of using a trained neural network model to perform forward computation on the input data and generate a prediction result. To address the complexity of predicting expected test results, this invention designs a special neural network architecture, with core components including a multi-head self-attention mechanism and cross-modal attention fusion. The multi-head self-attention mechanism is a core component of the Transformer architecture, effectively capturing long-distance dependencies and complex interaction patterns in sequence data. In this invention, multi-head self-attention is used to deeply understand feature associations within the same modality. The basic principle of self-attention is to calculate the attention score of each element in the sequence with all elements (including itself), thereby determining the strength of the association between elements. "Multi-head" refers to simultaneously learning multiple different attention patterns, with each "head" focusing on different types of associations, such as syntactic relations, semantic similarity, or functional dependencies. In software testing scenarios, multi-head self-attention can capture key information such as "dependencies between API parameters", "correspondence between error conditions and abnormal responses", and "condition-result patterns of business rules". The model applies multi-head self-attention processing to the feature vectors of each modality, enhancing the information interaction and representation capabilities within the modality.
[0067] Cross-modal attention fusion is a technique specifically designed to integrate information from different data modalities. Unlike simple vector concatenation or weighted averaging, cross-modal attention allows features from one modality to selectively focus on relevant information from another modality. Its core principle is to calculate the attention score between each element in the source modality and all elements in the target modality, and then aggregate information from the target modality based on these weighted scores. For example, when predicting API response structure, the field definitions in the text modality (such as API documentation descriptions) will focus more on parameter types and constraints in the structured modality; while when predicting anomalies, the error handling descriptions in the text modality will focus more on historical error patterns in the temporal modality. Cross-modal attention enables deep information interaction and complementarity between modalities, allowing the model to obtain the knowledge needed for prediction from the most relevant information sources.
[0068] The inference process employs an encoder-decoder architecture, comprising four main stages: feature enhancement, modal interaction, structural prediction, and uncertainty estimation. The feature enhancement stage processes the fused feature vectors through multi-layer Transformer encoder blocks, each containing multi-head self-attention layers and feedforward neural network layers, enhancing the representational power of the features. The modal interaction stage achieves information exchange and complementarity between different modalities through a multi-round cross-modal attention mechanism, enabling the model to dynamically select and integrate the most relevant information based on the current prediction task. The structural prediction stage uses a specially designed decoder network to generate multi-dimensional prediction results, including predicted data structure, anomalies, and confidence scores. The decoder adopts an autoregressive generation mode, progressively constructing the output structure, capable of handling response formats of varying complexity and nesting levels. The uncertainty estimation stage quantifies the model's confidence in the prediction results using techniques such as Monte Carlo dropout or deep ensemble learning, generating fine-grained confidence scores.
[0069] Multi-dimensional prediction results are comprehensive predictions output by the model, encompassing three core dimensions: predicted data structure, exceptions, and confidence scores. Predicted data structure predicts the normal response structure of the API, including field names, data types, nesting relationships, and example values. Based on learned API patterns and domain knowledge, the model generates response structures that conform to the API design style and business logic. For complex APIs, the model can predict multi-level nested JSON or XML structures and correctly handle arrays, objects, and primitive types. Exception scenarios include possible error codes, error messages, and triggering conditions, covering various exceptions such as input validation errors, business rule violations, and resource limitations. The model predicts various exceptions that may be encountered in the current test scenario by analyzing historical error patterns, error handling instructions in the API documentation, and exception handling logic in the code implementation. Confidence scores provide fine-grained reliability assessments for each part of the prediction results, enabling test engineers to judge the credibility of the predictions. The confidence score, generated using techniques such as Bayesian neural networks, deep ensembles, or Monte Carlo dropout, reflects the model's level of confidence in its predictions. A high confidence score indicates that the model has sufficient evidence to support the prediction, while a low confidence score indicates that the prediction may have uncertainty and requires human review.
[0070] Through this deep learning inference process, the system can generate high-quality, multi-dimensional test result predictions based on multimodal data and complex feature interactions. These predictions not only include normal response structures and anomalous situations but also provide fine-grained confidence assessments, offering a comprehensive information foundation for subsequent verification and conflict resolution. The innovation of this step lies in applying advanced multi-head self-attention and cross-modal attention techniques to the field of software testing, achieving accurate modeling and prediction of complex API behavior, and significantly improving the accuracy and comprehensiveness of generated test result predictions.
[0071] Step S3.1: Apply a multi-head self-attention mechanism to the feature vector set to project each feature vector onto the query, key, and value space to obtain several projection results, and obtain a context-aware feature representation by calculating the attention score of each projection result.
[0072] This sub-step employs a multi-head self-attention mechanism to process the feature vector set, enabling the model to focus on complex relationships between different features. Multi-head self-attention is a core component of the Transformer architecture, capturing different types of relationships in the input data by executing multiple independent attention computations in parallel. The basic principle of the self-attention mechanism is to allow each position in the sequence to attend to all positions in the sequence and compute a similarity-based weighted representation. In this system, the feature vector set is first projected onto multiple query, key, and value spaces through a linear transformation. The query vector represents the information that needs attention, the key vector is used to calculate the similarity with the query vector, and the value vector contains the actual content information. The system executes eight attention heads in parallel, each using a different projection matrix to generate 64-dimensional query, key, and value vectors. Then, for each attention head, the dot product of the query vector and all key vectors is calculated, and after scaling and softmax normalization, attention weight scores are obtained. These scores represent the relevance strength of each feature to other features. Finally, these weights are used to weight and sum the value vectors to generate a weighted feature representation. Finally, the outputs of all attention heads are concatenated and projected back to the original dimension through a linear layer to form a context-aware feature representation. This mechanism enables the system to consider multiple feature relationship patterns simultaneously, such as capturing the dependencies between API parameters and return values, or identifying implicit mapping rules between test inputs and expected outputs, thereby generating feature representations with rich contextual information.
[0073] Step S3.2: Perform cross-modal attention fusion on the feature representation to establish semantic associations among text modal features, structural modal features and temporal modal features, and obtain fused feature representations.
[0074] This sub-step integrates feature representations from different modalities through a cross-modal attention mechanism, constructing a semantic bridge between them. Cross-modal attention is an attention mechanism specifically designed for processing multimodal data. It allows features from one modality to focus on features from another modality, thereby establishing semantic correspondences between different modalities. Unlike self-attention, cross-modal attention queries and key-value pairs come from different modalities. In this system, the feature representations obtained in the previous step are first decomposed into three parts according to their modal origin: text features, structural features, and temporal features. Then, the system performs three rounds of cross-modal attention computation: text-structure, text-temporal, and structure-temporal. Each round uses features from one modality as the query and features from another modality as the key and value. Specifically, the system first uses text features as the query and structural features as the key and value to compute a text-guided structural feature representation; then it uses text features as the query and temporal features as the key and value to compute a text-guided temporal feature representation; finally, it uses structural features as the query and temporal features as the key and value to compute a structure-guided temporal feature representation. These cross-modal feature representations are fused with the original features through a gating mechanism to generate a comprehensive fused feature representation. The gating mechanism uses a learnable parameter to control the mixing ratio of the original features and cross-modal features, enabling the system to flexibly adjust the importance of different features according to the needs of the current task. Through this cross-modal attention fusion, the system can establish complex semantic relationships, such as the correspondence between "a parameter description in the API documentation and a specific field in the database table" or "the association between error patterns in the system log and exception handling instructions in the API specification," providing more comprehensive information support for subsequent prediction tasks.
[0075] Step S3.3: The fused feature representation is subjected to a nonlinear transformation through a multi-layer feedforward neural network to generate a target feature vector.
[0076] This sub-step uses a multi-layer feedforward neural network to perform deep nonlinear transformations on the fused features, extracting more abstract, high-level features. A feedforward neural network (FFN) is a basic neural network structure composed of multiple fully connected layers, each containing linear transformations and nonlinear activation functions, capable of extracting and transforming features layer by layer. In this system, a four-layer deep feedforward network architecture is adopted, with each layer using a different number of neurons (1024-512-256-128), forming a progressive feature extraction structure. Specifically, the system first performs Layer Normalization on the fused feature representation to stabilize the feature distribution; then, the normalized features are input into the first fully connected layer, which has 1024 neurons and uses the GELU (Gaussian Error Linear Unit) activation function to provide nonlinear transformation capabilities. GELU is a smooth activation function that provides better gradient fluidity compared to the traditional ReLU. Next, the system introduces a residual connection, adding the original input to the output of the first layer to alleviate the gradient vanishing problem in deep network training. The system repeats a similar process, using a second (512 neurons), a third (256 neurons), and a fourth (128 neurons) layer. Each layer includes Layer Normalization, fully connected transformation, GELU activation, and residual connections. After the final layer, the system applies Dropout (probability 0.1) for regularization to prevent overfitting and uses a linear projection layer to adjust the feature dimensions to the final target dimension (typically 256), generating the target feature vector. This multi-layered nonlinear transformation enables the system to learn more complex feature representations, capturing deep patterns and regularities in the data, such as identifying complex functional relationships between input parameters and expected outputs, or understanding the implicit rules of system state transitions, providing highly abstract feature representations for the final prediction task.
[0077] Step S3.4: Based on the target feature vector, predict the data structure of the normal response, the abnormal situation and error code, and the confidence score of the prediction result through the three parallel branches of the gated prediction head to generate the multidimensional prediction result.
[0078] This sub-step employs a multi-task learning framework, generating comprehensive prediction results across multiple dimensions through a specially designed gated prediction head. A gated prediction head is a neural network structure used for multi-task learning. It controls the flow of information between different prediction tasks through a gating mechanism, enabling the model to dynamically adjust the importance of each task based on the properties of the input features. In this system, the prediction head contains three parallel branches, each responsible for different aspects of prediction. The first branch is a data structure predictor, responsible for predicting the data structure of a normal response. This branch first determines whether to activate the prediction task through a gating unit, which calculates an activation probability between 0 and 1 based on the target feature vector. Then, if activated, the system uses a sub-network with two hidden layers (256 and 128 neurons) to generate the data structure prediction. The output may be a JSON structure description, a list of object attributes, or a field type mapping. The second branch is an anomaly predictor, focusing on predicting possible anomalies and error codes. This branch also uses a gating mechanism and includes a dedicated sub-network with a hybrid architecture, combining a classification head (predicting error types) and a generation head (generating detailed error descriptions). The third branch is the confidence evaluator, used to assess the reliability of the prediction results. This branch does not use gating mechanisms (it is always active) and calculates a confidence score for each prediction result through a simple sub-network. The score ranges from 0 to 1, representing the model's confidence in the prediction. The outputs of all three branches together constitute the multi-dimensional prediction results, providing comprehensive information on expected test results. This multi-branch architecture enables the system to handle predictions for both normal and abnormal situations simultaneously. For example, it can predict both the normal return structure of API calls and possible error conditions and error codes, while also providing reliability assessments to help testers judge the credibility of the prediction results, thereby generating more comprehensive and practical expected test results.
[0079] In one embodiment, a more advanced optimization method is employed for the nonlinear transformation of the fused feature representation using a multi-layer feedforward neural network. This method enhances the network's performance and generalization ability through special derivative approximation and multi-level regularization strategies. The method comprises the following detailed steps:
[0080] First, feature normalization is performed on the fused feature representation to generate a preprocessed standard feature representation. Feature normalization is a data preprocessing technique aimed at adjusting features at different scales to a similar numerical range, making model training more stable and efficient. In this system, an improved Layer Normalization technique is employed. Unlike traditional batch normalization, it does not rely on batch statistics but normalizes the features of each sample independently. Specifically, the system first calculates the mean and standard deviation of each feature vector, and then uses these statistics to normalize the feature vectors to zero mean and unit variance. Next, two learnable parameters (scaling factor γ and shift factor β) are introduced to linearly transform the normalized features, allowing the model to learn the feature distribution best suited for subsequent layers. This feature normalization method effectively reduces the internal covariate shift problem, making the training of deep networks more stable while maintaining the independence of the feature distribution of each sample, making it particularly suitable for handling sequential data and cases with variable feature lengths.
[0081] Next, based on standard feature representation, the system constructs a secant derivative approximation function. For each weight parameter, it takes two similar points: the current weight and the weight after a small perturbation. The rate of change of the secant derivative approximation function between these two similar points is then calculated as the derivative approximation, generating the derivative approximation result. The secant derivative approximation is a numerical differentiation technique that estimates the derivative by calculating the average rate of change of the function between two close points, avoiding the complexity of calculating the exact derivative. In traditional deep learning, the backpropagation algorithm calculates gradients through automatic differentiation. However, in some complex network structures or non-smooth activation function scenarios, the exact derivative may be difficult to obtain or computationally expensive. The secant method provides a practical alternative, especially when the network contains non-differentiable operations or gradient calculations are unstable. In this system, for each weight parameter w, a small perturbation ε (typically on the order of 10^-5) is added to obtain w+ε. Then, the network output is calculated for both weight values, and the derivative is approximated by comparing the output difference and dividing by ε. While this method has a slightly higher computational cost, it provides more stable gradient estimation and reduces gradient explosion or vanishing problems during training, making it particularly suitable for deep networks with complex nonlinear transformations.
[0082] Then, based on the derivative approximation results, the system applies multi-scale regularization constraints to generate regularization constraint results. Multi-scale regularization is a comprehensive regularization strategy that simultaneously applies constraints at three different levels: parameters, layers, and the global network, balancing the model's complexity and expressive power. The system applies L1 and L2 regularization to each weight parameter in the multi-layer feedforward neural network, controlling the parameter size by calculating the sum of the absolute values and the sum of squares of the parameters, generating parameter-level regularization. L1 regularization (also known as L1 regularization) adds the sum of the absolute values of the weights as a penalty term, prompting the model to learn a sparse weight distribution and automatically perform feature selection; L2 regularization (also known as L2 regularization or weight decay) adds the sum of squares of the weights as a penalty term, preventing excessively large weight values and improving the model's generalization ability. Next, the system applies norm constraints to the output features of each layer of the multi-layer feedforward neural network, calculates the L2 norm of the feature vector, and sets an upper bound threshold to generate layer-level regularization. This constraint ensures that the activation output amplitude of each layer is within a reasonable range, preventing activation value explosion and maintaining the stability of the information flow. The system also dynamically adjusts the regularization strength based on the overall network complexity and data distribution characteristics, generating global regularization. Global regularization considers the structural characteristics of the entire network and the current data distribution, dynamically adjusting the overall regularization strength based on factors such as network depth, width, total number of parameters, and the variance and complexity of the training data. Finally, based on parameter-level regularization, layer-level regularization, and global regularization, the system adaptively adjusts the regularization coefficients of each layer through a validation set performance feedback mechanism, generating the final regularization constraint result. This adaptive mechanism evaluates the validation set performance at regular intervals during training, increasing or decreasing the regularization strength of each layer according to the performance trend, ensuring that regularization effectively controls overfitting without excessively limiting the model's learning ability.
[0083] Next, based on the derivative approximation results and regularization constraints, the system performs parameter updates based on global rate optimization to generate optimized network parameters. Global rate optimization is a parameter update strategy that considers the overall convergence speed. Unlike traditional local gradient descent methods, it focuses on the global convergence properties of the entire network parameter space. In traditional optimization algorithms, each parameter is updated independently based on local gradients, which may lead to inconsistent update speeds in different layers or regions, affecting overall convergence efficiency. Global rate optimization ensures that the network as a whole converges efficiently in the optimal direction by coordinating the update step sizes of different parameters. Specifically, the system first calculates the update direction of each parameter based on the derivative approximation results; then it considers the correction of the update direction by regularization constraints; next, it calculates the global optimization rate, which is dynamically adjusted based on the loss change trend, parameter change magnitude, and validation performance changes in recent iterations; finally, it applies an adaptive learning rate strategy, using different learning rates for different layers and different types of parameters to ensure that key parameters are fully learned while minor parameters do not excessively affect overall performance. This globally coordinated parameter update strategy significantly improves training efficiency and final model performance, and is particularly suitable for handling deep neural networks with complex structures and multi-layered features.
[0084] Finally, based on the optimized network parameters, the system performs a nonlinear transformation on the fused feature representation and applies hierarchical residual connections and feature selection mechanisms to generate a regularized target feature vector. Hierarchical residual connections are an extension of traditional residual connections, establishing not only short-circuit connections between adjacent layers but also cross-layer connections between layers of different scales. Traditional residual connections alleviate the vanishing gradient problem and promote deep information flow by directly adding the input to the layer output; while hierarchical residual connections further introduce multi-scale information fusion, for example, connecting the first layer output to both the second and fourth layers simultaneously, enabling the network to learn and utilize feature representations at different levels of abstraction. The feature selection mechanism is a technique for dynamically determining important features by learning feature importance weights to automatically filter and strengthen key features. In this system, feature selection is implemented through gating units, each learning a weight between 0 and 1 to control the proportion of corresponding features that pass through. These gating units adaptively adjust based on the needs of the current task, allowing the model to focus on the most relevant feature dimensions. By combining nonlinear transformation, hierarchical residual connection, and feature selection mechanisms, the system generates high-quality target feature vectors. These feature vectors not only retain the key information of the original data but also undergo deep abstraction and optimization, providing a strong feature representation foundation for subsequent prediction tasks.
[0085] This neural network optimization method based on derivative approximation and multi-scale regularization offers several advantages over traditional methods: a more stable training process, stronger generalization ability, better feature extraction capability, and higher computational efficiency. Especially when dealing with high-dimensional complex features and limited training data, this method effectively prevents overfitting, extracts truly meaningful feature patterns, and provides reliable feature representations for predicting expected software testing results.
[0086] Step S4: Perform dynamic verification and conflict resolution on the multidimensional prediction results to generate expected test results that conform to system constraints and business logic.
[0087] This step systematically verifies and optimizes the multidimensional prediction results generated in step S3, ensuring that the final test results meet the system's technical constraints and business logic requirements. Dynamic validation and conflict resolution are key steps in improving the quality of prediction results. Through a series of validation rules and conflict handling strategies, inaccuracies in model predictions are corrected, and various internal inconsistencies are resolved. This step includes four main components: basic constraint validation, business rule validation, conflict detection and analysis, and intelligent conflict resolution. Basic constraint validation ensures that the prediction results meet the system's basic technical constraints, including type consistency, value range, and format specifications. The system performs type consistency checks on the predicted data structure, verifying whether the data type of each field conforms to API specifications and system definitions; it performs value range validation on numeric fields to ensure that the predicted values are within the allowed range; and it performs format validation on special format fields (such as email, URL, date and time) to ensure that they conform to standard format specifications. For prediction results that violate basic constraints, the system automatically corrects them, such as type conversion, value range truncation, and format normalization, generating preliminary validation results. Business Rule Validation checks whether the prediction results conform to the system's business logic and domain rules. The system maintains a business rule base, containing explicit rules (clearly defined business constraints) and implicit rules (patterns and associations mined from historical data). The validation process matches the preliminary validation results with the business rules to check for violations of business logic, such as dependencies between fields, conditional constraints, and state transition rules. For complex business rules, the system uses a rule engine to perform reasoning, comprehensively considering the interaction of multiple conditions and constraints. Conflict Detection and Analysis systematically identifies and quantifies various conflicts and inconsistencies in the prediction results. The system detects direct conflicts (contradictory requirements on the same field), indirect conflicts (contradictions arising through related fields), and conditional conflicts (contradictions under specific conditions) between different rules; evaluates the logical consistency between fields in the prediction results, including intra-field consistency, inter-field consistency, and global consistency; and analyzes the contextual applicability of the prediction results in the current test scenario, considering factors such as the API call environment, user roles, and system state. The system generates detailed conflict and consistency reports, including conflict markers, consistency scores, and uncertainty maps, providing a basis for subsequent conflict resolution. Intelligent Conflict Resolution, based on the conflict analysis results, systematically resolves various conflicts and inconsistencies, generating the final expected test results.The system first categorizes and prioritizes conflicts to determine the processing order. Then, it applies the most suitable resolution strategy to each conflict, including rule priority strategies, evidence weighting strategies, and historical consistency strategies. Next, it performs global consistency optimization to ensure that all local conflict solutions are consistent overall. Finally, the optimized solutions are applied to the prediction results to generate the final expected test results. This multi-strategy conflict resolution method can handle complex rule interactions and data relationships, ensuring that the generated expected test results simultaneously meet technical constraints and business requirements.
[0088] The final generated Test Expectation Results are high-quality, structured data directly usable for automated testing, comprising three core components: normal response definitions, exception case definitions, and metadata information. The normal response definitions detail the expected response structure of the API under normal conditions, including a complete list of fields, data types, nesting relationships, and example values, conforming to the API design specifications and response format. The exception case definitions contain possible error codes, error messages, and detailed error descriptions, covering various possible exceptional situations and boundary conditions. The metadata information includes prediction confidence levels, verification records, and decision-making basis, providing traceability and interpretability of the test expectation results. This information can be directly converted into test assertions and integrated into automated test scripts for efficient test verification.
[0089] Through this systematic dynamic verification and conflict resolution process, this invention effectively solves the problems of inaccuracy and inconsistency that may exist in deep learning model predictions. It ensures that the generated test expectations not only conform to the system's technical specifications but also meet business logic requirements, greatly improving the accuracy and practicality of automatically generated test expectations. The innovation of this step lies in combining rule engines and intelligent conflict resolution technology with deep learning predictions to create a hybrid intelligent system. This system fully utilizes the predictive capabilities of deep learning and the logical reasoning capabilities of rule systems to achieve the automatic generation of high-quality test expectations.
[0090] Step S4.1: Perform preliminary verification on the multidimensional prediction results. Ensure that the multidimensional prediction results meet the basic constraints through type consistency check, value range verification and format verification, and correct the prediction results that violate the basic constraints to generate preliminary verification results.
[0091] This step begins with basic verification and correction of the multidimensional prediction results generated by the model, ensuring they conform to the system's fundamental constraints. Preliminary Validation is the first quality control step in the expected result generation process, aiming to detect and correct obvious technical errors, laying the foundation for subsequent verification of more complex business rules. This process includes three core verification dimensions: type consistency check, value range verification, and format validation. First, the type consistency check verifies whether the data type of each field in the prediction result conforms to the API specification and system definition. The system maintains a comprehensive API metadata database, recording the fields expected to be returned by each API endpoint and their data type definitions. During verification, the system compares each field in the prediction result with the type definitions in the metadata database, identifying type mismatches. For example, if a field that should be an integer is predicted as a string, or a field that should be a date / time is predicted as a regular number, the system will mark it as a type inconsistency. For detected type errors, the system attempts to perform Smart Type Conversion to convert the value to the correct data type, such as converting the numeric string "123" to the number 123, or converting an ISO-formatted date string to a date object. When conversion is not feasible (e.g., converting a non-numeric string to a number), the system replaces it with the field's default value or a typical value from historical samples. Next, Value Range Validation checks whether numeric, enumerated, and composite values in the prediction results are within the allowed range. For numeric fields, the system validates that they are between predefined minimum and maximum values (e.g., age cannot be negative, percentage cannot exceed 100); for enumerated fields, it validates that they are one of the predefined valid options (e.g., status fields can only be "pending," "approved," or "rejected"); for composite values (e.g., latitude and longitude coordinates), it validates that their component values are within the valid range and maintain the correct interrelationships. When an out-of-range value is detected, the system adjusts it to the nearest valid boundary value or replaces it with the field's default value. Finally, format validation verifies that various special format fields conform to their structural specifications. This includes checking whether special format fields such as email addresses, phone numbers, postal codes, credit card numbers, URLs, and UUIDs follow their standard format specifications. The system uses regular expressions and a dedicated format validator to perform these checks, ensuring that email addresses are formatted correctly, URLs are valid, and UUIDs conform to standards, etc. For malformed fields, the system will attempt to correct the format (such as adding the missing protocol prefix "http: / / " to the incomplete URL) or replace it with a sample value that meets the format requirements.All these verification and correction operations are meticulously logged, including the original predicted value, the type of violation detected, the corrective action performed, and the final corrected value. These records not only generate preliminary verification results but also provide traceability for subsequent analysis, helping the development team understand and improve the predictive model. Through this comprehensive preliminary verification process, the system ensures that the prediction results meet basic technical constraints before entering the more complex business rule verification stage, significantly reducing the complexity and potential errors in subsequent processing.
[0092] Step S4.2: Match and verify the preliminary verification results with the implicit and explicit rules in the business rule base to generate business rule verification results.
[0093] This step involves deep matching and validation of the initially validated prediction results against the system's business rule base, ensuring that the prediction results are not only technically correct but also conform to business logic and domain rules. Business rule validation is a crucial step in the process of generating expected results, ensuring that the generated results meet the logical constraints and business requirements of a specific domain and application scenario. Unlike initial validation, which focuses on basic technical constraints, business rule validation focuses on complex cross-field relationships and context-dependent business logic. The system's business rule base contains two types of rules: explicit rules and implicit rules. Explicit rules are clearly defined and formalized business constraints, typically stored in the rule base in a structured format. These rules are explicitly expressed through condition-action pairs (IF-THEN statements), decision tables, or business rule description languages (such as Drools rule language). Typical examples of explicit rules include: "If a user is under 18 years old, they cannot apply for a credit card product," "When the total order amount exceeds 1000 yuan, the shipping fee should be 0," and "The reservation start date must be earlier than the end date," etc. The system uses a rule engine to perform explicit rule validation. A rule engine is a software component specifically designed to handle business rules, efficiently matching rule conditions and executing corresponding actions. During validation, the rule engine takes the predicted results as facts, checks whether the conditions of each rule are met, and marks any violations. Implicit rules, on the other hand, are business constraints and relationships that are not formally defined but discovered through historical data and pattern analysis. These rules are typically more complex, more context-dependent, and may change over time and under different conditions. Typical examples of implicit rules include conditional correlations between fields (such as the normal distribution range of prices for a specific product type), time series patterns (such as typical state transition sequences in order processing), and context-dependent data distribution characteristics (such as differences in purchasing behavior among users in different regions). The system uses machine learning models and statistical analysis methods to identify and apply implicit rules, including association rule mining, anomaly detection, and pattern recognition techniques. The validation process uses confidence interval analysis and probabilistic models to evaluate the consistency between the predicted results and historical data patterns. The execution process of business rule validation comprises four main stages: rule retrieval, rule matching, conflict identification, and result integration. First, the rule retrieval stage retrieves relevant explicit and implicit rules from the rule base based on the current API endpoint, input parameters, and contextual conditions. The system uses semantic matching and contextual relevance analysis to ensure that the retrieved rule set is highly relevant to the current validation task.Next, the rule matching phase applies the retrieved rules to the prediction results, performing condition evaluation and constraint checks. For explicit rules, the system performs precise logical condition checks; for implicit rules, the system calculates the consistency score between the prediction results and historical patterns. Then, the conflict identification phase detects conflicts that arise during rule application, such as different rules making contradictory requirements on the same field. The system uses factors such as rule priority, confidence weight, and source reliability to conduct preliminary assessments and label conflicts. Finally, the results integration phase summarizes the results of all rule verifications, generating a comprehensive verification report that includes rule compliance, violation tags, and correction suggestions. For prediction results that violate business rules, the system does not immediately correct them but records the violation, the cause of the conflict, and possible correction options in detail, providing a basis for the next step of conflict resolution. This layered processing strategy ensures that the system can comprehensively capture and analyze complex business rule conflicts, providing sufficient information for subsequent intelligent decision-making. Through this deep business rule verification process, the system ensures that the generated test expectations are not only technically correct but also consistent with actual business logic and domain knowledge, greatly improving the effectiveness and accuracy of testing.
[0094] Step S4.3: Perform conflict detection and consistency analysis on the business rule verification results to generate analysis results containing conflict markers and consistency scores.
[0095] This step systematically performs conflict detection and consistency analysis on the results of business rule verification, identifying and quantifying conflicts and inconsistencies among various rules. Conflict detection and consistency analysis is a crucial step in resolving complex business rule interactions. It helps the system identify contradictions and uncertainties in the rule application process and provides a basis for subsequent intelligent conflict resolution. This process involves three main dimensions: inter-rule conflict detection, data consistency assessment, and contextual relevance analysis. First, inter-rule conflict detection systematically identifies and classifies various conflict types among business rules. The system adopts a formal conflict definition framework, classifying rule conflicts into four basic types: direct conflict, indirect conflict, conditional conflict, and circular dependency. Direct conflict is the most obvious form of conflict, occurring when two rules directly make contradictory requirements on the same field, such as one rule requiring the status field to be "active," while another rule requires the same field to be "pending." Indirect conflicts are more complex, occurring when multiple rules affect related fields through different paths, ultimately leading to inconsistent system states. For example, rule A requires prices to be calculated based on product type, while rule B requires discounts to be calculated based on user level. When the final calculated price and discount combination violates the profit margin requirement of rule C, an indirect conflict arises. Conditional conflicts occur when the applicable conditions of rules partially overlap but the conclusions differ, creating logically uncertain regions. Circular dependencies are a special form of conflict where multiple rules form a closed-loop dependency relationship, making it impossible for the system to determine the order of rule application and the final state. The system uses rule graph analysis technology to construct a rule dependency network and uses graph theory algorithms to detect these complex conflict patterns. Next, data consistency assessment analyzes the logical consistency and data integrity among the fields in the prediction results. The system employs a three-tiered consistency check framework: Intra-field consistency checks whether the value of a single field is reasonable within its own context; Inter-field consistency checks whether the values of related fields satisfy logical relationship constraints; and Global consistency checks whether the entire prediction result is business-wise reasonable as a whole. The system uses statistical methods and domain knowledge models to calculate a consistency score, quantifying the overall reliability of the prediction results.For example, for e-commerce APIs, the system examines the mathematical relationships between product price, quantity, discount, and total price; the logical relationships between order status and payment status; and whether these values are consistent with the distribution patterns of historical transaction data. Then, context relevance analysis assesses the applicability of the predictions in the current test scenario and business context. The system considers various contextual factors, including the API call environment (e.g., test / production environment), user role permissions, system state, time factors, and business process stages. Through comparative analysis with test input conditions and system state, the system evaluates the degree of matching between the predictions and the current context, identifying potential context-dependent errors. Based on the analysis across these three dimensions, the system generates a detailed conflict and consistency report, comprising the following core components: ConflictMarkers, which record each detected conflict in detail, including conflict type, involved rules, affected fields, conflict severity, and possible solutions; Consistency Scores, which quantify the consistency level of the prediction results across different dimensions, including overall consistency score and dimensional breakdown scores; Uncertainty Maps, which visualize high-uncertainty areas and key decision points in the prediction results, helping to understand the root causes and scope of impact of conflicts; and Solution Space, which explores various possible conflict solutions and their impact on overall consistency, providing options for the next step of intelligent conflict resolution. This comprehensive conflict detection and consistency analysis not only identifies the problems that need to be solved but also provides all the contextual information and options needed to solve them, laying a solid foundation for subsequent intelligent conflict resolution. Through this in-depth analysis process, the system can systematically understand and quantify various uncertainties and contradictions in the prediction results, ensuring that the final generated test results have high internal consistency and business rationality.
[0096] Step S4.4: Based on the analysis results, perform intelligent conflict resolution to generate the expected test results.
[0097] This step, based on the aforementioned conflict detection and consistency analysis results, executes an intelligent conflict resolution process, ultimately generating internally consistent test results that conform to business logic. Intelligent Conflict Resolution is an automated decision-making process designed to systematically resolve various conflicts and inconsistencies discovered during rule application and data verification, ensuring that the final generated test results simultaneously meet technical constraints and business requirements. Unlike simple rule prioritization or last-in-first-out strategies, intelligent conflict resolution employs a multi-strategy fusion approach, dynamically selecting the optimal solution based on conflict characteristics and context. This process comprises four key stages: conflict classification and prioritization, multi-strategy conflict resolution, consistency optimization and verification, and solution application. First, conflict classification and prioritization systematically classifies all detected conflicts and determines their processing order. The system uses a multi-dimensional classification framework, classifying conflicts based on dimensions such as conflict type (direct / indirect / conditional / circular), severity (critical / high / medium / low), impact scope (local / global), and resolution complexity (simple / complex). The priority ranking algorithm comprehensively considers these classification attributes and incorporates business criticality weights to generate a conflict resolution queue. Prioritization follows several key principles: conflicts involving critical business fields are processed first; conflicts with a wide impact are processed first; resolving simple conflicts may automatically resolve some complex conflicts; circular dependencies require special handling strategies. This structured conflict resolution order ensures that the system can handle complex, interdependent conflict networks in the most efficient way. Next, multi-strategy conflict resolution applies the most appropriate resolution strategy to each conflict. The system maintains a comprehensive conflict resolution strategy library, including: Rule Priority Strategy, which determines priority based on the source, importance, and reliability of rules; Evidence Weighting Strategy, which makes decisions based on the strength of evidence supporting each option; Historical Consistency Strategy, which selects the option most consistent with historical data patterns; Domain-specific Strategy, which applies expert knowledge and best practices from specific business domains; Compromise Strategy, which finds a balance between conflicting options, such as taking the median value within a numerical range; and Context Adaptation Strategy, which selects the most appropriate option based on the specific conditions of the current test scenario.The system uses machine learning models to analyze conflict characteristics and context, selecting the optimal resolution strategy or combination of strategies for each conflict. For particularly complex conflicts, the system generates multiple candidate solutions and performs global optimization in the next stage. Then, Consistency Optimization and Validation ensures that all local conflict solutions are consistent at the global level. Since conflicts are often interconnected, resolving each conflict independently may lead to new inconsistencies. The system uses a global consistency optimization algorithm to combine all candidate solutions into a single overall solution and maximize the overall consistency score. This process can be formalized as a constraint satisfaction problem, and the system uses a heuristic search algorithm to find the optimal solution in the solution space. The optimized solution undergoes comprehensive validation, including reapplying all business rules, performing data consistency checks, and conducting contextual applicability analysis to ensure no new conflicts or inconsistencies are introduced. Finally, Solution Application applies the finalized solution to the prediction results, generating the final expected test results. The system not only applies the decision results but also records the complete decision-making process, including the original situation of each conflict, the options considered, the selected resolution strategy, the final decision, and the rationale for the decision. These detailed records are attached as metadata to the expected test results, providing test engineers with transparency and traceability for decision-making. For any highly uncertain conflicts that cannot be resolved automatically, the system clearly identifies them and provides multiple possible options for the test engineer's final decision. Through this comprehensive intelligent conflict resolution process, the system can handle complex rule interactions and data relationships, generating high-quality expected test results that meet both technical specifications and business logic. This intelligent conflict handling significantly improves the accuracy and usability of automatically generated test expectations, especially excelling in complex APIs and diverse test scenarios.
[0098] Example 2
[0099] like Figure 2 As shown, this embodiment provides a deep learning-based software testing expected result prediction system, including:
[0100] The data acquisition and preprocessing module is used to acquire multi-source heterogeneous data of the system under test and determine a multimodal dataset based on the multi-source heterogeneous data.
[0101] The multimodal feature encoding module is used to extract features from the multimodal dataset through a text encoder, a structured data encoder, and a temporal feature encoder, respectively, to obtain several feature vectors, and to fuse the feature vectors to generate a feature vector set.
[0102] The deep prediction model inference module is used to perform deep learning inference on the feature vector set. Through multi-head self-attention mechanism and cross-modal attention fusion, it generates multi-dimensional prediction results, wherein the multi-dimensional prediction results include prediction data structure, anomalies and confidence scores.
[0103] The dynamic verification and conflict resolution module is used to dynamically verify and resolve the conflicts of the multidimensional prediction results, and generate test expected results that meet system constraints and business logic.
Claims
1. A method for predicting expected results of software testing based on deep learning, characterized in that, Includes the following steps: Acquire multi-source heterogeneous data from the system under test, and perform preprocessing and correlation fusion based on the multi-source heterogeneous data to determine the multimodal dataset; The multimodal dataset is subjected to feature extraction using a text encoder, a structured data encoder, and a temporal feature encoder, respectively, to obtain several feature vectors. These feature vectors are then fused to generate a feature vector set. Deep learning inference is performed on the feature vector set, and multi-dimensional prediction results are generated through multi-head self-attention mechanism and cross-modal attention fusion. The multi-dimensional prediction results include prediction data structure, anomalies and confidence scores. The multidimensional prediction results are dynamically verified and conflict resolved to generate expected test results that conform to system constraints and business logic, including: The multidimensional prediction results are initially verified by checking for type consistency, verifying the range of values, and validating the format to ensure that the multidimensional prediction results meet the basic constraints. Prediction results that violate the basic constraints are then corrected to generate preliminary verification results. The preliminary verification results are matched and verified with the implicit and explicit rules in the business rule base to generate business rule verification results; The business rule verification results are subjected to conflict detection and consistency analysis to generate analysis results containing conflict markers and consistency scores; Based on the analysis results, intelligent conflict resolution is performed to generate the expected test results.
2. The method according to claim 1, characterized in that, The determination of the multimodal dataset based on the multi-source heterogeneous data includes: Scan the system under test to identify interface specifications in the application programming interface gateway, database structure definitions, historical test cases in the test repository, and production environment logs in the log system to form an original multi-source heterogeneous dataset; The original multi-source heterogeneous dataset is cleaned and transformed to convert the interface specification into a unified interface description language, convert the database structure definition into a graph structure representation, process the historical test cases into a standard key-value pair format, and parse the production environment logs into a structured time series to obtain structured data. Based on the structured data, an association mapping between different data sources is established through entity matching algorithms and relationship inference techniques to form the multimodal dataset.
3. The method according to claim 1, characterized in that, The multimodal dataset is subjected to feature extraction using a text encoder, a structured data encoder, and a temporal feature encoder, respectively, to obtain several feature vectors. These feature vectors are then fused to generate a feature vector set, including: The text portion of the multimodal dataset is input into a pre-trained BERT model for semantic feature extraction, generating a semantic vector representation; A graph structure is constructed based on the structured data portion of the multimodal dataset, and the graph structure is modeled using the message passing mechanism of a graph neural network to generate structural feature vectors. The time-series data portion of the multimodal dataset is input into a bidirectional LSTM network for processing to generate time-series feature vectors; Based on the semantic vector representation, the structural feature vector, and the temporal feature vector, feature fusion is performed through linear projection and attention mechanism to generate the feature vector set.
4. The method according to claim 1, characterized in that, Deep learning inference is performed on the feature vector set, and multi-dimensional prediction results are generated through multi-head self-attention mechanism and cross-modal attention fusion, including: A multi-head self-attention mechanism is applied to the feature vector set to project each feature vector into the query, key, and value space to obtain several projection results. The attention score of each projection result is calculated to obtain a context-aware feature representation. Cross-modal attention fusion is performed on the feature representation to establish semantic associations among text modal features, structural modal features, and temporal modal features, resulting in a fused feature representation; The fused feature representation is subjected to a nonlinear transformation through a multi-layer feedforward neural network to generate a target feature vector; Based on the target feature vector, the data structure of the normal response, the abnormal situation and error code, and the confidence score of the prediction result are predicted by the three parallel branches of the gated prediction head to generate the multidimensional prediction result.
5. The method according to claim 4, characterized in that, The process of generating a target feature vector by performing a nonlinear transformation on the fused feature representation through a multi-layer feedforward neural network includes: The fused feature representation is normalized to generate a preprocessed standard feature representation; Based on the standard feature representation, a secant derivative approximation function is constructed. For each weight parameter, two similar points are taken: the current weight and the weight after a small perturbation. The rate of change of the secant derivative approximation function between these two similar points is calculated as the derivative approximation, and the derivative approximation result is generated. Based on the derivative approximation result, a multi-scale regularization constraint is applied to generate a regularization constraint result; Based on the derivative approximation results and the regularization constraint results, a parameter update based on global rate optimization is performed to generate optimized network parameters; Based on the network parameters, a nonlinear transformation is performed on the fused feature representation, and a hierarchical residual connection and feature selection mechanism are applied to generate a target feature vector that has been optimized by regularization.
6. The method according to claim 5, characterized in that, The multi-scale regularization constraints include parameter-level regularization, hierarchical regularization, and global regularization, specifically including: The first-norm regularization and the second-norm regularization are applied to each weight parameter in the multilayer feedforward neural network. The parameter size is controlled by calculating the sum of the absolute values and the sum of squares of the parameters, thus generating parameter-level regularization. Norm constraints are applied to the output features of each layer of the multilayer feedforward neural network, the second norm of the feature vector is calculated and an upper bound threshold is set to generate layer regularization; Based on the overall network complexity and data distribution characteristics, the regularization strength is dynamically adjusted to generate global regularization; Based on the parameter-level regularization, the hierarchical regularization, and the global regularization, the regularization coefficients of each layer are adaptively adjusted through a monitoring and validation set performance feedback mechanism to generate the regularization constraint results.
7. The method according to claim 3, characterized in that, The feature vector set is generated by fusing features based on the semantic vector representation, the structural feature vector, and the temporal feature vector through linear projection and attention mechanisms, including: The semantic vector representation, the structural feature vector, and the temporal feature vector are transformed into a feature space to construct a second-order polynomial basis to capture the nonlinear interaction between features and generate a polynomial feature space. Based on the polynomial feature space, an scalable quadratic sum-square constraint structure is constructed to model the feature fusion process as an optimization problem with a polynomial objective function and constraints, and a corresponding constrained optimization problem is generated based on the optimization problem. The constrained optimization problem is transformed into a second-order cone programming problem, and a second-order cone programming solver is used to solve it, generating the programming solution results. Based on the planning solution results, the optimal feature fusion weights are calculated, and the feature fusion weights are mapped back to the original problem space to extract the fusion matrix coefficients and generate a dynamic weight allocation scheme. Based on the dynamic weight allocation scheme, the semantic vector representation, the structural feature vector, and the temporal feature vector are fused to obtain preliminary fused features. Uncertainty estimation and batch normalization are then performed on the preliminary fused features to generate a feature vector set.
8. The method according to claim 7, characterized in that, The step of calculating the optimal feature fusion weights based on the planning solution results, mapping the feature fusion weights back to the original problem space to extract the fusion matrix coefficients, and generating a dynamic weight allocation scheme includes: Based on the planning solution results, the coefficient vector of the fusion matrix is extracted, and the coefficient vector is converted into weight components of the three feature modes to generate a preliminary weight allocation; The initial weight allocation is sparsified to generate a sparse weight allocation. The sparse weight allocation is normalized to generate a normalized weight allocation. The normalized weight allocation is adaptively adjusted, and the weight ratio is dynamically corrected according to the characteristics of different test scenarios. The scenario relevance score is calculated and the weight bias is adjusted to generate the target allocation weight. Based on the target allocation weights, the dynamic weight allocation scheme is determined.
9. A software testing expected result prediction system based on deep learning, characterized in that, include: The data acquisition and preprocessing module is used to acquire multi-source heterogeneous data of the system under test and determine a multimodal dataset based on the multi-source heterogeneous data. The multimodal feature encoding module is used to extract features from the multimodal dataset through a text encoder, a structured data encoder, and a temporal feature encoder, respectively, to obtain several feature vectors, and to fuse the feature vectors to generate a feature vector set. The deep prediction model inference module is used to perform deep learning inference on the feature vector set. Through multi-head self-attention mechanism and cross-modal attention fusion, it generates multi-dimensional prediction results, wherein the multi-dimensional prediction results include prediction data structure, anomalies and confidence scores. The dynamic verification and conflict resolution module is used to dynamically verify and resolve conflicts in the multidimensional prediction results, generating expected test results that conform to system constraints and business logic, including: The multidimensional prediction results are initially verified by checking for type consistency, verifying the range of values, and validating the format to ensure that the multidimensional prediction results meet the basic constraints. Prediction results that violate the basic constraints are then corrected to generate preliminary verification results. The preliminary verification results are matched and verified with the implicit and explicit rules in the business rule base to generate business rule verification results; The business rule verification results are subjected to conflict detection and consistency analysis to generate analysis results containing conflict markers and consistency scores; Based on the analysis results, intelligent conflict resolution is performed to generate the expected test results.
Citation Information
Patent Citations
Test case generation system construction method and test case generation method
CN120670326A
Light industry supply chain multi-modal data fusion analysis method based on deep learning
CN120705794A