Automated testing method, device, equipment and system for software function changes

By obtaining and analyzing the old and new version codes of the software, matching keywords and functional tags, building a test case set, and conducting automated testing, the problem of low software quality detection efficiency in the existing technology is solved, and the rapid generation of test reports is achieved and improve testing efficiency.

CN114048129BActive Publication Date: 2024-12-20CCB FINTECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111324467.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2024-12-20
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

The existing technology cannot quickly generate test reports during the development of agile model products, and cannot meet the requirements of rapid production of software products, resulting in low software quality inspection efficiency.

Method used

By obtaining the old version code, new version code and annotation information of the software to be tested, performing natural semantic analysis, matching keywords and functional labels, building a test case set, and testing based on an automated test framework, saving manual analysis and compilation time and improving Test efficiency.

Benefits of technology

It realizes the rapid generation of test reports, meets the needs of rapid iteration and production of software products, improves testing efficiency, and reduces the work burden of staff.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048129B_ABST
    Figure CN114048129B_ABST
Patent Text Reader

Abstract

The present invention provides an automated testing method, device, equipment and system for software function changes, wherein the method comprises: obtaining an old version code, a new version code and annotation information corresponding to the new version code of the software to be tested, comparing the old version code and the new version code of the software to be tested to obtain the changed code in the new version code, performing natural semantic analysis on the annotation information to obtain keywords in the annotation information, matching the keywords with function tags to obtain matching function tags, placing test cases corresponding to the matching function tags into a test set to be regressed, testing the software to be tested according to the changed code and the test set to be regressed, performing natural semantic analysis on the annotation information by obtaining the changed code and the annotation information to obtain corresponding test cases, and then executing automated testing to improve testing efficiency and meet the needs of rapid product iteration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an automated testing method, device, equipment and system for software function changes. Background Art

[0002] With the development of technology, various applications and application software have emerged. In the early days, these applications were usually put online after developers and some users gave corresponding modification suggestions after using them. Since there were no standardized software tests, these software will have some bugs (vulnerabilities) to a greater or lesser extent. These bugs may be problems in terms of functionality, compatibility, performance, etc. In order to improve the problem of low software quality, the software testing industry began to rise.

[0003] At present, the existing technology is to manually organize code changes and merge new functions, manually analyze the test points of these changes and new functions, obtain possible problems through testing, and make improvements to provide guarantees for subsequent products launched.

[0004] However, this method often cannot quickly produce test reports during the agile model product development process and cannot meet the requirements for rapid production of software products. Summary of the invention

[0005] The embodiments of the present invention provide a method, device, equipment and system for automated testing of software function changes, which can quickly generate a test report and meet the requirements for rapid production of software products.

[0006] In a first aspect, an embodiment of the present invention provides an automated testing method for software function changes, the method comprising:

[0007] Obtain the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested;

[0008] Compare the old version code and the new version code of the software to be tested to obtain the changed code in the new version code;

[0009] Performing natural semantic analysis on the annotation information to obtain keywords in the annotation information;

[0010] By matching the keywords with the function labels, matching function labels are obtained, and test cases corresponding to the matching function labels are put into the regression test set to be tested;

[0011] The software to be tested is tested according to the changed code and the regression test set to be tested.

[0012] Optionally, testing the software to be tested according to the changed code and the regression test set to be tested includes:

[0013] Perform unit testing on the changed code;

[0014] Performing automated interface testing on the interface corresponding to the changed code;

[0015] Based on the automated testing framework, automated testing is performed on all test cases in the regression test set;

[0016] Output the test results.

[0017] Optionally, the method further includes:

[0018] Obtaining multiple test cases of the software to be tested and a function label corresponding to each test case;

[0019] Determining keywords based on keywords input by a user, and / or based on a business rule description text input by a user and based on the business rule description text;

[0020] Build a business function corpus based on keywords.

[0021] Optionally, performing natural semantic analysis on the annotation information to obtain keywords in the annotation information includes:

[0022] Matching the first character in the annotation information with the first character of each keyword in the business function corpus to determine at least one keyword that is successfully matched;

