Storage product automatic testing method and device, electronic equipment and nonvolatile storage medium

By matching the test script data with the highest similarity from the historical test database, automated test scripts are automatically generated, solving the high cost problem caused by manually writing scripts in the automated testing of storage products, and achieving high efficiency and low cost of fully automated testing.

CN119296620AActive Publication Date: 2025-01-10INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411388086.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-10
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

Existing technologies require manual writing of numerous test scripts for automated testing of storage products, leading to increased labor costs, making it impossible to achieve fully automated testing, and resulting in low efficiency in automated testing.

Method used

By extracting the test actions and target information of test cases, matching the historical test scripts with the highest similarity from the historical test database, and automatically generating automated test scripts, fully automated testing is achieved.

Benefits of technology

It improved the efficiency of writing automated test scripts, saved labor costs, and enabled fully automated testing of storage products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296620A_ABST
    Figure CN119296620A_ABST
Patent Text Reader

Abstract

The invention discloses a storage product automatic testing method and device, electronic equipment and a nonvolatile storage medium, and is applied to the technical field of testing. The method comprises the following steps: acquiring a target test case of a to-be-tested storage product according with a case writing rule, and extracting test actions and target information corresponding to each test step of the target test case; and based on the test step text description data, the test action and the target information of each test step, matching target historical test script data meeting the same test action and test target condition for each test step in a historical test database. And inserting the target historical test script data, the test action and the target information corresponding to each test step into an automated test script executable file to obtain an automated test script for performing automated test on the to-be-tested storage product. The problem that scripts need to be written manually in related technologies can be solved, and full-automatic testing of storage products can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a storage product automated testing method, device, electronic equipment and non-volatile storage medium. Background Art

[0002] At present, the automated testing process of storage products is: first write the automated test cases, then compare the automated test cases on the storage automated testing platform, and write the corresponding automated test scripts step by step. When the automated test scripts are completed, perform automated testing on the storage products on the storage automated testing platform.

[0003] It can be seen that when the relevant technology performs automated testing on storage products, it is necessary for humans to spend a lot of time to write corresponding test scripts according to test cases, which causes an increase in labor costs, fails to effectively improve the efficiency of automated testing, and cannot achieve truly fully automated testing of storage products.

[0004] In view of this, achieving fully automated testing of storage products is a technical problem that technical personnel in this field need to solve.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present invention provides a storage product automated testing method, device, electronic equipment and non-volatile storage medium, which can automatically translate test cases corresponding to the storage product to be tested and generate automated test scripts, thereby realizing fully automated testing of the storage product.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] In one aspect, the present invention provides a storage product automated testing method, comprising:

[0009] In a first exemplary embodiment, the test step text description data, test action and target information of each test step are matched to target historical test script data satisfying the same test action and test target conditions in the historical test database for each test step, including:

[0010] According to the test action and target information of each test step, searching the historical test database for candidate historical test script data having the same test action and target information for the corresponding test step;

[0011] The similarities between the historical test step text description data of each candidate historical test script data and the text description data of the corresponding test step are compared in turn, and the candidate historical test script data with the highest similarity is selected as the target historical test script data.

[0012] In a second exemplary implementation, the extracting the test actions and target information corresponding to each test step of the target test case includes:

[0013] Extracting action keywords, target keywords and step parameter name information of each test step of the target test case as test action and target information;

[0014] The action keyword and the target keyword are stored in the keyword field of the automated test script executable file.

[0015] In a third exemplary embodiment, before inserting into a pre-built automated test script executable file, the method further includes:

[0016] Pre-build the automated test script step table and keyword table as the automated test script executable file;

[0017] Among them, the data structure of the automated test script step table includes at least multiple field names, each field name corresponds to the content contained in the automated test script, each field name corresponds to a data type and text description data, the text description data is used to describe the corresponding field, and is used to store the corresponding content of the target historical script data corresponding to the target test case; the keyword table includes keyword type and keyword value.

[0018] In a fourth exemplary implementation, obtaining a target test case for the storage product to be tested that complies with the test case writing rule includes:

[0019] Read the automated test cases for the storage product to be tested;

[0020] If at least one test step of the automated test case does not correspond to a command line, the automated test case does not comply with the test case writing rules;

[0021] If each test step of the automated test case corresponds to a command line, if the number and order of parameters in at least one command line are inconsistent with the corresponding test step text description order, the automated test case does not comply with the use case writing rules; if the number and order of parameters in each command line are consistent with the corresponding test step text description order, the automated test case is a target test case that complies with the use case writing rules.

[0022] In a fifth exemplary implementation, after matching each test step in the historical test database with target historical test script data that meets the same test action and test target conditions, the method further includes:

[0023] If there is a target test step that is not matched to the target historical test script data, then detecting whether there is target historical test step text description data containing the action keyword and target keyword of the target test step in each historical test step text description data;

[0024] If target historical test step text description data exists, the historical test script data corresponding to the target historical test step text description data is used as the target historical test script data.

