Photoelectric product software test case multiplexing system and method
By establishing a test case reuse system for optoelectronic product software based on word vector similarity fusion, the problem of large repetitive workload in optoelectronic product software testing has been solved, and the efficient reuse of test cases has been achieved, thus improving testing quality and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-03
Smart Images

Figure CN121785926A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing technology, specifically to a software test case reuse system and method for optoelectronic products. Background Technology
[0002] In current software testing, test cases are rewritten for each new project, failing to effectively utilize proven and mature test cases from previous projects. This results in over 60% of testing time being wasted on repeatedly building basic test cases, generating a large amount of repetitive work and severely wasting human resources and time in testing.
[0003] Furthermore, the lack of reference and reuse of historical test cases leads to a waste of valuable testing experience accumulated in historical test projects, such as business logic, technical verification, boundary values, and abnormal scenarios. Different testers have different approaches when designing new test cases, which may result in incomplete coverage of key scenarios and omission of boundary conditions, increasing the risk of missed tests.
[0004] Optoelectronic product software is highly functional. For some commonly used components, such as servo control, image tracking, health management, and sensor control modules, the functions are fixed, the system structure in the same field is similar, and there will not be much change between series of software.
[0005] These component software components have high continuity and extensibility, and a high degree of test case redundancy. After building a software test case reuse library, test cases can be reused directly or after simple modifications, which can effectively improve the test quality of software, save software test design time and costs, and improve the situation of insufficient professional background and experience of testers.
[0006] For new optoelectronic product software under test, by matching and filtering its software requirements with the software requirements of similar projects in the reuse library, an original reuse test case set can be established. After being modified and improved for applicability, the test case set of the software can be quickly generated, thereby greatly improving the efficiency of test case design and development for software testers, thus shortening the software testing cycle and saving software testing costs. Summary of the Invention
[0007] To address the issues of massive workload, long development time, frequent repetitive writing, and inconsistent test case quality in optoelectronic product software testing, one objective of this invention is to propose a test case reuse system for optoelectronic product software based on word vector similarity fusion. By establishing an overall framework for software test case reuse and forming a complete test case reuse strategy, this system aims to improve the efficiency of test case design for optoelectronic product software and enhance the sufficiency and quality of testing.
[0008] The technical solution adopted by this invention to solve its technical problem is: a software test case reuse system for optoelectronic products, comprising a document processing layer, a text processing layer, a word vector layer, and a similarity calculation layer connected in sequence; the document processing layer mainly classifies and integrates historically accumulated test case documents, standardizes and reconstructs test methods, and extracts structured data that can be stored in a database through VBA data extraction, thus obtaining a test case reuse library; the text processing layer processes the test case reuse library through three processes: text cleaning, text segmentation, and stop word removal, providing high-quality, structured data for the combination model of the word vector layer. To ensure the model can more accurately understand and process text information, the word vector layer uses a combination model based on TF-IDF and CBOW models. Through feature generation of the TF-IDF model and semantic acquisition of the CBOW model, the test text data is converted into numerical data, so that the hidden information in the structured text is mapped to vectors. The similarity calculation layer mainly calculates the keyword similarity and semantic similarity between the software requirements to be tested and the reuse library test cases after processing by the word vector layer through keyword similarity calculation and semantic similarity calculation. Then, the similarity fusion recommendation algorithm outputs recommended reuse test cases.
[0009] The aforementioned optoelectronic product software test case reuse system includes the following VBA data extraction process: counting the number of test cases in the test case document; traversing all test cases and locating each test case according to keyword matching rules; extracting key information from each test case; normalizing and classifying the test cases for deduplication; forming a standard dataset of test case data; and writing it into the test case reuse library.
[0010] The second objective of this invention is to propose a method for reusing software test cases for optoelectronic products. Using the aforementioned software test case reuse system, the method includes the following steps:
[0011] S1 standardizes the historical data of software testing for optoelectronic products, extracts software feature information, test requirements and test case information, establishes the relationship between test requirements and test cases based on the requirements traceability table, performs reasonable classification, management, maintenance and structuring, and establishes a test case reuse library.
[0012] S2, when there are new software module testing requirements, the test cases in the test requirement reuse library are preprocessed into text data to make them structured data, and then input into the combined model with the test cases in the test case reuse library in turn for text vectorization mapping. The software test requirements and test cases are vectorized to obtain the weight matrix and semantic vector of each word, so that the hidden feature information of each word is output in the form of word vectors.
[0013] S3 uses the fusion similarity calculation value as a reference indicator for recommending test case reuse. It performs similarity comparison calculation on the output feature word vectors, sorts the similarity values comprehensively, and then outputs the Top-K test cases in the reuse library that have a high similarity to the current test requirements.
[0014] Furthermore, it also includes step S4, where testers select or modify qualified test cases as test cases for the current module under test, thereby reusing test cases. At the same time, the modified test cases are reintroduced into the test case reuse library for further improvement of the model.
[0015] Furthermore, the TF-IDF model calculation formula is as follows: and In the formula t xi Represents the xth element in test text X i The number of words, k represents the total number of words in the test text X, M represents the number of test texts, which is related to the number of test cases, N xi Represents containing x i The number of test texts for a single word.
[0016] Furthermore, the CBOW model network includes an input layer, a projection layer, and a Softmax output layer. It optimizes the large-scale matrix operations and Softmax normalization operations present in neural probability models. It replaces the complex implementation of linear transformation and activation function in traditional neural networks with a simple summation of all input word vectors. At the same time, it uses Huffman trees to realize the mapping from the projection layer of the neural network word vector language model to the output Softmax layer.
[0017] Furthermore, the similarity calculation uses cosine distance to calculate text vector similarity: the formula is as follows. In the formula X i and Y i The components represent the two text vectors to be tested. a represents the text vector of the test requirements of a certain module of the software under test, b represents the text vectors of different test cases, and Sim represents the similarity calculation result between the texts, with a value range of [0,1]. The larger the value, the higher the similarity.
[0018] Furthermore, the similarity fusion recommendation algorithm process is as follows:
[0019] Input the software requirements r of the project to be tested and the test case reuse library L; output the index list I of the reused test case set.
[0020] Step 1: Based on the feature information of software requirement r, quickly partition the test case reuse library, and use retrieval technology to extract software projects that meet the features in the reuse library to obtain the candidate subset L' of reuse test cases;
[0021] Step 2: In the candidate subset L', calculate the keyword similarity between the requirement name and requirement description of software requirement r and the test case data in the candidate subset L'. Calculate the keyword similarity between requirement names using the similarity calculation formula. Keyword similarity between requirement descriptions Keyword similarity between requirement description and testing methods Keyword similarity between requirement description and expected results Then, the final keyword similarity is obtained by weighted summation. The parameters k1, k2, k3, and k4 represent the weights of the four attribute keyword similarity scores, with values of 0.3, 0.4, 0.2, and 0.1, respectively.
[0022] Step 3: In the candidate subset L', calculate the semantic similarity between the requirement name and requirement description of software requirement r and the test case data in the candidate subset L'. Calculate the semantic similarity between requirement names using the similarity calculation formula. Semantic similarity between requirement descriptions Semantic similarity between requirements description and testing methods Semantic similarity between requirement description and expected results Then, the final semantic similarity is obtained by weighted summation using the following formula. The parameters s1, s2, s3, and s4 represent the weights of the semantic similarity of the four attributes, with values of 0.3, 0.4, 0.2, and 0.1, respectively.
[0023] Step 4, use the formula By using keyword similarity and semantic similarity After assigning different weights, the similarity scores are summed to achieve similarity fusion, resulting in a fused similarity score. The parameters are... For similarity fusion parameter weights, The value is 0.4;
[0024] Step 5: Set the judgment threshold , will merge similarity Sort the data from largest to smallest and retrieve the Top-K data that are greater than or equal to [the specified value]. If the test case index list I is empty, it is determined that there is no matching requirement r in the test case reuse library L, and the system has no corresponding reused test case output.
[0025] Step 6: The root test case index list I retrieves the corresponding test cases from the reuse library and selects the test cases that best match requirement r as the output.
[0026] Step 7: After instantiating and modifying the output test cases, we obtain the reusable test cases for this project.
[0027] The beneficial effects of this invention are: by reusing test cases, it is possible to avoid repeatedly designing similar test scenarios, thereby saving a lot of test design time, allowing testers to devote more time and energy to testing new functions or designing complex test scenarios; when requirements change, existing test cases can be modified appropriately to quickly adapt to new test requirements, which can greatly shorten the software testing cycle, improve the software delivery speed, and has strong practicality. Attached Figure Description
[0028] Figure 1 This is an overall framework diagram of the present invention;
[0029] Figure 2 This is a VBA data extraction flowchart for the present invention;
[0030] Figure 3 The test case reuse library architecture diagram established for this invention;
[0031] Figure 4 This is a schematic diagram illustrating the working principle of the TF-IDF algorithm of this invention.
[0032] Figure 5 This is a flowchart of the similarity fusion recommendation algorithm of the present invention.
[0033] The figures are labeled as follows: 01—Document processing layer, 02—Text processing layer, 03—Word vector layer, 04—Similarity calculation layer. Detailed Implementation
[0034] The present invention will now be described in further detail with reference to the accompanying drawings.
[0035] Reference Figure 1 As shown, the present invention discloses a software test case reuse system for optoelectronic products based on word vector similarity fusion, which is divided into a document processing layer 01, a text processing layer 02, a word vector layer 03, and a similarity calculation layer 04.
[0036] The document processing layer 01 mainly classifies and integrates historically accumulated test case documents, standardizes and reconstructs test methods, and extracts data through VBA to form structured data that can be stored in the database, thus forming a test case reuse library.
[0037] Historically accumulated test case documents are stored in Word format, requiring data extraction to convert them into structured data and store them in a database. VBA data extraction automatically counts the number of test cases in the test documents and locates them based on keyword matching rules. It extracts key information from each test case, including detailed test steps, preconditions, pass / fail criteria, sufficiency requirements, test case names, and test case types. Through normalization, the test cases are categorized and deduplicated, and then classified and summarized according to test type and domain type, forming a standardized, clearly categorized, and comprehensive test case dataset. This dataset is then managed by writing it into a test case reuse database using SQL.
[0038] Reference Figure 2 As shown, the VBA data extraction process includes the following steps.
[0039] S1, count the number of test cases in the test case document.
[0040] S2, iterate through all test cases and locate each test case according to the keyword matching rules.
[0041] S3 extracts key information for each test case.
[0042] S4 performs normalization and deduplication on test cases.
[0043] S5 forms a standard dataset of test case data.
[0044] S6, write to the test case reuse library.
[0045] The main function of the text processing layer 02 is to provide high-quality, structured data for the combined model of the word vector layer 03, ensuring that the model can more accurately understand and process text information in the future, including three processes: text cleaning, text segmentation, and stop word removal.
[0046] The word vector layer 03 uses a combination model based on TF-IDF and CBOW models. Through feature generation by TF-IDF model and semantic acquisition by CBOW model, it can convert test text data into numerical data, so that the hidden information in the structured text can be mapped to vectors.
[0047] The similarity calculation layer 04 mainly calculates the keyword similarity and semantic similarity between the software requirements to be tested and the reuse library test cases after the word vector layer 03 has processed them through keyword similarity calculation and semantic similarity calculation. Then, it outputs recommended reuse test cases through similarity fusion recommendation algorithm.
[0048] Reference Figure 3 , Figure 4 and Figure 5As shown, the present invention discloses a method for reusing software test cases for optoelectronic products, which includes the following steps.
[0049] First, test cases and test requirement-related data are extracted from the historical test asset database to form a test case reuse library.
[0050] The historical data of optoelectronic product software testing is standardized to extract software feature information, test requirements and test case information. The relationship between test requirements and test cases is established based on the requirements traceability table. The data is then reasonably classified, managed, maintained and structured to create a test case reuse library.
[0051] The test case reuse library architecture is shown in Figure 3. The reuse library is built according to test type, indicator type, product type and other dimensions. The test types include more than 20 test types such as document review, code review, static analysis, functional testing, performance testing and interface testing, which can basically cover the software testing needs of optoelectronic products.
[0052] The software testing requirements and test cases are vectorized to obtain the weight matrix and semantic vector of each word.
[0053] When new software module testing requirements arise, the test cases in the test requirement reuse library are preprocessed into structured data. This structured data is then input sequentially into a TF-IDF and CBOW combined model for text vectorization mapping, along with the test cases from the test case reuse library. The TF-IDF and CBOW models are used to vectorize the software test requirements and test cases. The working principle diagram of the F-IDF algorithm for test text is shown below. Figure 4 As shown, the weight matrix and semantic vector of each word are obtained respectively, so that the hidden feature information of each word is output in the form of word vectors.
[0054] The TF-IDF model is used to evaluate the importance of textual features in a corpus. To quantitatively measure the importance of each word in the corpus, the more frequently a word appears in software requirement features, and the lower its overall frequency in the corpus, the more important the feature is. Here, TF represents the frequency of a feature word in software requirements, and IDF refers to inverse document frequency. The higher the frequency of a feature word in software requirements, the larger the TF value, indicating greater importance; the lower the proportion of this feature word in all software requirements, the more representative it is of that software requirement. By calculating word frequency, we obtain the feature words that appear repeatedly in the text, and introduce inverse document frequency to assign a weight to each word group. Multiplying the two results in a two-dimensional array, where each value represents the importance of a word to the text.
[0055] The TF-IDF algorithm calculation process is as follows: and In the formula t xi Represents the xth element in test text X i The number of words; k represents the total number of words in the test text X, M represents the number of test texts, which is related to the number of test cases, N xi Represents containing x i The number of test texts for a single word.
[0056] Text semantics are acquired using a weighted entity feature attribute text CBOW (Continuous Bag-of-Words) model natural language processing algorithm provided by the Word2Vec toolkit in the Gensim library. After being fully trained, the CBOW model can predict the probability of a word appearing, given a specified current word and its context as input.
[0057] Word2Vec's CBOW model network consists of an input layer, a projection layer, and an output layer (Softmax layer). It optimizes the large-scale matrix operations and Softmax normalization operations present in neural probabilistic models. It replaces the complex implementation of linear transformation and activation function in traditional neural networks with a simple summation of all input word vectors. At the same time, it uses Huffman trees to realize the mapping from the projection layer of the neural network word vector language model to the output Softmax layer.
[0058] For the input word ω, define x ω Output word vectors for the corresponding Huffman tree nodes. and Let Huffman code and model parameters be the Huffman codes and model parameters corresponding to the i-th node of the traversed Huffman tree, respectively. Then the logistic regression probability of node i is: Its output log-likelihood function is In the formula, C is the set of all words in the corpus, Context(ω) is the related words immediately before and after word ω, and P(ω|Context(ω)) is the conditional probability of ω.
[0059] Before using the CBOW model, it needs to be trained. The training input corpus used in this invention consists of software test documents for optoelectronic products from historical projects totaling thousands of pages. Through training, the softmax probability of the target output word for each word in the corpus is maximized. For the input semantic text, after processing by text processing layer 02, the sequence of Chinese keywords for the sentence is obtained. The word vector value of each keyword can be obtained using the training output file of the CBOW model. Then, the sentence vector of the attribute text is obtained by averaging all the word vectors in the sentence.
[0060] The preprocessing of the test text includes text cleaning, text tokenization, and stop word removal. Text cleaning screens, filters, and removes irrelevant information and noise in the original test text to improve the purity and usability of the test text data; tokenization mainly decomposes the test text into individual words to facilitate subsequent word frequency statistics and semantic analysis; stop word removal deletes common stop words (such as "of", "is", "in", etc.) and low-frequency words according to the established stop word list, extracts semantic keywords, and realizes the optimization of the test text corpus.
[0061] The relevant functions of test text preprocessing are implemented in this project with the help of the Jieba tokenization tool. Jieba is an efficient Chinese word segmentation tool that supports multiple word segmentation modes and functions and is widely used in the fields of text analysis and natural language processing. Its core is based on a prefix dictionary and a dynamic programming algorithm, combined with a Hidden Markov Model (HMM) to handle out-of-vocabulary words.
[0062] Obtaining the semantic vector representation of the test text for software test data is the basis for test case similarity calculation and recommendation. The advantages of the TF-IDF and CBOW models are used to extract the feature information of software test requirements and test cases from different dimensions, including the keyword weight information and semantic features in the test text. The TF-IDF algorithm provides the keyword weight information in the test text to quickly locate the key parts of software testing. The CBOW model compensates for the deficiency of the TF-IDF framework in explaining document semantic information and can capture the semantic features of the test text more accurately. By combining the two models, deeper feature information of the test text is extracted to provide high-quality and structured data for the test case reuse recommendation algorithm, ensuring that the algorithm can understand and process test text information more accurately subsequently.
[0063] Finally, the keyword similarity and semantic similarity between software requirements and test cases are calculated respectively, and the similarities are fused. According to the fused similarity, the recommended test cases are output.
[0064] Taking the fused similarity calculation value as a reference index for test case recommendation and reuse, the similarity comparison calculation is performed on the output feature word vectors, and the similarity values are comprehensively sorted, and then the top-K test cases with higher similarity to the current test requirements in the reuse library are output.
[0065] Testers realize the reuse of test cases by selecting or modifying eligible cases as the test cases for the current tested module, and at the same time re-incorporate the modified test cases into the test case reuse library for further improvement of the subsequent model.
[0066] Typically, software testers leverage the close coverage and traceability relationships between test cases and the software requirements of optoelectronic products to reuse test cases by retrieving related test cases that match similar software requirements from historical projects. However, when a large number of similar optoelectronic software test cases exist during reuse, more selective processing is required.
[0067] Matching and intelligent recommendation of reusable test cases are key and challenging aspects of test case reuse. Unlike traditional simple search methods, test case recommendation technology can assist users in finding test case information of interest and automatically push related knowledge entities to users more accurately. By fusion of low-level test case features such as requirement name similarity, requirement description similarity, similarity between requirement and test method, and similarity between requirement description and expected result, as well as higher-level feature feature similarity and semantic similarity fusion, the similarity between the requirement to be tested and the reusable test cases is fully explored. Through experiments, the similarity fusion parameters are optimized to improve the accuracy of reusable test case recommendations.
[0068] This invention fully leverages the advantages of TF-IDF and CBOW models in text semantic parsing, automating this process using a similarity fusion recommendation algorithm. Centered on software requirement knowledge, it obtains keywords and semantic vector representations of test text data through TF-IDF and CBOW models. Then, it calculates keyword and semantic similarity between test texts to measure the similarity between the requirements to be tested and test cases, and collectively matches these with similar test cases in a test case reuse library, thereby obtaining superior retrieval output results.
[0069] Commonly used similarity calculation methods include Euclidean distance, cosine distance, Jaccard similarity, and Hamming distance, among which cosine distance is the most common text vector similarity algorithm.
[0070] Therefore, this invention chooses cosine distance to calculate the cosine value of the angle between two text vectors, and the calculation formula is as follows: In the formula X i and Y i represents the components of two text vectors to be tested; 'a' represents the text vector of the test requirements for a certain module of the software under test; 'b' represents the text vectors of different test cases. 'Sim' represents the similarity calculation result between the texts, with a value range of [0,1], where a larger value indicates a higher similarity.
[0071] The flowchart of the similarity fusion recommendation algorithm is attached. Figure 5 As shown, the specific algorithm is as follows:
[0072] Input: The software requirements r of the project under test and the test case reuse library L.
[0073] Output: Reusable test case set index list I.
[0074] Step 1: Based on the feature information of the project to be tested r, quickly partition the test case reuse library, and use retrieval technology to extract software projects that meet the features in the reuse library to obtain the candidate subset L' of reuse test cases.
[0075] Step 2: In the candidate subset L', calculate the keyword similarity between the requirement name and requirement description of the software requirement r to be tested and the test case data in the candidate subset L'. Calculate the keyword similarity between requirement names using the similarity calculation formula. Keyword similarity between requirement descriptions Keyword similarity between requirement description and testing methods Keyword similarity between requirement description and expected results The final keyword similarity is obtained by weighted summation. The parameters k1, k2, k3, and k4 represent the weights of the similarity of the four attribute keywords, with values of 0.3, 0.4, 0.2, and 0.1, respectively.
[0076] Step 3: In the candidate subset L', calculate the semantic similarity between the requirement name and requirement description of the software requirement r to be tested and the test case data in the candidate subset L'. Calculate the semantic similarity between requirement names using the similarity calculation formula. Semantic similarity between requirement descriptions Semantic similarity between requirements description and testing methods Semantic similarity between requirement description and expected results The final semantic similarity is obtained by weighted summation as follows: The parameters s1, s2, s3, and s4 are the weights of the semantic similarity of the four attributes, with values of 0.3, 0.4, 0.2, and 0.1, respectively.
[0077] Step 4, use the formula By using keyword similarity and semantic similarity After assigning different weights, the similarity scores are summed to achieve similarity fusion, resulting in a fused similarity score. The parameters are... For similarity fusion parameter weights, The value is 0.4.
[0078] Step 5: Set the judgment threshold , will merge similarity Sort the data from largest to smallest and retrieve the Top-K data that are greater than or equal to [the specified value]. If the test case index list I is empty, it is determined that requirement r has no matching requirement in the test case reuse library L, and the system has no corresponding reused test case output.
[0079] Step 6: The root test case index list I retrieves the corresponding test cases from the reuse library and selects the test cases that best match requirement r as the output.
[0080] Step 7: After instantiating and modifying the output test cases, we obtain the reusable test cases for this project.
[0081] Those skilled in the art will readily understand that the above description is merely a preferred use case of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A software test case reuse system for optoelectronic products, characterized in that: The test case library consists of a document processing layer (01), a text processing layer (02), a word vector layer (03), and a similarity calculation layer (04) connected in sequence. The document processing layer (01) classifies and integrates historically accumulated test case documents, standardizes and reconstructs test methods, and extracts structured data that can be stored in the database through VBA data extraction to obtain a test case reuse library. The text processing layer (02) performs text cleaning, text segmentation, and stop word removal on the test case reuse library to provide high-quality, structured data for the word vector layer (03). The word vector layer (03) uses a combination model based on TF-IDF and CBOW models. Through feature generation of the TF-IDF model and semantic acquisition of the CBOW model, the test text data is converted into numerical data, so that the hidden information in the structured text is mapped to the vector. The similarity calculation layer (04) calculates the keyword similarity and semantic similarity between the software requirements to be tested and the test cases in the reuse library after processing by the word vector layer (03) through keyword similarity calculation and semantic similarity calculation, and outputs recommended reuse test cases through similarity fusion recommendation algorithm.
2. The optoelectronic product software test case reuse system according to claim 1, characterized in that, The VBA data extraction process includes the following steps: counting the number of test cases in the test case document; Iterate through all test cases and locate each test case according to keyword matching rules; Extract key information from each test case; Normalize and categorize test cases to remove duplicates; Create a standard dataset of test case data; Write it into the test case reuse library.
3. A method for reusing software test cases for optoelectronic products, employing the software test case reuse system described in claim 1, characterized in that, Includes the following steps: S1. Standardize the historical data of software testing for optoelectronic products, extract software feature information, test requirements and test case information, and establish the relationship between test requirements and test cases based on the requirements traceability table to build a test case reuse library. S2, when there are new software module testing requirements, the test cases in the test requirement reuse library are preprocessed into text data to make them structured data, and then input into the combined model with the test cases in the test case reuse library in turn for text vectorization mapping to obtain the weight matrix and semantic vector of each word, so that the hidden feature information of each word is output in the form of word vectors. S3 uses the fusion similarity calculation value as a reference indicator for recommending test case reuse. It performs similarity comparison calculation on the output feature word vectors, sorts the similarity values comprehensively, and then outputs the Top-K test cases in the reuse library that have a high similarity to the current test requirements.
4. The method for reusing software test cases for optoelectronic products according to claim 3, characterized in that, It also includes step S4, which involves selecting or modifying eligible test cases as test cases for the current module under test to achieve test case reuse, and at the same time, incorporating the modified test cases back into the test case reuse library.
5. The method for reusing software test cases for optoelectronic products according to claim 4, characterized in that, The TF-IDF model calculation formula is as follows: and In the formula t xi Represents the xth element in test text X i The number of words, k represents the total number of words in the test text X, M represents the number of test texts, and N... xi Represents containing x i The number of test texts for a single word.
6. The method for reusing software test cases for optoelectronic products according to claim 5, characterized in that, The CBOW model network includes an input layer, a projection layer, and a softmax output layer. It simply sums all input word vectors and uses a Huffman tree to map from the projection layer to the softmax layer.
7. The method for reusing software test cases for optoelectronic products according to claim 6, characterized in that, The similarity calculation uses cosine distance to calculate text vector similarity, and the calculation formula is as follows: In the formula X i and Y i The components represent the two text vectors to be tested. 'a' represents the text vector of the test requirements for a certain module of the software under test, 'b' represents the text vectors of different test cases, and 'Sim' represents the similarity calculation result between the texts.
8. The method for reusing software test cases for optoelectronic products according to claim 7, characterized in that, The similarity fusion recommendation algorithm process is as follows: Input the software requirements r of the project to be tested and the test case reuse library L; output the index list I of the reused test case set. Step 1: Based on the feature information of software requirement r, quickly partition the test case reuse library and extract the software projects that meet the features in the reuse library to obtain the candidate subset L' of reuse test cases; Step 2: In the candidate subset L', calculate the keyword similarity between the requirement name and requirement description of software requirement r and the test case data in the candidate subset L'. Calculate the keyword similarity between requirement names using the similarity calculation formula. Keyword similarity between requirement descriptions Keyword similarity between requirement description and testing methods Keyword similarity between requirement description and expected results Then, the final keyword similarity is obtained by weighted summation. The parameters k1, k2, k3, and k4 represent the weights of the four attribute keyword similarity scores, with values of 0.3, 0.4, 0.2, and 0.1, respectively. Step 3: In the candidate subset L', calculate the semantic similarity between the requirement name and requirement description of software requirement r and the test case data in the candidate subset L'. Calculate the semantic similarity between requirement names using the similarity calculation formula. Semantic similarity between requirement descriptions Semantic similarity between requirements description and testing methods Semantic similarity between requirement description and expected results Then, the final semantic similarity is obtained by weighted summation using the following formula. , where parameters s1, s2, s3, and s4 are the weights of the semantic similarity of the four attributes; Step 4, use the formula By using keyword similarity and semantic similarity After assigning different weights, the similarity scores are summed to achieve similarity fusion, resulting in a fused similarity score. The parameters are... Weights for similarity fusion parameters; Step 5: Set the judgment threshold , will merge similarity Sort the data from largest to smallest and retrieve the Top-K data that are greater than or equal to [the specified value]. If the test case index list I is empty, it is determined that there is no matching requirement r in the test case reuse library L, and the system has no corresponding reused test case output. Step 6: The root test case index list I retrieves the corresponding test cases from the reuse library and selects the test cases that best match requirement r as the output. Step 7: After instantiating and modifying the output test cases, we obtain the reusable test cases for this project.