[0023] For each keyword in the at least one keyword, matching the keyword with the first N characters in the annotation information, where N is the number of characters in the keyword;

[0024] If the keyword matches successfully, the first N characters are split from the annotation information;

[0025] The above steps are repeated for the remaining characters in the annotation information until the annotation information is completely split.

[0026] Optionally, determining keywords according to the business rule description text includes:

[0027] Generate multiple character combinations according to the business rule description text; wherein each character combination is a combination of multiple adjacent characters in the business rule description text, and the number of characters in the character combination is less than a first preset threshold;

[0028] For each character combination, calculate the first number and the second number corresponding to the character combination, wherein the first number is the number of times the character combination appears in the business rule description text, and the second number is the sum of the number of times each character in the character combination appears in the business rule description text;

[0029] If the ratio of the first number of times to the second number of times is greater than a second preset threshold, the character combination is determined to be a keyword.

[0030] Optionally, the keyword is matched with the function tag to obtain the matching function tag, including:

[0031] For each function tag, if the keyword matches at least one character in the function tag, the function tag is a matching function tag.

[0032] In a second aspect, an embodiment of the present invention provides an automated testing device for software function changes, the device comprising:

[0033] An acquisition module is used to acquire the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested;

[0034] The first obtaining module is used to compare the old version code and the new version code of the software to be tested to obtain the changed code in the new version code;

[0035] The second obtaining module is used to perform natural semantic analysis on the annotation information to obtain keywords in the annotation information;

[0036] The third obtaining module is used to match the keywords with the function labels to obtain the matching function labels, and put the test cases corresponding to the matching function labels into the regression test set;

[0037] A testing module is used to test the software to be tested according to the changed code and the regression test set to be tested.

[0038] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0039] The memory stores computer-executable instructions;

[0040] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects above.

[0041] In a fourth aspect, an embodiment of the present invention provides an automated testing system for software function changes, including:

[0042] The version server is used to provide the old version code, new version code and annotation information to the main server;

[0043] The proxy server is used to obtain the changed code and the regression test set sent by the main server and send them to the test device;

[0044] The testing device is used to receive the changed code and the regression test set to be sent by the proxy server, and test the software to be tested.

[0045] The main server is used to execute the method described in any one of the first aspects.

[0046] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method described in any one of the first aspects above.

[0047] In a sixth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in any one of the first aspects above.

[0048] The automated testing method, apparatus, equipment and system for software function change provided by the embodiments of the present invention obtain the old version code, new version code and annotation information corresponding to the new version code of the software to be tested, compare the old version code and the new version code of the software to be tested to obtain the change code in the new version code, perform natural semantic analysis on the annotation information to obtain the keywords in the annotation information, match the keywords with function tags to obtain matching function tags, put the test cases corresponding to the matching function tags into a regression test set, test the software to be tested according to the change code and the regression test set, obtain the change code and annotation information, perform natural semantic analysis on the annotation information to obtain the corresponding test case, and then perform automated testing, thereby saving the time of staff manually analyzing the change code and compiling test cases, improving testing efficiency, and meeting the needs of rapid product iteration. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0050] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention;

[0051] Figure 2 A flow chart of a conventional testing method for mobile terminal software changes provided by an embodiment of the present invention;

[0052] Figure 3 A flowchart of an automated testing method for software function changes provided by an embodiment of the present invention;

[0053] Figure 4 A flowchart of another automated testing method for software function changes provided by an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of the structure of an automated testing device for software function changes provided by an embodiment of the present invention;

[0055] Figure 6 A schematic diagram of the structure of an automated testing device for software function changes provided by an embodiment of the present invention;

[0056] Figure 7 A schematic diagram of an automated testing system for software function changes is provided in accordance with an embodiment of the present invention.

[0057] The above drawings have shown clear embodiments of the present invention, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0059] The following specific embodiments are used to describe in detail the technical solution of the present invention and how the technical solution of the present invention solves the above technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0060] An application scenario provided by an embodiment of the present invention is explained below: The solution provided by an embodiment of the present invention involves testing of software function changes. With the continuous development of technology, software functions are also constantly updated and iterated. Software testing is required for the updated software before it can be put into use.