[0025] In a sixth exemplary implementation, matching each test step in a historical test database with target historical test script data that satisfies the same test action and test target conditions includes:

[0026] According to the test action and target information of each test step, searching the historical test database for candidate historical test script data having the same test action and target information for the corresponding test step;

[0027] Perform word segmentation processing on the historical test step text description data of each candidate historical test script data to obtain the corresponding historical word segmentation information; perform word segmentation processing on the test step text description data of each test step to obtain the corresponding use case word segmentation information;

[0028] For each test step, the use case word segmentation information of the current test step is respectively combined with the words contained in the historical word segmentation information of each candidate historical test script data for deduplication processing to obtain multiple word set information; for each word set information, the number of occurrences of each word in the current word set information in the current test step text description data and each historical test step text description data is counted to obtain the use case word frequency information of the current test step and the historical word frequency information of each candidate historical test script data, and according to the use case word frequency information and each historical word frequency information, the similarity between the current test step and each candidate historical test script data is determined;

[0029] The candidate historical test script data with the highest degree of similarity to each test step is used as the target historical test script data that satisfies the same test action and test target conditions.

[0030] Another aspect of the present invention provides a storage product automated testing device, comprising:

[0031] A use case identification module is used to obtain a target test case for the storage product to be tested that meets the use case writing rules, and extract the test actions and target information corresponding to each test step of the target test case; the use case writing rules are that the test steps correspond to the command lines one by one, and the number and order of parameters of the command lines are consistent with the order of the corresponding test step text descriptions;

[0032] A screening module is used to match target historical test script data that meets the same test action and test target conditions for each test step in a historical test database based on the test step text description data, test action and target information of each test step; wherein the historical test database includes a plurality of historical test script data, each of which includes at least historical test step text description data and historical test action and target information;

[0033] The script generation module is used to insert the target historical test script data and test actions and target information corresponding to each test step into a pre-built automated test script executable file to obtain the automated test script corresponding to the target test case, so as to perform automated testing on the storage product to be tested based on the automated test script.

[0034] The present invention also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of the storage product automatic testing method as described in any of the preceding items when executing a computer program stored in a memory.

[0035] Finally, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the automatic testing method for storage products as described in any of the preceding items are implemented.

[0036] The advantage of the technical solution provided by the present invention is that after the tester writes an automated test case, the test action and target information are extracted from each step of the test case, and based on the data, a script step information with the highest similarity is selected from the existing historical test script data as a template, and inserted into the corresponding new test script step, thereby automatically translating the test case corresponding to the storage product to be tested and generating an automated test script, thereby improving script writing efficiency, saving labor costs, and realizing fully automated testing of storage products.

[0037] In addition, the present invention also provides a corresponding implementation device, electronic device and non-volatile storage medium for the storage product automated testing method, which further makes the method more practical, and the device, electronic device and non-volatile storage medium have corresponding advantages.

[0038] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be arbitrarily combined with each other, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this article. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features. It should be understood that the above general description and the detailed description below are only exemplary and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 A schematic diagram of a flow chart of a storage product automated testing method provided by the present invention;

[0041] Figure 2 A schematic diagram of a flow chart of another storage product automated testing method provided by the present invention;

[0042] Figure 3 A structural diagram of a specific implementation of the storage product automated testing device provided by the present invention;

[0043] Figure 4 A structural diagram of a specific implementation of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0044] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, the terms "first", "second", "third", "fourth", etc. in the specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations of the two are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described here as "exemplary" is not necessarily interpreted as being superior or better than other embodiments.

[0045] The traditional storage product testing process is: after designing and reviewing the test cases for the storage products according to the test requirements, the testers will perform the test step by step according to the procedures described in the test cases to compare the actual results with the expected results. In order to save manpower, time or hardware resources and improve testing efficiency, the automated test that transforms human-driven testing behavior into machine-executed testing was born, that is, the automated testing of storage products is realized by replacing manual testing with a storage automated testing platform.

[0046] At present, the automated testing method for storage products in the related art is to execute automated test scripts on the storage automated testing platform, and the automated test scripts are manually written step by step according to the automated test cases, which takes a lot of time. As the number of storage products increases, the number of automated test cases and automated test scripts that need to be written by testers also increases gradually, which will lead to a sharp increase in the labor cost of testing. Moreover, the automated test scripts require testers to have certain storage-related professional technical accumulation and experience in writing automated scripts, and there are certain professional requirements for testers, which further increases the labor cost of storage product testing. In addition, the manually written automated test scripts are limited by manual experience, and their quality cannot be guaranteed, resulting in low efficiency in automated testing of storage products.

