A software testing method, apparatus, and related device
By parsing user configuration files to generate hierarchical directory trees and test cases, and automating the generation of test case files, the problem of low efficiency in ultrasonic equipment software testing was solved, achieving full coverage and efficient software testing, and improving product quality.
Patent Information
- Application Number
- CN202110419329.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-19
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2041-07-08
AI Technical Summary
In existing technologies, the number of software test items for ultrasonic equipment is enormous, resulting in low testing efficiency and an inability to achieve full coverage.
By parsing user configuration files to obtain configuration information, generating hierarchical directory trees and test cases, and automatically generating test case files, software testing can be achieved.
Comprehensive and efficient software testing was achieved, improving the software quality of the product.
Smart Images

Figure CN115221035B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer software, in particular to a software testing method, and relates to a software testing device, equipment and computer readable storage medium. BACKGROUND
[0002] An ultrasonic device is a commonly used device for disease diagnosis in medicine. As a core part of the ultrasonic device, ultrasonic software needs to be comprehensively tested before leaving the factory to achieve safe and reliable clinical application. However, due to the complex structure and numerous functions, the number of test items of the ultrasonic software is relatively large. For example, a certain ultrasonic device on the market is provided with about 29 probes, 39 diagnostic items and 84 working modes. When testing the software of the ultrasonic device, all the probes supported by each module, all the modes under all the diagnostic items need to be traversed, and the total number of test paths is about 200,000. Obviously, if the traditional manual operation method is used to generate such a large number of test paths, the efficiency is very low, and it is also impossible to ensure full coverage of the test paths, thereby causing the problems of low software testing efficiency and incomplete testing.
[0003] Therefore, how to realize comprehensive and efficient software testing and improve the software quality of products is a problem to be solved by those skilled in the art. SUMMARY
[0004] The purpose of the present application is to provide a software testing method which can realize comprehensive and efficient software testing and thus can effectively improve the software quality of products. Another purpose of the present application is to provide a software testing device, equipment and computer readable storage medium, all of which have the above-mentioned beneficial effects.
[0005] In a first aspect, the present application provides a software testing method, comprising:
[0006] analyzing a user configuration file to obtain configuration information;
[0007] generating a hierarchical directory tree and a test case by using the configuration information;
[0008] storing the test case under the corresponding hierarchical directory tree to generate a test case file;
[0009] executing the test case file to realize software testing.
[0010] Preferably, before the step of analyzing the user configuration file to obtain the configuration information, the method further comprises:
[0011] obtaining command line input information;
[0012] analyzing the command line input information to obtain file storage information;
[0013] obtaining the user profile according to the file storage information
[0014] Preferably, the software to be tested is ultrasound software, and the user profile is parsed to obtain configuration information, including:
[0015] The user profile is parsed to obtain ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information.
[0016] Preferably, the ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test step configuration information are stored in the user profile in the form of dictionary keys.
[0017] The user profile generates a test path according to the module test path traversal configuration information, and matches the ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test step configuration information; and the user profile is a table file.
[0018] Preferably, the configuration information is used to generate a hierarchical directory tree and a test case, including:
[0019] The ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test path traversal configuration information are used to generate the hierarchical directory tree.
[0020] The ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, the module test step configuration information, and the module test path traversal configuration information are used to generate the test case.
[0021] Preferably, before the test case file is executed to implement software testing, the method further includes:
[0022] When the test case file cannot be generated, a file generation failure prompt is output.
[0023] Preferably, after the test case file is executed to implement software testing, the method further includes:
[0024] Software testing information is obtained and stored in a log file.
[0025] In a second aspect, the application also discloses a software testing device, including:
[0026] A file parsing module is configured to parse a user profile to obtain configuration information.
[0027] The information generation module is configured to generate a hierarchical directory tree and test cases based on the configuration information;
[0028] The file generation module is configured to store the test cases under the corresponding hierarchical directory tree to generate a test case file;
[0029] The file execution module is configured to execute the test case file to implement software testing.
[0030] In a third aspect, the present application further discloses a software testing device, comprising:
[0031] The memory is configured to store a computer program;
[0032] The processor is configured to execute the computer program to implement the steps of any of the software testing methods described above.
[0033] In a fourth aspect, the present application further discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the software testing methods described above.
[0034] The software testing method provided by the present application comprises the following steps: analyzing a user configuration file to obtain configuration information; generating a hierarchical directory tree and test cases based on the configuration information; storing the test cases under the corresponding hierarchical directory tree to generate a test case file; and executing the test case file to implement software testing.
[0035] It can be seen that the software testing method provided by the present application sets a configuration file conforming to specifications based on the actual requirements of the software to be tested, thereby automatically generating a test case file capable of traversing all category test items based on the configuration information, implementing software testing. Obviously, compared with the traditional manual operation mode, the method realizes the automatic generation of the test case file, is more efficient, and can effectively make up for the problem that manual operation cannot achieve full coverage of test paths, thereby realizing comprehensive and efficient software testing and further improving the software quality of products.
[0036] The software testing device, the software testing equipment and the computer readable storage medium provided by the present application all have the beneficial effects described above, and will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the prior art and the technical solutions in the embodiments of the present application, the drawings used in the description of the prior art and the embodiments of the present application will be briefly introduced. Of course, the drawings described below in the embodiments of the present application are only a part of the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of the provided drawings, and the obtained drawings also belong to the protection scope of the present application.
[0038] Figure 1 A flowchart of a software testing method provided by the present application is shown in FIG. 1.
[0039] Figure 2 A software design framework flowchart of a software testing tool provided by the present application is shown in FIG. 2.
[0040] Figure 3 A correlation diagram of configuration information of an ultrasonic software provided by the present application is shown in FIG. 3.
[0041] Figure 4 A schematic diagram of a module path traversing a probe worksheet in a configuration file provided by the present application is shown in FIG. 4.
[0042] Figure 5 A schematic diagram of a module path traversing a param worksheet in a configuration file provided by the present application is shown in FIG. 5.
[0043] Figure 6 A schematic diagram of another module path traversing a param worksheet in a configuration file provided by the present application is shown in FIG. 6.
[0044] Figure 7 A schematic diagram of a hierarchical directory tree provided by the present application is shown in FIG. 7.
[0045] Figure 8 A schematic diagram of generating a test case provided by the present application is shown in FIG. 8.
[0046] Figure 9 A structural schematic diagram of a software testing device provided by the present application is shown in FIG. 9.
[0047] Figure 10 A structural schematic diagram of a software testing device provided by the present application is shown in FIG. 9. DETAILED DESCRIPTION
[0048] The core of the present application is to provide a software testing method, which can realize comprehensive and efficient software testing, thereby effectively improving the software quality of products; another core of the present application is to provide a software testing device, a device and a computer readable storage medium, which also have the above beneficial effects.
[0049] In order to make the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be described below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work are within the scope of protection of the present application.
[0050] Ultrasound equipment is a commonly used equipment for disease diagnosis in medicine, and ultrasound software as its core part needs to be comprehensively tested before leaving the factory for realizing safe and reliable clinical application. However, due to complex structure and numerous functions, the number of test items of ultrasound software is relatively large, and if the traditional manual operation mode is used to generate a large number of test paths, the efficiency is very low, and it is also impossible to guarantee the full coverage of the test paths, thereby causing the problems of low software test efficiency and incomplete test.
[0051] Therefore, to solve the above technical problems, the embodiments of the present application provide a software test method, which can realize comprehensive and efficient software testing and effectively improve the software quality of products. It can be understood that the software test method provided by the present application is applicable to any type of product software, in other words, the specific type of the software under test does not affect the implementation of the technical solution, and the present application does not limit this.
[0052] It should be noted that the software test method provided by the present application can be realized based on an automatic test case traversal library generation tool software, which can realize the automatic generation of test case files and then realize software testing based on this. The tool software can be developed based on a Python2.7 software development tool.
[0053] Please refer to Figure 1 , Figure 1 The flowchart of the software test method provided by the present application can include:
[0054] S101: Analyzing the user configuration file to obtain configuration information;
[0055] This step aims to realize file analysis operation, and obtains corresponding configuration information by analyzing the user configuration file. In the specific implementation process, when the system receives the user configuration file, it can be analyzed to obtain the configuration information therein. Further, when the analysis is successful, the next step can be continued, and when the analysis fails, a file analysis failure prompt can be output to remind the user to query the exception in time. Of course, the above file analysis process can use any one of the analysis methods in the prior art, and the present application will not be repeated here.
[0056] The user configuration file is a specification-compliant configuration file set by a user based on actual requirements of the software under test for implementing software testing, and includes various configuration information, which refers to various information set for implementing various types of testing, including but not limited to information such as project category, function category, and module category.
[0057] It can be understood that the user configuration file can be generated by the user on the front-end interface, can be a file directly input from a terminal device, or can be a file pre-configured and pre-stored in the software system, and the present application does not limit this.
[0058] As a preferred embodiment, before the user configuration file is parsed to obtain the configuration information, the method can further include: obtaining command line input information; parsing the command line input information to obtain file storage information; and obtaining the user configuration file according to the file storage information.
[0059] The preferred embodiment provides a method for obtaining a user configuration file, that is, the user configuration file is obtained through command line input. Specifically, the user configuration file that is configured in advance can be stored in a system corresponding to the software under test. When software testing is performed, the user can first input a command line based on a front-end interface. The input information includes file storage information of the user configuration file, such as a storage address, a file name, or a file identifier of the user configuration file. Thus, the system can obtain the file storage information by parsing the command line input information, determine the storage location of the user configuration file, and obtain the user configuration file from the storage location.
[0060] Of course, the parsing process of the command line input information is similar to the parsing process of the user configuration file. When the command line input information is parsed, if the parsing is successful, the user configuration file parsing operation is continued, and if the parsing fails, a parsing failure prompt is output to remind the user to query the exception in a timely manner. Similarly, the information parsing process can use any parsing method in the prior art, and the present application will not be described again.
[0061] It should be noted that the configuration information in the user configuration file corresponds to the software under test because different software under test corresponds to different test items. For example, for software testing of an ultrasonic device, the ultrasonic device is provided with different categories of ultrasonic probes, different categories of diagnostic items, and different categories of working modes, such as 29 probes, 39 diagnostic items, and 84 working modes of a certain ultrasonic device on the market. The corresponding configuration information can include probe information, diagnostic item information, and working mode information to implement performance testing under different probes and diagnostic items and in different working modes.
[0062] As a preferred embodiment, the software to be tested can be ultrasound software, and the step of parsing the user configuration file to obtain configuration information can include parsing the user configuration file to obtain ultrasound probe configuration information, diagnosis item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information.
[0063] The preferred embodiment takes software testing of ultrasound software as an example and provides several categories of configuration information, namely, ultrasound probe configuration information, diagnosis item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information. The ultrasound probe configuration information refers to information of an ultrasound probe used in an ultrasound device corresponding to the ultrasound software, such as the model and category of the ultrasound probe. The diagnosis item configuration information refers to related information of various test items that need to be tested on the ultrasound probe, namely, various categories of ultrasound diagnosis items. The working mode configuration information includes various working modes of the ultrasound device in actual use. The module test step configuration information refers to execution steps when testing each functional module in the ultrasound software. The module test path traversal configuration information refers to path information when traversing the foregoing configuration information during software testing, namely, traversing and obtaining the foregoing configuration information according to the corresponding path configuration information. Thus, based on these configuration information, an automatic case library of all modes under all ultrasound probe diagnosis items supported by all functional modules can be generated, achieving full coverage of the test path.
[0064] As a preferred embodiment, the ultrasound probe configuration information, the diagnosis item configuration information, the working mode configuration information, and the module test step configuration information can be stored in the user configuration file in the form of dictionary keys. The user configuration file is generated according to the test path of the module test path traversal configuration information matching the ultrasound probe configuration information, the diagnosis item configuration information, the working mode configuration information, and the module test step configuration information. The user configuration file is a table file.
[0065] The preferred embodiment provides a storage form of each configuration information in the user configuration file, namely, the form of dictionary keys. Specifically, the user configuration file can be divided into several subfiles, including an ultrasound probe configuration subfile, a diagnosis item configuration subfile, a working mode configuration subfile, a module test step configuration subfile, and a module test path traversal configuration subfile. Thus, the configuration information of the corresponding category can be defined in each subfile in the form of keys. Since the module test path traversal configuration information refers to path information when traversing other configuration information during software testing, it can be obtained by matching the configuration information in the remaining four configuration subfiles. Thus, after the configuration of each configuration subfile is completed, the final user configuration file is generated.
[0066] The user configuration file can be a table file, that is, each configuration information is stored in the form of a table in the user configuration file, which is more convenient for matching and calling the configuration information, thereby realizing the rapid generation of the hierarchical directory tree and the test case and improving the software testing efficiency.
[0067] For example, for an ultrasonic device, the B gain module needs to be tested in the B mode and the B-PW mode for all diagnostic items of all ultrasonic probes. Then, the user can select the B gain module in all modules, select the B mode and the B-PW mode in all working modes, and select all ultrasonic probes and all diagnostic items, thereby realizing the generation of the ultrasonic probe configuration sub-file, the diagnostic item configuration sub-file, the working mode configuration sub-file, and the module test step configuration sub-file. On this basis, the module test path traversal configuration sub-file will automatically traverse the above four configuration sub-files, and generate the test paths that can cover all diagnostic items of all ultrasonic probes in the B mode of the B gain module of the ultrasonic device and the test paths that can cover all diagnostic items of all ultrasonic probes in the B-PW mode of the B gain module of the ultrasonic device by matching the configuration information in each configuration sub-file. These test path information is the module test path traversal configuration information required in the current ultrasonic software testing process, thereby realizing the automatic generation of the module test path traversal configuration sub-file. Finally, the final user configuration file is generated based on the above ultrasonic probe configuration sub-file, the diagnostic item configuration sub-file, the working mode configuration sub-file, the module test step configuration sub-file, and the module test path traversal configuration sub-file.
[0068] The dictionary keys corresponding to the ultrasonic probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test step configuration information involved in all diagnostic items of all ultrasonic probes in the B mode and the B-PW mode of the B gain module can also be extracted, and these dictionary keys are edited according to the module test path traversal configuration information to generate the module test path traversal configuration sub-file. Then, the table file corresponding to the user configuration file is automatically generated according to the module test path traversal configuration sub-file.
[0069] If other functional modules need to be tested, the corresponding configuration information is extracted to automatically generate the configuration file. The test case generation method can simply and flexibly generate multiple test cases in various situations, which is very suitable for the functional testing of the ultrasonic device, reduces the editing work of the test cases, and saves time.
[0070] S102: generating a hierarchical directory tree and a test case by using the configuration information;
[0071] S103: storing the test case under the corresponding hierarchical directory tree to generate a test case file;
[0072] S104: execute the test case file to implement software testing.
[0073] The above steps are aimed at generating a test case file based on configuration information, and then completing software testing. The test case file is a file used to implement software testing, and the main purpose is to determine whether the software under test is in a correct working state. Different categories of test case files are used to implement different performance tests in the software under test.
[0074] Specifically, after obtaining the configuration information, a hierarchical directory tree can be generated based on the configuration information. Since there are multiple different categories of configuration information, the hierarchical structure of the hierarchical directory tree includes the inclusion relationship between the various categories of configuration information, which is used to distinguish the storage of the subsequently generated test cases, so as to generate corresponding test case files. Therefore, after generating the test case based on the configuration information, it can be stored under the corresponding hierarchical directory tree to generate a complete test case file. Finally, software testing can be completed by executing the test case file.
[0075] As a preferred embodiment, the above generation of a hierarchical directory tree and a test case using configuration information can include: generating a hierarchical directory tree using ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, and module test path traversal configuration information; and generating a test case using ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information.
[0076] The preferred embodiment takes ultrasound software testing as an example and provides a method for generating a hierarchical directory tree and a test case. As described above, the hierarchical structure of the hierarchical directory tree includes the inclusion relationship between the various categories of configuration information, so the hierarchical directory tree can be directly generated using ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, and module test path traversal configuration information. In this way, the hierarchical directory tree will embody the inclusion relationship of "ultrasound probe-diagnostic item-working mode". Further, according to the module test path traversal configuration information, the specific test steps of the corresponding functional module defined by the module test step configuration information are referenced in each working mode of each diagnostic item of each ultrasound probe supported by each functional module, and the corresponding test case is generated. Thus, each test case obtained is stored under the corresponding hierarchical directory tree to generate each test case file corresponding to the ultrasound software. Such a hierarchical form can facilitate the display, viewing, and sequential execution of test cases.
[0077] It can be understood that, similar to the above file analysis and information analysis, due to system abnormalities or non-standard configuration information, etc., there may also be a case of failure to generate test case files. Therefore, as a preferred embodiment, before the above-mentioned execution of the test case file realizes software testing, it can also include: when the test case file cannot be generated, output a file generation failure prompt.
[0078] Specifically, during the test case file generation process, real-time judgment can be performed, i.e., whether the test case file is successfully generated, if so, the subsequent software testing steps can be continued, otherwise, if the test case file fails to be generated, a file generation failure prompt can be output to remind the user to query the exception in time. Wherein, all kinds of prompt information can be output in the form of visual interface display.
[0079] As described above, software testing aims to determine whether the software under test is in a correct working state, and specifically, whether all performance indicators of the software under test are within the standard range. Further, after completing software testing, as a preferred embodiment, after the above-mentioned execution of the test case file realizes software testing, it can also include: obtaining software testing information and storing the software testing information to a log file.
[0080] The preferred embodiment can realize log recording to monitor the entire software testing process and obtain software testing information, that is, the software testing information is all information generated during the entire software testing process, such as current running data, running state, test results, etc. of each test item. Further, the software testing information is sent to the log file corresponding to the software under test for storage to facilitate subsequent test information query by technicians. Wherein, all kinds of software testing information can be stored in the log file in a classified manner, which is more convenient for technicians to query the log.
[0081] It can be seen that the software testing method provided by the present application sets a configuration file in accordance with the actual requirements of the software under test, thereby automatically generating a test case file that can traverse all categories of test items based on the configuration information therein, realizing software testing. Obviously, compared with the traditional manual operation method, the method realizes the automatic generation of test case files, is more efficient, and can effectively make up for the problem that manual operation cannot realize full coverage of test paths, thereby realizing comprehensive and efficient software testing and further improving the software quality of the product.
[0082] The following will further illustrate the software testing method provided by the present application by taking ultrasonic software testing as an example.
[0083] First, please refer to Figure 2 , Figure 2A software design framework flow chart of a software testing tool provided in the application is provided, and the whole design framework is divided into three modules: a configuration module, an analysis module and a generation module, wherein the configuration module is mainly used for realizing probe configuration, diagnosis item configuration, mode configuration, module test step configuration and module test path traversal configuration; the analysis module is mainly used for realizing command line analysis and configuration analysis; and the generation module is mainly used for realizing generation of each automatic test case of a hierarchical directory tree. The specific implementation process is as follows:
[0084] I. Configuration operation
[0085] In the configuration file, various types of information are configured, specifically: in the form of dictionary keywords, all probes are defined in the probe configuration file, all diagnosis items are defined in the diagnosis item configuration file, all modes are defined in the mode configuration file, and all modules and corresponding specific test steps are defined in the module test step configuration file; and for the module test path traversal configuration file, the module test path traversal configuration information can be obtained by matching the reference probe configuration file, the diagnosis item configuration file, the mode configuration file and the module test step configuration file, as shown in Figure 3 Figure 3 An association relationship diagram of configuration information of an ultrasonic software provided in the application.
[0086] In order to better understand the configuration process of various types of information, taking a certain type of ultrasonic equipment as an example, the self-defined configuration of various types of information is explained and described.
[0087] 1. The probe configuration file defines three probes:
[0088] "3C-A":["3C-A"],
[0089] "C613":["C613"],
[0090] "C322":["C322"],
[0091] Further, the probe configuration file defines the "COMMON" keyword, indicating a common probe set, containing all probes except special probes, such as:
[0092] "COMMON":["C1-6A","3C-A","C613","C322"],
[0093] 2. The diagnosis item configuration file defines three diagnosis items:
[0094] "ADB-P":["ADB-P"],
[0095] "Abd Vas":["Abd Vas"],
[0096] "Kidny":["Kidny"],
[0097] 3、Mode configuration file, custom three modes:
[0098] "B":["B"],
[0099] "B-Micro-F":["B","Micro F"],
[0100] "B-FREEZE":["B","FREEZE"],
[0101] 4、Module test step configuration file, such as B gain module, its module is customized as "B-GAIN" keyword, and the corresponding specific test steps are:
[0102] "B-GAIN":[[52."client.simple_event(‘B_LEFT’)\n"],[5."client.mousemove_rel_event(-50,-50)\n"],
[0103] [52."client.simple_event(‘B_RIGHT’)\n"]]。
[0104] 5、Module path traversal configuration file, set to an Excel table form configuration file, specifically including "probe" and "param" two worksheets:
[0105] (1) "probe" worksheet:
[0106] Used to record the interface arrangement index of each diagnostic item of each probe. The form adopts a two-dimensional format, in the two-dimensional list, each row corresponds to each probe, each column corresponds to each diagnostic item, and the cell intersected by the row and the column is the interface arrangement index of each diagnostic item supported by each probe. The index is machine language recognizable by the test equipment, used to realize functional docking with the ultrasonic equipment. When the cell content is empty, it indicates that the probe does not support the diagnostic item. When automatic use case generation is performed, the corresponding index value can be obtained by entering a certain diagnostic item of a certain probe to fill in, and thus, the correct probe diagnostic item interface can be entered.
[0107] For example, please refer to Figure 4 , Figure 4 is a schematic diagram of the probe worksheet of a module path traversal configuration file provided in the present application, according to Figure 4 It can be known that:
[0108] 3C-A probe contains 9 diagnostic items, which are ABD, ABD-P, Adb Vas, Kidney, GYN, 1st Trim., Liver, 2nd 3rd Trim, Fetus HR, and the corresponding interface arrangement indexes are 1, 9, 4, 3, 5, 6, 2, 7, 8 respectively;
[0109] C613 probe contains 2 diagnostic items, which are Cardiac, Liver, and the corresponding interface arrangement indexes are 1, 2 respectively;
[0110] C322 probe contains 3 diagnostic items, which are ABD, ABD-P, Kidney, and the corresponding interface arrangement indexes are 1, 2, 3 respectively.
[0111] (2) "param" worksheet:
[0112] It is used to record which probe diagnostic items need to be traversed in each mode for each module. The form is also in two-dimensional format, each row corresponds to each mode, and each column corresponds to each module. The cell intersected by the row and the column is the specific probe diagnostic item that needs to be traversed in each mode supported by each module.
[0113] For example, the "B-GAIN" module of a certain probe needs to traverse all diagnostic items of all regular probes in B, B-FREEZE, B-PW modes; and no traversal in B-PW-FREEZE mode. The module test path traversal configuration is as shown in Figure 5 Figure 5 is a schematic diagram of the param worksheet in the module path traversal configuration file provided in the present application, wherein:
[0114] B-GAIN is a module keyword, indicating matching reference to the B-GAIN keyword in the module test step configuration file;
[0115] B, B-FREEZE, B-PW, B-PW-FREEZE are mode keywords, indicating matching reference to the corresponding keywords in the mode configuration file;
[0116] P(COMMON) in P represents Probe, i.e. probe; COMMON keyword, indicating matching reference to the COMMON keyword in the probe configuration file, P(COMMON) indicating traversal of all diagnostic items of all regular probes; NO indicating that the module does not support the mode and no need for testing.
[0117] For another example, the "B-GAIN" module of a certain probe needs to traverse all diagnostic items of C322 probe and Cardiac diagnostic item of C613 probe in B mode. The module test path traversal configuration is as shown in Figure 6 As shown, Figure 6 Another schematic diagram of the param table in the module path traversal configuration file provided by the present application is shown in the figure, wherein:
[0118] In P(C322), the C322 keyword represents a matching reference to the C322 keyword in the probe configuration file; P(C322) represents traversal of all diagnosis items of the C322 probe.
[0119] In P(C613)D(Cardiac), D represents Diagnosis, i.e., a diagnosis item; the C613 keyword represents a matching reference to the C613 keyword in the probe configuration file; the Cardiac keyword represents a matching reference to the Cardiac keyword in the diagnosis item configuration file; P(C613)D(Cardiac) represents traversal of the Cardiac diagnosis item of the C613 probe.
[0120] The “|” symbol represents a parallel relationship, i.e., both P(C322) and P(C613)D(Cardiac) are to be traversed.
[0121] Up to now, the configuration of all configuration information is realized. Among them, the probe configuration, the diagnosis item configuration, the mode configuration, and the module test step configuration are all self-defined keywords, while the module path traversal configuration can be self-defined by matching reference to these keywords to traverse the test path as required, thereby improving the flexibility of the configuration and enhancing the expandability.
[0122] II. Starting the tool:
[0123] The tool is started in a command line input manner, and the configuration file configured by the user in the first step is specified by inputting a command line parameter.
[0124] III. Parsing operation:
[0125] First, the command line input of the user is parsed to obtain the configuration file specified by the user. Further, the configuration file is read and parsed to obtain the configured probe configuration information, diagnosis item configuration information, mode configuration information, module test step configuration information, and module test path traversal configuration information. When the parsing fails, the tool ends and exits; when the parsing succeeds, the next step is entered.
[0126] IV. Generation operation:
[0127] First, a hierarchical directory tree is generated according to all the probe configuration information, diagnosis item configuration information, mode configuration information, and module test path traversal configuration information read in the parsing operation. The hierarchical structure of the hierarchical directory tree reflects the inclusion relationship of “probe-diagnosis item-mode”, and is used to distinguish the storage of the subsequent generated automated test cases. For example, Figure 7 As shown, Figure 7A schematic diagram of a hierarchical directory tree provided by the present application.
[0128] Further, according to the module test path traversal configuration information, in each mode of each diagnostic item of each probe supported by each module, the specific test steps of the corresponding module in the module test step configuration information are referenced to generate the test case corresponding to the module and stored under the corresponding hierarchical directory tree to generate a test case file, and the extension of the test case file is.case. When the generation fails, the tool ends and exits; when the generation succeeds, the tool ends.
[0129] For example, as shown in Figure 5 , the "B-GAIN" module of a certain probe needs to traverse all diagnostic items of all conventional probes in B mode, and then the tool software will generate the test case of the corresponding "B-GAIN" module under the B directory of each diagnostic item of these probe directories. For example, taking the C322 probe directory as an example, please refer to Figure 8 , Figure 8 A schematic diagram of generating a test case provided by the present application, in which the test case of the "B-GAIN" module is generated under the B mode directory of the ABD, GYN, and Kidney diagnostic item directories.
[0130] Five, software testing:
[0131] Based on the above generation of each test case file, software testing can be realized by executing each test case file. For example, the content of the "B-GAIN" module test case is matched and referenced to the corresponding specific test steps defined by the B-GAIN keyword in the module test step configuration file to realize software testing.
[0132] It can be seen that the software testing method provided by the embodiment of the present application sets the configuration file in accordance with the actual requirements of the ultrasonic software, thereby automatically generating the test case file that can traverse all category test items based on the configuration information therein, realizing ultrasonic software testing. Obviously, compared with the traditional manual operation method, the method realizes the automatic generation of the test case file, is more efficient, and can effectively make up for the problem that manual operation cannot realize full coverage of the test path. Therefore, the method realizes comprehensive and efficient ultrasonic software testing and further improves the software quality of the ultrasonic product.
[0133] To solve the above technical problems, the present application further provides a software testing device, please refer to Figure 9 , Figure 9 A structural schematic diagram of a software testing device provided by the present application, which can include:
[0134] The file parsing module 1 is configured to parse the user configuration file to obtain configuration information.
[0135] The information generating module 2 is configured to generate a hierarchical directory tree and test cases by using the configuration information.
[0136] The file generating module 3 is configured to store the test cases under the corresponding hierarchical directory tree to generate a test case file.
[0137] The file executing module 4 is configured to execute the test case file to implement software testing.
[0138] It can be seen that the software testing device provided by the embodiment of the present application sets a configuration file conforming to the specification based on the actual requirements of the software to be tested, thereby automatically generating a test case file capable of traversing all category test items based on the configuration information, implementing software testing. Obviously, compared with the traditional manual operation mode, the method realizes the automatic generation of the test case file, is higher in efficiency, and can effectively make up for the problem that the manual operation cannot realize full coverage of the test path, thereby realizing comprehensive and efficient software testing and further improving the software quality of the product.
[0139] As a preferred embodiment, the software testing device further comprises a file obtaining module configured to obtain command line input information, parse the command line input information to obtain file storage information, and obtain the user configuration file according to the file storage information.
[0140] As a preferred embodiment, the software to be tested can be ultrasonic software, and the file parsing module 1 can be specifically configured to parse the user configuration file to obtain ultrasonic probe configuration information, diagnosis item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information.
[0141] As a preferred embodiment, the ultrasonic probe configuration information, the diagnosis item configuration information, the working mode configuration information, and the module test step configuration information can be stored in the user configuration file in the form of dictionary keys, the user configuration file can generate a test path of the ultrasonic probe configuration information, the diagnosis item configuration information, the working mode configuration information, and the module test step configuration information according to the module test path traversal configuration information, and the user configuration file can be a table file.
[0142] As a preferred embodiment, the information generating module 2 can be specifically configured to generate a hierarchical directory tree by using the ultrasonic probe configuration information, the diagnosis item configuration information, the working mode configuration information, and the module test path traversal configuration information, and generate test cases by using the ultrasonic probe configuration information, the diagnosis item configuration information, the working mode configuration information, the module test step configuration information, and the module test path traversal configuration information.
[0143] As a preferred embodiment, the software testing device can further comprise:
[0144] The information prompting module is configured to output a file generation failure prompt when the test case file cannot be generated before the software testing is implemented by executing the test case file.
[0145] As a preferred embodiment, the software testing device can further comprise:
[0146] The log file generating module is configured to acquire the software testing information after the software testing is implemented by executing the test case file, and store the software testing information into the log file.
[0147] For the device provided in the present application, refer to the method embodiments above, which will not be repeated here.
[0148] To solve the above technical problems, the present application further provides a software testing device, which is described as follows Figure 10 , Figure 10 A structural schematic diagram of the software testing device provided in the present application is shown in the figure, which can comprise:
[0149] The memory 10 is configured to store the computer program.
[0150] The processor 20 is configured to implement the steps of any of the software testing methods described above when executing the computer program.
[0151] For the device provided in the present application, refer to the method embodiments above, which will not be repeated here.
[0152] To solve the above problems, the present application further provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any of the software testing methods described above can be implemented.
[0153] The computer readable storage medium can include a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other program code storage media.
[0154] For the computer readable storage medium provided in the present application, refer to the method embodiments above, which will not be repeated here.
[0155] The various embodiments described in the specification are progressive in nature, and each embodiment highlights the differences from other embodiments. The same or similar parts among the various embodiments can be mutually referred to. For the apparatus disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0156] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or both. To clearly illustrate the interchangeability of hardware and software, the above description has generally been stated in terms of the functional components and steps of the examples. Whether such functionality is implemented in hardware or software depends on the particular application and design constraints imposed on the overall architecture. Skilled persons can use various methods to implement the described functions for each particular application, but such implementation should not be considered beyond the scope of the present application.
[0157] The steps of the method or algorithm described in connection with the embodiments disclosed herein can be directly implemented in hardware, software executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0158] The above describes the technical solutions provided by the present application in detail. The principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only to help understand the method and its core idea of the present application. It should be noted that for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. A software testing method, characterized in that, include: Parse the user configuration file to obtain configuration information; The configuration information is used to generate a hierarchical directory tree and test cases; Store the test cases in the corresponding hierarchical directory tree to generate test case files; The software testing is performed by executing the test case file. The software under test is ultrasound software, and the configuration information includes ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information. Accordingly, generating the hierarchical directory tree and test cases using the configuration information includes: generating the hierarchical directory tree using the ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test path traversal configuration information; and generating the test cases using the ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, the module test step configuration information, and the module test path traversal configuration information.
2. The software testing method according to claim 1, characterized in that, Before parsing the user configuration file to obtain configuration information, the process also includes: Get command line input information; The command line input information is parsed to obtain file storage information; The user configuration file is retrieved based on the file storage information.
3. The software testing method according to claim 1, characterized in that, The process of parsing the user configuration file to obtain configuration information includes: The user configuration file is parsed to obtain ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information.
4. The software testing method according to claim 3, characterized in that, The ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test step configuration information are stored in the user configuration file in the form of dictionary keywords; The user configuration file is generated by matching the configuration information of the ultrasound probe, the diagnostic item, the working mode, and the module test step configuration information according to the module test path traversal configuration information; the user configuration file is a table file.
5. The software testing method according to claim 1, characterized in that, Before executing the test case file to perform software testing, the process also includes: If the test case file cannot be generated, an output file generation failure message will be displayed.
6. The software testing method according to claim 1, characterized in that, After executing the test case file to perform software testing, the process also includes: Obtain software testing information and store it in a log file.
7. A software testing device, characterized in that, include: The file parsing module is used to parse user configuration files to obtain configuration information; The information generation module is used to generate a hierarchical directory tree and test cases using the configuration information; The file generation module is used to store the test cases in the corresponding hierarchical directory tree and generate test case files; The file execution module is used to execute the test case file to perform software testing. The software under test is ultrasound software, and the configuration information includes ultrasound probe configuration information, diagnostic item configuration information, working mode configuration information, module test step configuration information, and module test path traversal configuration information. Accordingly, the information generation module is specifically used to generate the hierarchical directory tree using the ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, and the module test path traversal configuration information; and to generate the test cases using the ultrasound probe configuration information, the diagnostic item configuration information, the working mode configuration information, the module test step configuration information, and the module test path traversal configuration information.
8. A software testing device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the software testing method as described in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the software testing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Verification plan and report generation method and device, equipment and storage medium
CN111859830A