[0061] In actual applications, users need to update the software before they can enjoy the updated functions. Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention. Figure 1As shown, the embodiment of the present invention can be applied to a mobile terminal, such as a mobile phone. In an application software of the mobile phone, there are functions of transferring and receiving money. When the application software is updated, a red envelope function is added, so that users can realize the function of sending and receiving red envelopes on the application software.

[0062] In some technologies, Figure 2 A flow chart of a conventional testing method for mobile terminal software changes provided by an embodiment of the present invention is as follows: Figure 2 As shown, the testing method for mobile terminal software changes can be to manually organize code changes and merged new functions, manually analyze code changes and function change descriptions, form a test plan, and then manually execute test cases. If all test cases pass the test, the test is terminated. If some test cases fail among all test cases, the test continues to be performed to test the changed functions. This method can ensure quality requirements in waterfall model product development, but it often cannot quickly provide test reports in agile model products and cannot meet the requirements of rapid iteration and rapid production.

[0063] The waterfall model is a classic software life cycle model. In this model, the project team focuses on defining the overall scope of the product and project, then develops a product delivery plan, and then executes it through various stages, including feasibility analysis, requirements analysis, outline design, detailed design, coding, testing, and operation and maintenance. If there is a new scope, it needs to be replanned and formally confirmed.

[0064] The Agile model is an iterative development software engineering method that breaks down tasks into smaller iterations and determines the project scope and requirements during the development process. Each iteration includes the work of the entire software development cycle, including planning, requirements analysis, design, coding, and testing.

[0065] Therefore, an embodiment of the present invention provides an automated testing method for software function changes, which obtains the new and old version codes of the software to be tested, and the annotation information corresponding to the new version code, obtains the corresponding change code in the new version code, performs natural semantic analysis on the annotation information, obtains the keywords therein, matches the keywords with the function tags, puts the test cases corresponding to the matching function tags into a regression test set, tests the software to be tested according to the change code and the regression test set, and constructs a method for automatically executing test cases based on the natural semantic analysis of the annotation information, which saves the time of staff in manually analyzing the change code and compiling the test cases, thereby improving the testing efficiency.

[0066] In the following, some embodiments of the present invention are described in detail in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and features in the embodiments can be combined with each other.

[0067] Figure 3 The following is a flow chart of an automated testing method for software function changes provided by an embodiment of the present invention. Figure 3 As shown, the method in this embodiment may include:

[0068] Step 301: Obtain the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested.

[0069] The annotation information can be a standardized and clear description of the changed functions for developers when submitting a new version of the code, for example: credit card transfer repayment within the same bank, debit card inter-bank transfer, etc.

[0070] The old version code may be the code of the current version of the software to be tested, and the new version code may be the version code to which the software to be tested will be updated soon.

[0071] Optionally, the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested can be obtained through the main server.

[0072] The main server can connect to the code hosting server and obtain the old version code and the new version code through the git whatchanged command. The code hosting server can be a git code repository.

[0073] The master server can connect to the version server and obtain the comment information corresponding to the new version code through the git log command.

[0074] Step 302: Compare the old version code and the new version code of the software to be tested to obtain the changed code in the new version code.

[0075] Optionally, the old version code and the new version code of the software to be tested may be compared by using a code comparison tool to obtain the lines where the unchanged code and the changed code are located in the new version code.

[0076] Step 303: Perform natural semantic analysis on the annotation information to obtain keywords in the annotation information.

[0077] Among them, natural semantic analysis is that computers use natural language processing methods to study the meaning and structure of words, realize the division of sentences, and obtain the words in the sentences.

[0078] Optionally, the annotation information may be subjected to natural semantic analysis by a computer, by splitting the words in the annotation information, and detecting whether the split words match the words stored in the computer. If they match, the split words are the key words of the annotation information.

[0079] For example, the annotation information "debit card bank transfer" is split into words. When "debit" is split, the word cannot be matched with the words stored in the computer, then the word is not a keyword in the annotation information. When "debit card" is split, the word can be matched with the words stored in the computer, then the word is a keyword in the annotation information.