[0047] In view of this, after the tester writes the automated test case, the present invention can automatically translate the test user and generate an automated test script, saving the tester's time in writing the automated test script, effectively improving the quality and writing efficiency of the automated test script, and improving the automated testing efficiency of storage products. After introducing the technical scheme of the present invention, various non-limiting implementation methods of the present invention are described in detail below. In order to better illustrate the present invention, numerous specific details are given in the specific implementation methods below. Those skilled in the art should understand that the present invention can also be implemented without these specific details. In other examples, the methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present invention.

[0048] First see Figure 1 , Figure 1 A flowchart of a storage product automated testing method provided in this embodiment may include the following contents:

[0049] S101: Obtain a target test case for a storage product to be tested that complies with a test case writing rule, and extract test actions and target information corresponding to each test step of the target test case.

[0050] Among them, the test case refers to the description of the test task for a specific software product, which embodies the test plan, method, technology and strategy, including but not limited to the test target, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special goal, which is used to verify whether the test requirements for storage products are met. In order to achieve the automatic translation and conversion of the test case input by the user into a test script, this embodiment will select the input test case, and only perform the following steps on the test case that meets the test case writing rules. For the convenience of description, the test case that meets the test case writing rules is defined as the target test case. Among them, the test case writing rules are that the test steps correspond to the command line one by one, and the number and order of parameters of the command line are consistent with the order of the corresponding test step text description. Correspondingly, the target test case is that each step corresponds to a command line, and the number and order of parameters in each command line must be consistent, so as to facilitate the extraction of parameter information and the calculation of script step similarity. The test action and target information include the test actions to be performed on the storage product to be tested, such as adding, deleting, modifying, and checking, as well as the test targets to be tested, such as storage pools, storage volumes, snapshots, and backups, and also include parameter information corresponding to each command line. Of course, those skilled in the art can also flexibly select other information to be added to the test action and target information according to actual needs, which does not affect the implementation of the present invention.

[0051] S102: Based on the test step text description data, test action and target information of each test step, target historical test script data satisfying the same test action and test target conditions is matched for each test step in the historical test database.

[0052] The test operations of storage products include four types: add, delete, modify, and check, and most of the operations have corresponding command lines, and the parameters have a high degree of similarity. Based on this, the present invention will save the historical test data of the storage product to be tested or other storage products with the same configuration into a database. For the convenience of description, it is defined as a historical test database. The historical test data includes the test action and target information, test step text description data, and corresponding test step executable files for each test. In other words, the historical test database includes multiple historical test script data, and each historical test script data includes at least historical test step text description data and historical test action and target information. This embodiment can match the most similar historical test script data from the historical test database through the test step text description data, test action and target information of the current test step. For the convenience of description, it is defined as target historical test script data.

[0053] S103: Insert the target historical test script data and test actions and target information corresponding to each test step into a pre-built automated test script executable file to obtain an automated test script corresponding to the target test case, so as to perform automated testing on the storage product to be tested based on the automated test script.

[0054] According to the previous step, the corresponding target historical test script data will be determined for all test steps of the target test case, and stored in the automated test script executable file in sequence, so that the new automated script step data will be persisted in the database. That is, after the corresponding script step is generated for each test step of the automated test case, a test case script is automatically generated. The automated test script can be used to perform automated testing on the storage product under test, which can save the time of testers writing automated test scripts.

[0055] In the technical solution provided in this embodiment, after the tester writes the automated test case, the test action and target information are extracted from each step of the test case. Based on the data, the script step information with the highest similarity is selected from the existing historical test script data as a template and inserted into the corresponding new test script step, thereby automatically translating the test case corresponding to the storage product to be tested and generating an automated test script, thereby improving script writing efficiency, saving labor costs, and realizing fully automated testing of storage products.

[0056] In the above embodiment, there is no limitation on how to filter the target historical test script data. Based on the above embodiment, the present invention also provides a matching method for the target historical test script data, which may include the following contents:

[0057] According to the test action and target information of each test step, candidate historical test script data with the same test action and target information are searched for the corresponding test step in the historical test database; the similarity between the historical test step text description data of each candidate historical test script data and the text description data of the corresponding test step are compared in turn, and the candidate historical test script data with the highest similarity is selected as the target historical test script data.

[0058] In order to further improve the efficiency of automated test script generation, the test script step description can be simplified, and the action keywords, target keywords and all descriptions of parameters can be extracted to form a new script step description text information. Figure 2As shown, the test action and target information may include action keywords, target keywords and step parameter names. Accordingly, after obtaining the target test case, the action keywords, target keywords and step parameter name information of each test step of the target test case are extracted as the test action and target information, and the action keywords and the target keywords are stored in the keyword field of the automated test script executable file. Then, all historical automated script step data with the same keywords as the test steps of the target test case are filtered out, and any similarity calculation method, such as the vector cosine method, is used to calculate the text similarity value between the two, and the automated script step with the highest text similarity value is selected as the target historical test script data.

[0059] As can be seen from the above, this embodiment uses a keyword combined with a similarity method to match target historical test script data from a database, which is not only conducive to improving the generation efficiency of automated test scripts, but also conducive to improving the generation accuracy of automated test scripts.