[0080] Step 304: Match the keywords with the function labels to obtain matching function labels, and put the test cases corresponding to the matching function labels into the regression test set.

[0081] The function label can be a text describing the functionality, such as: opening a new account, credit card repayment, etc. There is a one-to-one correspondence between the function label and the test case, and the test case can be used to test the function corresponding to the function label. The test case can be a UI (User Interface) automation test case.

[0082] Optionally, by matching keywords with function labels, multiple function labels corresponding to the keywords can be obtained, and test cases corresponding to the multiple function labels can be put into the regression test set.

[0083] For example, if the keyword is transfer, the corresponding function tags may be transfer repayment, inter-bank transfer, and intra-bank transfer, etc. The test cases corresponding to the function tags such as transfer repayment, inter-bank transfer, and intra-bank transfer are put into the regression test set.

[0084] Step 305: Test the software to be tested according to the changed code and the regression test set to be tested.

[0085] Optionally, the software to be tested can be tested based on the changed code to test whether there are vulnerabilities in the changed code in the software to be tested, and whether the changed code has an impact on the unchanged code, affecting the operation of the previously unchanged code.

[0086] You can also test the changed functions in the software to be tested based on the regression test set to test whether there are vulnerabilities in the changed functions and whether the changed functions have any impact on the unchanged functions.

[0087] The automated testing method for software function changes provided in the present embodiment obtains the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested, compares the old version code and the new version code of the software to be tested to obtain the changed code in the new version code, performs natural semantic analysis on the annotation information to obtain the keywords in the annotation information, matches the keywords with the function tags to obtain the matching function tags, puts the test cases corresponding to the matching function tags into a regression test set, tests the software to be tested according to the changed code and the regression test set, obtains the changed code and the annotation information, performs natural semantic analysis on the annotation information to obtain the corresponding test cases, and then performs automated testing, thereby saving the time of staff in manually analyzing the change code and compiling test cases, improving the testing efficiency, and meeting the needs of rapid product iteration.

[0088] On the basis of the technical solution provided in the above embodiment, optionally, testing the software to be tested according to the changed code and the regression test set to be tested includes:

[0089] Perform unit testing on the changed code; perform automated interface testing on the interface corresponding to the changed code; perform automated testing on all test cases in the regression test set based on an automated testing framework; and output the test results.

[0090] Optionally, the classes and methods that need to be tested are determined based on the line where the changed code is located, that is, based on the line where the changed code is located, determine which classes and methods are actually changed in the new version of the code, and perform unit testing on them to detect whether there are vulnerabilities in the code and obtain corresponding test results. When performing unit testing on the changed code, if all the test results obtained are passed, the changed code is executed normally. If some of the test results obtained do not pass, multiple tests can be performed to avoid inaccurate test results due to network problems. If some tests still fail after multiple tests, they can also be modified and corrected manually.

[0091] Among them, during unit testing, it can be implemented through a unit testing framework, for example, it can be implemented through methods such as code and review.

[0092] Optionally, according to the interface involved in the changed code, perform automated interface testing to test the changed functions corresponding to the changed code, not the test performed on the UI interface, and perform statistics on the output test results. If all the test results obtained are passed, the functions corresponding to the changed code are executed normally. If some of the test results obtained do not pass, multiple tests can be performed to avoid inaccurate test results due to network problems. If some of the tests still fail after multiple tests, they can also be modified and corrected manually. Among them, automated interface testing can be implemented through tools such as postman, jmeter, and loadrunner.

[0093] Optionally, you can execute the test cases in the regression test set based on automated testing frameworks such as Appium or uiautomator, and collect statistics on the execution results. If all test cases pass, the test is completed. If some test cases fail, you can test the failed test cases multiple times. If they still fail, you can perform corrective tests manually.

[0094] Optionally, the staff can also obtain a test report corresponding to the software to be tested based on the test results to help the staff adjust the software to be tested based on the test report.

[0095] By performing unit testing on the changed code, performing automated interface testing on the interface corresponding to the changed code, and performing automated testing on the test cases in the regression test set, it is possible to test the changed code and changed functions, improve the automation of testing, and improve testing efficiency.