[0060] Based on the above embodiments, the present invention can also pre-construct an automated test script step table and a keyword table as an automated test script executable file. The data structure of the automated test script step table includes at least a plurality of field names, each field name corresponds to the content contained in the automated test script, each field name corresponds to a data type and text description data, the text description data is used to describe the corresponding field, and is used to store the corresponding content of the target historical script data corresponding to the target test case; the keyword table includes a keyword type and a keyword value. The action keyword and the target keyword are stored in the keyword field of the automated test script executable file.

[0061] In this embodiment, the field names include, for example, execution sequence ID, step text description, step type, step execution content, keywords, parameters and expected results. The automated test script step table may be, for example, as shown in Table 1 below, and the keyword table may be, for example, as shown in Table 2 below.

[0062] Table 1 Automated test script steps

[0063]

[0064] Table 2 Keyword table

[0065]

[0066] Among them, keywords may include action keywords and target keywords. Similarly, each historical test data of the historical test database is also processed according to the above Tables 1 and 2. Testers can manually enter keywords into the database for storage, including action keywords such as create, modify, delete, query, etc. and target keywords such as storage pool, storage volume, snapshot, backup, etc. The storage automation test platform will analyze the step table of each completed automation test script, parse the text description of the steps in the table, traverse each action keyword and target keyword, and check whether there are the same keywords. If there are keywords, fill in the keyword field in the keyword field of the automation test script step table with the keyword; if there are no keywords, mark the steps of the automation case test script in red to remind testers to make normative modifications to their step descriptions, which must include action keywords and target keywords. If the information does not exist in the keyword table, add the keyword to the keyword table. After the automated test case is written, the storage automated test platform polls each step of the automated test case. According to the extracted keywords and parameter names, the historical test database is automatically scanned according to the above method to determine the most similar target historical test script steps, and they are persisted and saved in the automated test case step table in sequence. The parameter values ​​are filled in param1, param2, param3 and param4 in the automated test script step table in turn. In this way, an automated test case automatically generates a corresponding automated test script.

[0067] As can be seen from the above, this embodiment processes data in a table format, which is beneficial to improving the generation efficiency and accuracy of automated test scripts.

[0068] Further, based on the above embodiment, the present invention also provides a method for selecting a target test case, which may include the following contents:

[0069] Read the automated test case of the storage product to be tested; if at least one test step of the automated test case does not correspond to a command line, the automated test case does not comply with the use case writing rules; if each test step of the automated test case corresponds to a command line, if the number and order of parameters in at least one command line are inconsistent with the order of text description of the corresponding test steps, the automated test case does not comply with the use case writing rules; if the number and order of parameters in each command line are consistent with the order of text description of the corresponding test steps, the automated test case is a target test case that complies with the use case writing rules.

[0070] In this embodiment, the automated test cases must be completed strictly in accordance with the writing specifications, each test step must contain only one command line, each test step description must include the test target and test action information, such as action keywords and target keywords, and the order of parameter descriptions of the test steps must be consistent. Based on this, each test case that can be read is selected according to the requirements, and only the subsequent steps are executed for the target test cases that meet the requirements, which is conducive to improving the generation efficiency of automated test scripts.

[0071] The above embodiment does not limit how to filter the target historical test script data. Based on the above embodiment, the present invention also provides a method for selecting the target historical test script data. The filtering process may include the following contents:

[0072] According to the test action and target information of each test step, candidate historical test script data with the same test action and target information are searched for the corresponding test step in the historical test database; the historical test step text description data of each candidate historical test script data is segmented to obtain the corresponding historical word segmentation information; the test step text description data of each test step is segmented to obtain the corresponding use case word segmentation information; for each test step, the use case word segmentation information of the current test step is respectively combined with the words contained in the historical word segmentation information of each candidate historical test script data for deduplication processing to obtain multiple word set information; for each word set information, the number of occurrences of each word in the current word set information in the current test step text description data and each historical test step text description data is counted to obtain the use case word frequency information of the current test step and the historical word frequency information of each candidate historical test script data, and the similarity between the current test step and each candidate historical test script data is determined according to the use case word frequency information and each historical word frequency information; the candidate historical test script data with the highest degree of similarity to each test step is used as the target historical test script data that meets the same test action and test target conditions.

[0073] In this embodiment, the storage automation test platform analyzes all historical automation test scripts in the historical test database, extracts action keywords such as create, modify, delete, query, etc. and target keywords such as storage pool, storage volume, snapshot, backup, etc. in the historical test script steps, and saves the keywords in the keyword field of the test script step table. After the tester completes the writing according to the automated test case writing rules, the storage automation test platform extracts the action keywords and target keywords for each test step, and compares them with the data already saved in the historical test database, thereby determining all candidate historical test script data with the same keywords.

[0074] For each subsequent historical test script obtained, the test step text description data of the current candidate historical test script data and the test script data are used as text data, and the words are segmented to obtain two word lists. The words contained in the two word lists are deduplicated and merged to obtain a set containing all different words of the two texts. Then, for each word in the set, the number of times it appears in the candidate historical test script data and the test step text description data of the test script data is counted, and vectorization is performed. The similarity between the two is calculated based on the vectorization result. The closest target historical test script data is found based on the similarity value between the two, and it is used as a template and inserted into the newly created automated test script executable file. The parameter values ​​in the target historical test script data are also updated to the automated test script executable file in sequence.

[0075] As a more efficient similarity calculation method, the present invention can also pre-construct a similarity quantification relationship, and calculate the similarity value between the current test step and each candidate historical test script data by calling the similarity quantification relationship; the similarity quantification relationship is:

[0076] ;

[0077] in, represents the similarity value between the current test step A and the candidate historical test script data B, k represents the total number of words contained in the word set information, Indicates the number of times the i-th word in the word set information appears in the use case word frequency information corresponding to the current test step A, Represents the number of times the i-th word in the word set information appears in the historical word frequency information corresponding to the candidate historical test script data B.

[0078] As can be seen from the above, this embodiment generally provides an efficient and high-precision similarity calculation method, which can match the most similar historical test data, and is conducive to improving the generation efficiency and generation accuracy of automated test scripts.

[0079] In order to further improve the selection accuracy and selection efficiency of target historical test script data, and thus improve the generation accuracy and generation efficiency of test scripts, based on the above embodiment, the present invention also provides another method for selecting target historical test script data, which may include the following contents:

[0080] The historical test step text description data of each candidate historical test script data and the text length of the test step text description data of each test step are obtained.

[0081] If the text length is greater than the preset length threshold, the historical test step text description data and the test step text description data are segmented to obtain a valid feature vector, and then a multi-level weight is set for each feature vector according to any weight value calculation method, such as the TF-IDF (term frequency-inverse term frequency) algorithm. For example, 5 levels of weights can be set.

[0082] The hash value of each feature vector is calculated by a hash function. The hash value is an n-bit signature composed of binary numbers 01. For example, the hash value Hash(Life) of "Mechanical Hard Drive" is 110101, and the hash value Hash(No) of "Capacity" is "101001". In this way, the string becomes a series of numbers. Based on the hash value, all feature vectors are weighted, that is, W=Hash*weight, and when 1 is encountered, the hash value and the weight are positively multiplied, and when 0 is encountered, the hash value and the weight are negatively multiplied. For example, the hash value "110101" of "Mechanical Hard Drive" is weighted to obtain: W(Mechanical Hard Drive) = 110101*5=5 5 -5 5 -55, and the hash value "101001" of "Capacity" is weighted to obtain: W(Capacity)=101001 * 2 = 2 -2 2 -2 -2 2, and the remaining feature vectors are similarly operated. The weighted results of the above-mentioned feature vectors are accumulated to become only one sequence string. Take the first two feature vectors as examples, such as "5 5 -5 5 -5 5" of "mechanical hard disk" and "2 -2 2 -2 -2 2" of "capacity" and accumulate them to get "5+2, 5-2, -5+2, 5-2, -5-2, 5+2", and get "7 3 -3 3 -7 7". For the accumulated result of the n-bit signature, if it is greater than 0, it is set to 1, otherwise it is set to 0, so as to obtain the similarity degree value of the historical test step text description data or the test step text description data, and the similarity between the test step text description data and different historical test step text description data can be used to judge the similarity between the two. For example, the "9 -9 1 -1 1 9" calculated above is reduced in dimension (a bit greater than 0 is recorded as 1, and less than 0 is recorded as 0), and the 01 string obtained is: "1 1 0 1 0 1", thereby forming their similarity signatures.

[0083] For example, when the number of characters is 20, the calculation process of the target historical test script data of the above embodiment takes 0.4s, while the calculation process of the target historical test script data of the present embodiment takes 1.7s; when the number of characters is 200, the calculation process of the target historical test script data of the above embodiment takes 1.8s, while the calculation process of the target historical test script data of the present embodiment takes 4.2s; when the number of characters is 2000, the calculation process of the target historical test script data of the above embodiment takes 10.7s, while the calculation process of the target historical test script data of the present embodiment takes 20s; when the number of characters is 20000, the calculation process of the target historical test script data of the above embodiment takes 34.0s, while the calculation process of the target historical test script data of the present embodiment takes 24.1s; when the number of characters is 200000, the calculation process of the target historical test script data of the above embodiment takes 668.6s, while the calculation process of the target historical test script data of the present embodiment takes 176.7s. It can be seen that the time required for the target history test script data provided by this embodiment is more friendly to long texts, while the time required for the target history test script data provided by the above embodiment is more friendly to short texts. Therefore, the present invention can set the text threshold in advance according to the actual scenario, and select different target history test script data methods based on different text lengths.