[0096] Optionally, the method further includes: obtaining multiple test cases of the software to be tested and function labels corresponding to each test case; determining keywords based on keywords input by a user and / or based on a business rule description text input by a user and based on the business rule description text; and constructing a business function corpus based on keywords. Optionally, before obtaining the code and annotation information of the software to be tested, multiple test cases of the software to be tested and function labels corresponding to each test case may be obtained. Among them, the user may write a test case for the software to be tested and annotate the function points of each test case to obtain the function label corresponding to each test case.

[0097] Optionally, before obtaining the code and annotation information of the software to be tested, a business function corpus may be constructed according to keywords input by the user, wherein the keywords may be words that may be involved in the relevant software extracted by the user.

[0098] Optionally, corresponding keywords may be determined according to the business rule description text input by the user, and a business function corpus may be constructed according to the keywords.

[0099] Optionally, corresponding keywords may be determined based on keywords input by the user and business rule description text input by the user, the keywords obtained from the two may be combined to obtain final keywords, and a business function corpus may be constructed based on the final keywords.

[0100] Exemplarily, the keywords may be debit card, transfer, etc., and the business rule description text may be the business function of querying debit card repayment, the business function of debit card transfer, etc.

[0101] By obtaining the functional label corresponding to each test case and constructing a functional corpus, it can be used to improve the natural semantic analysis of annotation information and obtain accurate keywords and corresponding functional labels.

[0102] Optionally, determining keywords according to the business rule description text includes:

[0103] Generate multiple character combinations based on the business rule description text; wherein each character combination is a combination of multiple adjacent characters in the business rule description text, and the number of characters in the character combination is less than a first preset threshold; for each character combination, calculate a first number and a second number corresponding to the character combination, wherein the first number is the number of times the character combination appears in the business rule description text, and the second number is the sum of the number of times each character in the character combination appears in the business rule description text; if the ratio of the first number to the second number is greater than a second preset threshold, determine that the character combination is a keyword.

[0104] The first preset threshold value may be manually set, and may be set to 4, 5, etc. The second preset threshold value may also be manually set, and may be 0.2, 0.3, etc.

[0105] According to the first preset threshold, multiple character combinations in the business rule description text that are smaller than the first preset threshold can be counted. For example, when the first preset threshold is 5, 2, 3 or 4 character combinations in the business rule description text can be counted respectively.

[0106] Optionally, for each character combination, the number of times the character combination appears in the business rule description text is the first number, the sum of the number of times each character in the character combination appears in the business rule description text is the second number, and the ratio of the first number to the second number is calculated. When the obtained ratio is greater than a second preset threshold, the character combination is a keyword.

[0107] Specifically, for the character combination with 2 characters, the first number of occurrences of the two-character combination "transfer" in the business rule description text is calculated to be 200, and the second number of occurrences of each character in the two-character combination in the business rule description text is calculated to be 800. The ratio of the first number to the second number is 0.25, which is greater than the second preset threshold value of 0.2, and the two-character combination "transfer" is determined to be a keyword.

[0108] The efficiency of determining the keyword is improved by calculating the ratio of the first number to the second number corresponding to the character combination in the business rule description text, and determining the keyword when the ratio is greater than the second preset threshold.

[0109] Optionally, performing natural semantic analysis on the annotation information to obtain keywords in the annotation information includes:

[0110] Match the first character in the annotation information with the first character of each keyword in the business function corpus to determine at least one keyword that is successfully matched; for each keyword in the at least one keyword, match the keyword with the first N characters in the annotation information, where N is the number of characters in the keyword; if the keyword is successfully matched, split the first N characters from the annotation information; for the remaining characters in the annotation information, repeat the above steps until the annotation information is completely split.

[0111] Optionally, the first character in the annotation information is matched with the first character of each keyword in the business function corpus. If the match is successful, at least one successfully matched keyword is obtained, and whether it matches the first N words in the annotation information is determined based on the at least one successfully matched keyword. If the match is successful, the words of the first N characters in the annotation information can be split out. If the match is unsuccessful, there is no at least one successfully matched keyword in the annotation information, and the second character in the annotation information can be matched with the first character of each keyword in the business function corpus. If each character in the annotation information cannot be successfully matched with the first character in the keyword, the information in the annotation information does not exist in the business function corpus, and a "Keywords that were not successfully matched" dialog box is displayed to the user to remind the user to change the sentence in the annotation information.