[0084] As can be seen from the above, this embodiment further improves the generation efficiency and accuracy of test scripts by selecting a method for selecting target historical test script data of different lengths.

[0085] It is understandable that after S102, it may not be possible to find the target historical test script data that meets the same test action and test target conditions. This may be because such test script does not exist or because the search information is missing. Based on this, the present invention further provides the following embodiments, which may include the following contents:

[0086] If there is a target test step that is not matched to the target historical test script data, then a check is made in each historical test step text description data to determine whether there is target historical test step text description data that contains the action keyword and target keyword of the target test step; if there is target historical test step text description data, then the historical test script data corresponding to the target historical test step text description data is used as the target historical test script data.

[0087] In this embodiment, if no similar target historical test script data is found, the reason why it does not exist can be detected first. Since the present invention uses test actions and target information as search conditions, it may be that the test actions and target information do not have a corresponding relationship with the corresponding historical test data. This embodiment uses action keywords and target keywords as test actions and target information, and the action keywords and target keywords are stored in a pre-built keyword table. The keyword table can constitute a keyword database. Correspondingly,

[0088] If some keywords in the historical test step text description data do not exist in the keyword database, the corresponding keywords will be filled into the keyword database, and the target keywords and action words will be re-extracted, and the above steps will be re-executed to automatically match the target historical test script data. If the same keyword is not found, an empty data can be inserted here and marked in red to prompt the tester to manually modify the test step to manually write the corresponding automated test script step. The tester manually adds the corresponding script steps and adds the corresponding command line and parameters. At the same time, the corresponding action keywords and target keywords can be filled into the historical test database. In this way, when writing the use case steps with the same action keywords and target keywords in the future, the script steps corresponding to the steps can be automatically generated.

[0089] As can be seen from the above, this embodiment distinguishes whether the keyword does not exist or the type of automated script step does not exist for the scenario where the target historical test script data cannot be matched, and performs corresponding processing, which is conducive to improving the generation efficiency of automated test scripts.

[0090] It should be noted that there is no strict order of execution between the steps in the present invention. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1-Figure 2 This is just a schematic and does not mean that this is the only execution order.

[0091] The present invention also provides a corresponding device for the storage product automated testing method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The storage product automated testing device provided by the present invention is introduced below. The device is used to implement the storage product automated testing method provided by the present invention. In this embodiment, the storage product automated testing device may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the storage product automated testing method disclosed in Example 1. The program module referred to in this embodiment refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the storage product automated testing device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The storage product automated testing device described below and the storage product automated testing method described above can be referenced to each other.

[0092] From the perspective of functional modules, see Figure 3 , Figure 3 The structure diagram of the storage product automatic testing device provided in this embodiment under a specific implementation manner, the device may include:

[0093] The use case identification module 301 is used to obtain a target test case of the storage product to be tested that meets the use case writing rules, and extract the test actions and target information corresponding to each test step of the target test case; the use case writing rules are that the test steps correspond to the command lines one by one, and the number and order of parameters of the command lines are consistent with the order of the corresponding test step text descriptions;

[0094] A screening module 302 is used to match target historical test script data that meets the same test action and test target conditions for each test step in a historical test database based on the test step text description data, test action and target information of each test step; wherein the historical test database includes a plurality of historical test script data, each of which includes at least historical test step text description data and historical test action and target information;

[0095] The script generation module 303 is used to insert the target historical test script data and test actions and target information corresponding to each test step into a pre-built automated test script executable file to obtain the automated test script corresponding to the target test case, so as to perform automated testing on the storage product to be tested based on the automated test script.

[0096] For example, in some implementations of this embodiment, the screening module 302 may also be used to:

[0097] According to the test action and target information of each test step, searching the historical test database for candidate historical test script data having the same test action and target information for the corresponding test step;

[0098] The similarities between the historical test step text description data of each candidate historical test script data and the text description data of the corresponding test step are compared in turn, and the candidate historical test script data with the highest similarity is selected as the target historical test script data.

[0099] Illustratively, in some other implementations of this embodiment, the use case identification module 301 may also be used to:

[0100] Extracting action keywords, target keywords and step parameter name information of each test step of the target test case as test action and target information;

[0101] The action keyword and the target keyword are stored in the keyword field of the automated test script executable file.

[0102] Exemplarily, in some other implementations of this embodiment, the above device may further include a table construction module, which may be used to:

[0103] Pre-build the automated test script step table and keyword table as the automated test script executable file;

[0104] Among them, the data structure of the automated test script step table includes at least multiple field names, each field name corresponds to the content contained in the automated test script, each field name corresponds to a data type and text description data, the text description data is used to describe the corresponding field, and is used to store the corresponding content of the target historical script data corresponding to the target test case; the keyword table includes keyword type and keyword value.

[0105] Illustratively, in some other implementations of this embodiment, the use case identification module 301 may also be used to:

[0106] Read the automated test cases for the storage product to be tested;

[0107] If at least one test step of the automated test case does not correspond to a command line, the automated test case does not comply with the test case writing rules;

[0108] If each test step of the automated test case corresponds to a command line, if the number and order of parameters in at least one command line are inconsistent with the corresponding test step text description order, the automated test case does not comply with the use case writing rules; if the number and order of parameters in each command line are consistent with the corresponding test step text description order, the automated test case is a target test case that complies with the use case writing rules.

[0109] For example, in some other implementations of this embodiment, the screening module 302 may also be used to:

[0110] According to the test action and target information of each test step, searching the historical test database for candidate historical test script data having the same test action and target information for the corresponding test step;

[0111] Perform word segmentation processing on the historical test step text description data of each candidate historical test script data to obtain the corresponding historical word segmentation information; perform word segmentation processing on the test step text description data of each test step to obtain the corresponding use case word segmentation information;

[0112] For each test step, the use case word segmentation information of the current test step is respectively combined with the words contained in the historical word segmentation information of each candidate historical test script data for deduplication processing to obtain multiple word set information; for each word set information, the number of occurrences of each word in the current word set information in the current test step text description data and each historical test step text description data is counted to obtain the use case word frequency information of the current test step and the historical word frequency information of each candidate historical test script data, and according to the use case word frequency information and each historical word frequency information, the similarity between the current test step and each candidate historical test script data is determined;

[0113] The candidate historical test script data with the highest degree of similarity to each test step is used as the target historical test script data that satisfies the same test action and test target conditions.

[0114] For example, in some other implementations of this embodiment, the above device may further include a verification module, which may be used to:

[0115] If there is a target test step that is not matched to the target historical test script data, then detecting whether there is target historical test step text description data containing the action keyword and target keyword of the target test step in each historical test step text description data;

[0116] If target historical test step text description data exists, the historical test script data corresponding to the target historical test step text description data is used as the target historical test script data.

[0117] The functions of the functional modules of the storage product automated testing device described in this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0118] As can be seen from the above, this embodiment can automatically translate the test cases corresponding to the storage product to be tested and generate an automated test script, thereby achieving fully automated testing of the storage product.

[0119] The storage product automated testing device mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 4 The following is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention in one implementation manner. Figure 4 As shown, the electronic device includes a memory 40 for storing computer programs; a processor 41 for implementing the steps of the storage product automatic testing method mentioned in any of the above embodiments when executing the computer program.

[0120] Among them, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 41 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 41 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 41 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 41 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 41 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0121] The memory 40 may include one or more computer non-volatile storage media, which may be non-transitory. The memory 40 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the memory 40 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 40 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 40 may also include both an internal storage unit of an electronic device and an external storage device. The memory 40 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the storage product automated testing method, etc., but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 40 is at least used to store the following computer program 401, wherein, after the computer program is loaded and executed by the processor 41, the relevant steps of the storage product automated testing method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, and the storage method may be temporary storage or permanent storage. The operating system 402 may include Windows, Unix, Linux, etc. The data 403 may include, but is not limited to, data corresponding to the storage of product automated test results.

[0122] In some embodiments, the electronic device may further include a display screen 42, an input / output interface 43, a communication interface 44 or a network interface, a power supply 45 and a communication bus 46. Among them, the display screen 42 and the input / output interface 43, such as a keyboard, belong to the user interface, and exemplary user interfaces may also include standard wired interfaces, wireless interfaces, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 44 may exemplarily include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 46 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0123] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than those shown in the figure, for example, it may also include a sensor 47 for realizing various functions.

[0124] It is understandable that if the storage product automated testing method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the storage product automated testing method recorded in any of the above embodiments are performed.

[0125] It is understandable that if the storage product automated testing method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product does not need to be stored in a physical storage medium. For example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to perform all or part of the steps of the methods of each embodiment of the present invention. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product that stores a computer program. When the computer program is executed by a processor, the steps of the storage product automated testing method described in any of the above embodiments are performed.

[0126] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices, electronic devices, and non-volatile storage media, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0127] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0128] The above is a detailed introduction to an automated testing method, device, electronic device and non-volatile storage medium for storage products provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that based on the embodiments of the present invention, for ordinary technicians in this technical field, all other embodiments obtained without creative work are within the scope of protection of the present invention. Without departing from the principles of the present invention, the present invention may also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A storage product automated testing method, characterized in that: include: Obtain a target test case for the storage product to be tested that complies with the test case writing rules, and extract the test actions and target information corresponding to each test step of the target test case; the test case writing rules are that the test steps correspond to the command lines one by one, and the number and order of parameters of the command lines are consistent with the order of the corresponding test step text descriptions; Based on the test step text description data, test action and target information of each test step, target historical test script data satisfying the same test action and test target conditions are matched for each test step in the historical test database; wherein the historical test database includes a plurality of historical test script data, each historical test script data at least includes historical test step text description data and historical test action and target information; The target historical test script data and test actions and target information corresponding to each test step are inserted into a pre-built automated test script executable file to obtain an automated test script corresponding to the target test case, so as to perform automated testing on the storage product to be tested based on the automated test script.