[0112] If the first keyword is separated from the annotation information, the above operation may be performed according to the first characters of the remaining words in the annotation information until all the keywords in the annotation information are separated.

[0113] Exemplarily, the annotation information is ABCED, and the keywords in the business function corpus are AB, DC and CED. The first character in the annotation information is matched with the first character of each keyword in the business function corpus, and the keyword that can be matched is AB. Then, it is determined whether the keyword AB matches the first two characters of the annotation information. If so, the keyword AB in the annotation information is split out. Then, the first character C of the remaining word CED in the annotation information is matched with the first character in the keyword, and the keyword CED can be matched. It is determined whether the keyword CED matches the first three characters of the annotation information. If so, the keyword CED in the annotation information is split out.

[0114] The annotation information is split according to the keywords in the business function corpus, and according to the matching relationship, the accuracy of obtaining the keywords in the annotation information can be improved.

[0115] Optionally, the matching function tags are obtained by matching the keywords with the function tags, including: for each function tag, if the keyword matches at least one character in the function tag, the function tag is a matching function tag.

[0116] Optionally, a keyword may be matched with at least one character in each function tag. If the match is successful, the function tag is a matching function tag.

[0117] Exemplarily, if the keyword AB is matched with the function tag ABcde, the keyword is matched with the words in the function tag in sequence, that is, the keyword AB is matched with AB, Bc, cd and de in the function tag ABcde respectively. Since the keyword AB matches AB in the function tag ABcde, the function tag ABcde is a matching function tag.

[0118] By matching the keywords with the words in the function tags respectively, the function tags corresponding to the keywords are obtained, which can improve the matching efficiency and accuracy.

[0119] Figure 4 A flowchart of another automated testing method for software function changes provided by an embodiment of the present invention is provided. Based on the above embodiment, the automated testing of software function changes is implemented specifically through a natural semantic analysis module, a unit testing module, and an automated interface testing module. Figure 4As shown, the old version code and the new version code corresponding to the software to be tested are obtained from the automated test pre-step module, the old version code and the new version code are matched through the code change record retrieval and matching module to obtain the corresponding changed code, the changed code is unit tested through the unit testing module, and the interface of the changed code is automated interface tested through the automated interface testing module to obtain the test results. If all tests pass, the test is terminated. If there is a test that fails, the test continues.

[0120] Through the automated testing pre-step module, annotation information is obtained, and semantic analysis is performed on the annotation information through the natural semantic analysis module to obtain corresponding keywords. The keywords are matched with the function labels, and the test cases corresponding to the matching function labels are put into the regression test set. Through the automated testing module, automated testing is performed on the test cases in the regression test set, and the test results are obtained. If all test cases pass, the test is terminated. If some test cases fail, the test continues.

[0121] Automated testing of software function changes can be achieved through natural semantic analysis modules, unit testing modules and automated interface testing modules, which can improve testing efficiency and reduce costs.

[0122] Figure 5 A schematic diagram of the structure of an automated testing device for software function changes provided by an embodiment of the present invention. Figure 5 As shown, the automated testing device for software function changes provided in this embodiment may include:

[0123] The acquisition module 501 is used to acquire the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested;

[0124] The first obtaining module 502 is used to compare the old version code and the new version code of the software to be tested to obtain the changed code in the new version code;

[0125] The second obtaining module 503 is used to perform natural semantic analysis on the annotation information to obtain keywords in the annotation information;

[0126] The third obtaining module 504 is used to match the keyword with the function label to obtain the matching function label, and put the test case corresponding to the matching function label into the regression test set;

[0127] The testing module 505 is used to test the software to be tested according to the changed code and the regression test set to be tested.

[0128] Optionally, the testing module 505 is specifically used for:

[0129] Perform unit testing on the changed code;

[0130] Performing automated interface testing on the interface corresponding to the changed code;

[0131] Based on the automated testing framework, automated testing is performed on all test cases in the regression test set;