2. The storage product automated testing method according to claim 1, characterized in that: The test step text description data, test action and target information of each test step are used to match the target historical test script data that meets the same test action and test target conditions in the historical test database for each test step, including: According to the test action and target information of each test step, searching the historical test database for candidate historical test script data having the same test action and target information for the corresponding test step; The similarities between the historical test step text description data of each candidate historical test script data and the text description data of the corresponding test step are compared in turn, and the candidate historical test script data with the highest similarity is selected as the target historical test script data.

3. The storage product automated testing method according to claim 1, characterized in that: The extracting the test actions and target information corresponding to each test step of the target test case includes: Extracting action keywords, target keywords and step parameter name information of each test step of the target test case as test action and target information; The action keyword and the target keyword are stored in the keyword field of the automated test script executable file.

4. The storage product automated testing method according to claim 1, characterized in that: Before inserting into the pre-built automated test script executable file, it also includes: Pre-build the automated test script step table and keyword table as the automated test script executable file; Among them, the data structure of the automated test script step table includes at least multiple field names, each field name corresponds to the content contained in the automated test script, each field name corresponds to a data type and text description data, the text description data is used to describe the corresponding field, and is used to store the corresponding content of the target historical script data corresponding to the target test case; the keyword table includes keyword types and keyword values, and is used to store keyword information of the automated test script.

5. The storage product automated testing method according to claim 1, characterized in that: The step of obtaining a target test case for the storage product to be tested that complies with the test case writing rules includes: Read the automated test cases for the storage product to be tested; If at least one test step of the automated test case does not correspond to a command line, the automated test case does not comply with the test case writing rules; If each test step of the automated test case corresponds to a command line, if the number and order of parameters in at least one command line are inconsistent with the corresponding test step text description order, the automated test case does not comply with the use case writing rules; if the number and order of parameters in each command line are consistent with the corresponding test step text description order, the automated test case is a target test case that complies with the use case writing rules.

6. The storage product automated testing method according to claim 1, characterized in that: After matching the target historical test script data satisfying the same test action and test target conditions in the historical test database for each test step, the method further includes: If there is a target test step that is not matched to the target historical test script data, then detecting whether there is target historical test step text description data containing the action keyword and target keyword of the target test step in each historical test step text description data; If target historical test step text description data exists, the historical test script data corresponding to the target historical test step text description data is used as the target historical test script data.

7. The storage product automated testing method according to any one of claims 1 to 6, characterized in that: The method of matching the target historical test script data satisfying the same test action and test target conditions in the historical test database for each test step includes: According to the test action and target information of each test step, searching the historical test database for candidate historical test script data having the same test action and target information for the corresponding test step; Perform word segmentation processing on the historical test step text description data of each candidate historical test script data to obtain the historical word segmentation information corresponding to each candidate historical test script data; perform word segmentation processing on the test step text description data of each test step to obtain the use case word segmentation information corresponding to each candidate historical test script data; For each test step, the use case word segmentation information of the current test step is respectively combined with the words contained in the historical word segmentation information of each candidate historical test script data for deduplication processing to obtain multiple word set information; for each word set information, the number of occurrences of each word in the current word set information in the current test step text description data and each historical test step text description data is counted to obtain the use case word frequency information of the current test step and the historical word frequency information of each candidate historical test script data, and according to the use case word frequency information and each historical word frequency information, the similarity between the current test step and each candidate historical test script data is determined; The candidate historical test script data with the highest degree of similarity to each test step is used as the target historical test script data that meets the same test action and test target conditions.

8. A storage product automated testing device, characterized in that: include: A use case identification module is used to obtain a target test case for the storage product to be tested that meets the use case writing rules, and extract the test actions and target information corresponding to each test step of the target test case; the use case writing rules are that the test steps correspond to the command lines one by one, and the number and order of parameters of the command lines are consistent with the order of the corresponding test step text descriptions; A screening module is used to match target historical test script data that meets the same test action and test target conditions for each test step in a historical test database based on the test step text description data, test action and target information of each test step; wherein the historical test database includes a plurality of historical test script data, each of which includes at least historical test step text description data and historical test action and target information; The script generation module is used to insert the target historical test script data and test actions and target information corresponding to each test step into a pre-built automated test script executable file to obtain the automated test script corresponding to the target test case, so as to perform automated testing on the storage product to be tested based on the automated test script.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to implement the steps of the storage product automatic testing method as claimed in any one of claims 1 to 7 when executing the computer program stored in the memory.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the storage product automated testing method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Automatic test method and device

    CN108075938A

  • Test script generation method and device of test case and electronic equipment

    CN118092881A

  • Test script generation method and device, equipment and storage medium

    CN118484371A

  • Marked test script creation

    US20140215440A1

  • Automated Ontology Development

    US20140222419A1