[0132] Output the test results.

[0133] Optionally, the testing module 505 is further used for:

[0134] Obtaining multiple test cases of the software to be tested and a function label corresponding to each test case;

[0135] Based on the keywords entered by the user,

[0136] and / or, determining keywords based on a business rule description text input by a user and based on the business rule description text;

[0137] Build a business function corpus based on keywords.

[0138] Optionally, the second obtaining module 503 is specifically used for:

[0139] Matching the first character in the annotation information with the first character of each keyword in the business function corpus to determine at least one keyword that is successfully matched;

[0140] For each keyword in the at least one keyword, matching the keyword with the first N characters in the annotation information, where N is the number of characters in the keyword;

[0141] If the keyword matches successfully, the first N characters are split from the annotation information;

[0142] The above steps are repeated for the remaining characters in the annotation information until the annotation information is completely split.

[0143] Optionally, the second obtaining module 503, when determining keywords according to the business rule description text, is specifically used to:

[0144] Generate multiple character combinations according to the business rule description text; wherein each character combination is a combination of multiple adjacent characters in the business rule description text, and the number of characters in the character combination is less than a first preset threshold;

[0145] For each character combination, calculate the first number and the second number corresponding to the character combination, wherein the first number is the number of times the character combination appears in the business rule description text, and the second number is the sum of the number of times each character in the character combination appears in the business rule description text;

[0146] If the ratio of the first number of times to the second number of times is greater than a second preset threshold, the character combination is determined to be a keyword.

[0147] Optionally, the third obtaining module 504 is specifically used for:

[0148] For each function tag, if the keyword matches at least one character in the function tag, the function tag is a matching function tag.

[0149] The device provided in this embodiment can perform the following steps: Figure 1-Figure 4 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.

[0150] Figure 6 A schematic diagram of the structure of an automated testing device for software function changes provided by an embodiment of the present invention. Figure 6 As shown, the electronic device provided in this embodiment may include: a processor 61, and a memory 62 communicatively connected to the processor;

[0151] The memory 62 stores computer-executable instructions;

[0152] The processor 61 executes the computer-executable instructions stored in the memory 62 , so that the processor 61 executes the method described in any one of the above embodiments.

[0153] The memory 62 and the processor 61 may be connected via a bus 63 .

[0154] The specific implementation principle and effect of the device provided in this embodiment can be found in Figure 1-Figure 4 The relevant descriptions and effects corresponding to the illustrated embodiments are not elaborated in detail here.

[0155] Figure 7 A schematic diagram of an automated testing system for software function changes is provided in accordance with an embodiment of the present invention. Figure 7 As shown, the system comprises:

[0156] The version server is used to provide the old version code, new version code and annotation information to the main server;

[0157] The proxy server is used to obtain the changed code and the regression test set sent by the main server and send them to the test device;

[0158] The test device is used to receive the changed code and the regression test set sent by the proxy server, perform unit testing on the changed code, perform automated interface testing on the interface corresponding to the changed code, and perform automated testing on the test cases in the regression test set.

[0159] Optionally, the version server extracts the old version code, new version code and annotation information of the software to be tested to the main server, and the main server compares the old version code and the new version code of the software to be tested to obtain the changed code in the new version code, performs natural semantic analysis on the annotation information, obtains the keywords in the annotation information, matches the corresponding function tags according to the keywords, puts the test cases corresponding to the function tags into the regression test set, and sends the changed code and the regression test set to the proxy server. The proxy server obtains the changed code and the regression test set sent by the main server, and sends them to the test equipment. The test equipment tests the software to be tested according to the received changed code and regression test set.

[0160] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the automated testing method for software function changes provided by any embodiment of the present invention.

[0161] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the automated testing method for software function changes described in any embodiment of the present invention.

[0162] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0163] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0164] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0165] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention.

[0166] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0167] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0168] The bus may be an Industry Standard Architecture (ISA) bus, 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, the bus in the drawings of the present invention is not limited to only one bus or one type of bus.

[0169] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0170] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0171] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0172] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention is indicated by the following claims.

[0173] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. An automated testing method for software function changes, characterized in that: include: Obtain the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested; Compare the old version code and the new version code of the software to be tested to obtain the changed code in the new version code; Performing natural semantic analysis on the annotation information to obtain keywords in the annotation information; By matching the keywords with the function labels, matching function labels are obtained, and test cases corresponding to the matching function labels are put into the regression test set to be tested; Testing the software to be tested according to the changed code and the regression test set to be tested; Also includes: Obtaining multiple test cases of the software to be tested and a function label corresponding to each test case; Determining keywords based on keywords input by a user, and / or based on a business rule description text input by a user and based on the business rule description text; Build a business function corpus based on keywords; Performing natural semantic analysis on the annotation information to obtain keywords in the annotation information includes: Matching the first character in the annotation information with the first character of each keyword in the business function corpus to determine at least one keyword that is successfully matched; For each keyword in the at least one keyword, matching the keyword with the first N characters in the annotation information, where N is the number of characters in the keyword; If the keyword matches successfully, the first N characters are split from the annotation information; The above steps are repeated for the remaining characters in the annotation information until the annotation information is completely split.

2. The method according to claim 1, characterized in that Testing the software to be tested according to the changed code and the regression test set to be tested includes: Perform unit testing on the changed code; Performing automated interface testing on the interface corresponding to the changed code; Based on the automated testing framework, automated testing is performed on all test cases in the regression test set; Output the test results.

3. The method according to claim 1, characterized in that Determining keywords according to the business rule description text includes: Generate multiple character combinations according to the business rule description text; wherein each character combination is a combination of multiple adjacent characters in the business rule description text, and the number of characters in the character combination is less than a first preset threshold; For each character combination, calculate the first number and the second number corresponding to the character combination, wherein the first number is the number of times the character combination appears in the business rule description text, and the second number is the sum of the number of times each character in the character combination appears in the business rule description text; If the ratio of the first number of times to the second number of times is greater than a second preset threshold, the character combination is determined to be a keyword.

4. The method according to claim 1, characterized in that By matching the keyword with the function tag, the matching function tag is obtained, including: For each function tag, if the keyword matches at least one character in the function tag, the function tag is a matching function tag.

5. An automated testing device for software function changes, characterized in that: The device comprises: An acquisition module is used to acquire the old version code, the new version code and the annotation information corresponding to the new version code of the software to be tested; The first obtaining module is used to compare the old version code and the new version code of the software to be tested to obtain the changed code in the new version code; The second obtaining module is used to perform natural semantic analysis on the annotation information to obtain keywords in the annotation information; The third obtaining module is used to match the keywords with the function labels to obtain the matching function labels, and put the test cases corresponding to the matching function labels into the regression test set; A testing module, used for testing the software to be tested according to the changed code and the regression test set to be tested; The test module is also used to: obtain multiple test cases of the software to be tested and a function label corresponding to each test case; Determining keywords based on keywords input by a user, and / or based on a business rule description text input by a user and based on the business rule description text; Build a business function corpus based on keywords; The second obtaining module is specifically used for: Matching the first character in the annotation information with the first character of each keyword in the business function corpus to determine at least one keyword that is successfully matched; For each keyword in the at least one keyword, matching the keyword with the first N characters in the annotation information, where N is the number of characters in the keyword; If the keyword matches successfully, the first N characters are split from the annotation information; The above steps are repeated for the remaining characters in the annotation information until the annotation information is completely split.

6. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 4.

7. An automated testing system for software function changes, characterized in that: include: The version server is used to provide the old version code, new version code and annotation information to the main server; The proxy server is used to obtain the changed code and the regression test set sent by the main server and send them to the test device; The testing device is used to receive the changed code and the regression test set to be sent by the proxy server, and test the software to be tested; The main server is used to execute any one of the methods described in 1-4.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.

Citation Information

Patent Citations

  • Software test method and system

    CN106649110A

  • Code automatic analysis and test method and device and computer readable storage medium

    CN110389896A

  • Test case screening method and device, computer equipment and storage medium

    CN110489321A

  • Regression test method and device and computing equipment

    CN111831564A

  • Generating documentation from tests

    US20120102458A1