Program testing method, device, computer system and storage medium

By using the business use case logic diagram to acquire and combine use case units to generate test cases, the problem of high professionalism and high cost in existing test tools is solved, and the effect of reducing maintenance difficulty and cost is achieved.

CN113656326BActive Publication Date: 2025-06-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111017701.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2025-06-20
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

Existing test tools need to be customized secondary development and packaging when used, which is highly dependent on testers and requires high time costs.

Method used

Provides a program testing method, by obtaining test requests, obtaining target use case units from the use case library according to the business use case logic diagram corresponding to the target program, combining the target test cases, and testing the target program.

Benefits of technology

It reduces the maintenance difficulty and maintenance cost of test cases, reduces the dependence on testers' professionalism, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656326B_ABST
    Figure CN113656326B_ABST
Patent Text Reader

Abstract

The present disclosure provides a program testing method. The program testing method includes: obtaining a test request for testing a target program; in response to the test request, obtaining at least one target use case unit from the use case units stored in the use case library according to the business use case logic diagram corresponding to the target program, wherein the business use case logic diagram includes at least one business module use case identifier, each business module use case identifier corresponds to multiple levels of business scenario use case identifiers, and each final-level business scenario use case identifier in the multiple levels of business scenario use case identifiers corresponds to at least one use case unit identifier; combining the target use case units to generate a target test case; testing the target program according to the target test case and outputting a test result. The present disclosure also provides a program testing device, a computer system and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and more particularly, to a program testing method, apparatus, computer system, and storage medium. Background Art

[0002] A microservice (or microservice architecture) is a cloud-native architecture approach in which a single application consists of many smaller, loosely coupled, and independently deployable components or services. With the development of microservices, data interfaces have become more and more numerous and complex, and the testing work for data interfaces has become increasingly difficult.

[0003] In the process of implementing the concept of the present disclosure, the inventors found that at least the following problems exist in the related art: Existing testing tools require customized secondary development and encapsulation during use, have a high dependence on the professionalism of testers, and require a high time cost. Summary of the Invention

[0004] In view of this, the present disclosure provides a program testing method, apparatus, computer system, and storage medium.

[0005] One aspect of the present disclosure provides a program testing method, including:

[0006] Obtaining a test request for testing a target program;

[0007] In response to the test request, according to the business use case logic diagram corresponding to the target program, obtaining at least one target use case unit from the use case units stored in the use case library, where the business use case logic diagram includes at least one business module use case identifier, each of the business module use case identifiers corresponds to a multi-level business scenario use case identifier, and each of the last-level business scenario use case identifiers in the multi-level business scenario use case identifiers corresponds to at least one use case unit identifier;

[0008] Combining the target use case units to generate a target test case;

[0009] Testing the target program according to the target test case and outputting a test result.

[0010] According to an embodiment of the present disclosure, the program testing method further includes:

[0011] Obtaining a use case conversion request, where the use case conversion request carries a business use case logic diagram corresponding to the target program;

[0012] In response to the use case conversion request, processing the business use cases corresponding to the target program according to the business use case logic diagram to generate a plurality of the use case units, and each of the use case units corresponds to a use case unit identifier;

[0013] Store multiple of the use case units into the use case library.

[0014] According to an embodiment of the present disclosure, the processing of the business use case corresponding to the target program according to the business use case logic diagram to generate multiple of the use case units includes:

[0015] Perform data analysis on the business use case and output an analysis result;

[0016] When the analysis result indicates that the business use case has target data, process the business use case corresponding to the target program according to the business use case logic diagram to generate multiple of the use case units, where the target data includes protocol data, address data, request data, and assertion data.

[0017] According to an embodiment of the present disclosure, the processing of the business use case corresponding to the target program to generate multiple of the use case units includes:

[0018] Based on the business use case logic diagram, extract data from the business use case according to the target data to generate multiple initial use case units;

[0019] Generate the use case units corresponding to each use case unit identifier according to the multiple initial use case units.

[0020] According to an embodiment of the present disclosure, the program testing method further includes:

[0021] Determine the management information corresponding to each use case unit according to the use case unit identifier, where the management information includes organization information and user information for managing the use case unit;

[0022] Generate the use case units corresponding to each use case unit identifier according to the management information and the initial use case units.

[0023] According to an embodiment of the present disclosure, the program testing method further includes:

[0024] Display a use case selection page, where the use case selection page includes a business use case selection area;

[0025] In response to a selection operation on the use case selection area, determine the business use case logic diagram corresponding to the target program;

[0026] Generate the use case conversion request according to the business use case logic diagram.

[0027] According to an embodiment of the present disclosure, the combining of the target use case units to generate a target test case includes:

[0028] Generate a first set of target test cases according to the target test case unit;

[0029] Process the first set of target test cases to generate the target test cases.

[0030] According to an embodiment of the present disclosure, the combining the target test case units to generate target test cases further includes:

[0031] Generate a plurality of second sets of target test cases according to the target test case unit, where each of the second sets of target test cases includes at least one of the target test case units;

[0032] Generate a target test case set according to the plurality of second sets of target test cases;

[0033] Process the target test case set to generate the target test cases.

[0034] According to an embodiment of the present disclosure, the program testing method further includes:

[0035] Display a test case display interface, where the test case display interface includes a test case display area;

[0036] In response to a display request for the target test cases, import the target test cases into the test case display interface so as to display the target test cases based on the test case display interface.

[0037] Another aspect of the present disclosure provides a program testing apparatus, including:

[0038] A first acquisition module, configured to acquire a test request for testing a target program;

[0039] A first response module, configured to, in response to the test request, acquire at least one target test case unit from the test case units stored in the test case library according to a business use case logic diagram corresponding to the target program, where the business use case logic diagram includes at least one business module use case identifier, each of the business module use case identifiers corresponds to a multi-level business scenario use case identifier, and each of the last-level business scenario use case identifiers in the multi-level business scenario use case identifiers corresponds to at least one test case unit identifier;

[0040] A combination module, configured to combine the target test case units to generate target test cases;

[0041] A test module, configured to test the target program according to the target test cases and output a test result.

[0042] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the method described in the embodiments of the present disclosure.

[0043] Another aspect of the present disclosure provides a computer program, which includes computer-executable instructions that, when executed, are used to implement the method described in the embodiments of the present disclosure.

[0044] According to an embodiment of the present disclosure, in response to a test request for testing a target program, at least one target use case unit is obtained from the use case units stored in the use case library according to the business use case logic diagram. After combining the target use case units to generate a target test case, the target program to be tested is tested according to the target test case to generate a test result. Since the target test case is composed of the target use case units determined according to the business use case logic diagram, the maintenance difficulty of the test case can be reduced, thereby reducing the maintenance cost of the test case and reducing the dependence on the professionalism of the testers. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above and other objects, features, and advantages of the present disclosure will become clearer. In the drawings:

[0046] Figure 1 Schematically shows an exemplary system architecture to which the program testing method according to an embodiment of the present disclosure can be applied.

[0047] Figure 2 Schematically shows a flowchart of the program testing method according to an embodiment of the present disclosure.

[0048] Figure 3 Schematically shows a schematic diagram of a business use case template according to an embodiment of the present disclosure.

[0049] Figure 4 Schematically shows a data structure diagram of an organization, a user, and a use case unit according to an embodiment of the present disclosure.

[0050] Figure 5 Schematically shows a block diagram of a program testing apparatus according to an embodiment of the present disclosure.

[0051] Figure 6 Schematically shows a block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. However, it is obvious that one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present disclosure.

[0053] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0054] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0055] In the case of using expressions such as "at least one of A, B, and C, etc.", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0056] With the development of microservices, the systems of various institutions are also evolving towards a microservices architecture. However, with the microservices transformation of the architecture, the number of interfaces is increasing and becoming more complex, and the testing work for data interfaces is becoming more and more difficult. Currently, more commonly used interface testing tools include Jmeter, Postman, etc., and testing frameworks include TestNG, JBehave, etc.

[0057] However, the functions of the above-mentioned testing tools and frameworks are too general, and secondary development is required during use, resulting in relatively high time and technical costs; moreover, when testing through the above-mentioned testing tools and frameworks, test cases are not easy to maintain.

[0058] Embodiments of the present disclosure provide a program testing method, apparatus, computer system, and storage medium. The program testing method includes obtaining a test request for testing a target program; in response to the test request, obtaining at least one target use case unit from the use case units stored in the use case library according to the business use case logic diagram corresponding to the target program, where the business use case logic diagram includes at least one business module use case identifier, each business module use case identifier corresponds to multiple levels of business scenario use case identifiers, and each final-level business scenario use case identifier in the multiple levels of business scenario use case identifiers corresponds to at least one use case unit identifier; combining the target use case units to generate a target test case; testing the target program according to the target test case, and outputting a test result.

[0059] Figure 1 FIG. schematically shows an exemplary system architecture 100 to which the program testing method according to an embodiment of the present disclosure can be applied. It should be noted that, Figure 1 The figure shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments, or scenarios.

[0060] As Figure 1 shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0061] Users can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).

[0062] The terminal devices 101, 102, 103 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop portable computers, and desktop computers, etc.

[0063] The server 105 may be a server that provides various services, such as a background management server that supports websites browsed by users using the terminal devices 101, 102, 103 (only as an example). The background management server may analyze and process data such as user requests received, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0064] It should be noted that the program testing method provided by the embodiments of the present disclosure can generally be executed by the terminal devices 101, 102, or 103, or can also be executed by other terminal devices different from the terminal devices 101, 102, or 103. Correspondingly, the program testing device provided by the embodiments of the present disclosure can generally be set in the terminal devices 101, 102, or 103, or set in other terminal devices different from the terminal devices 101, 102, or 103. Alternatively, the program testing method provided by the embodiments of the present disclosure can also be executed by the server 105. Correspondingly, the program testing device provided by the embodiments of the present disclosure can also be set in the server 105. The program testing method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103, and / or the server 105. Correspondingly, the program testing device provided by the embodiments of the present disclosure can also be set in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103, and / or the server 105.

[0065] For example, the test request to be processed could originally be obtained by any one of the terminal devices 101, 102, or 103 (e.g., terminal device 101, but not limited thereto). Then, the terminal device 101 can execute the program testing method provided by the embodiments of the present disclosure locally, or send the test request to be processed to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the test request to be processed will execute the program testing method provided by the embodiments of the present disclosure. It should be noted that when the server (e.g., server 105) executes the program testing method provided by the embodiments of the present disclosure, when an interface needs to be displayed (e.g., the use case display interface and the use case selection page), the interface to be displayed can be sent to any one of the terminal devices 101, 102, or 103 or other arbitrary display devices for display.

[0066] It should be understood that Figure 1 the numbers of the terminal devices, networks, and servers in

[0067] Figure 2 is only illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.

[0068] As Figure 2 shown, the method includes operations S201 to S204.

[0069] In operation S201, obtain a test request for testing a target program.

[0070] According to an embodiment of the present disclosure, a test request may include, for example, information such as a business scenario, a test requirement, or a test target that requires testing of a target program. The test request may be generated, for example, based on a triggering operation of a user on a carrier. The carrier may include an electronic device, and the electronic device may include a terminal device, and the terminal device may include a smart phone, a tablet computer, a portable computer, or a desktop computer, etc. The triggering operation may include a click or a slide.

[0071] In operation S202, in response to the test request, at least one target use case unit is obtained from the use case units stored in the use case library according to the business use case logic diagram corresponding to the target program, where the business use case logic diagram includes at least one business module use case identifier, each business module use case identifier corresponds to a multi-level business scenario use case identifier, and each final-level business scenario use case identifier in the multi-level business scenario use case identifier corresponds to at least one use case unit identifier.

[0072] According to an embodiment of the present disclosure, the business use case logic diagram may include, for example, a business use case test diagram in the form of a mind map. The use case unit may include, for example, an automated test case obtained by templatizing the business use case in the form of a mind map according to a business use case template. The use case library may store all use case units for the target program, or may also store use case units for multiple target programs.

[0073] In operation S203, the target use case units are combined to generate a target test case.

[0074] According to an embodiment of the present disclosure, based on the actual test requirements, the target use case units are combined in an orderly manner, that is, a target test case for the above test request is generated.

[0075] In operation S204, the target program is tested according to the target test case, and a test result is output.

[0076] According to an embodiment of the present disclosure, outputting the test result may generate, for example, a test report, and the test report may refer to an analysis of the test result and an analysis and ranking result of the health status of an interface, a module, or a microservice according to the test result, etc. The test report may be presented in forms such as Hyper Text Markup Language (HTML), email, and text message, etc.

[0077] According to an embodiment of the present disclosure, in response to a test request for testing a target program, at least one target use case unit is obtained from the use case units stored in the use case library according to the business use case logic diagram. After combining the target use case units to generate a target test case, the target program to be tested is tested according to the target test case to generate a test result. Since the target test case is composed of the target use case units determined according to the business use case logic diagram, the maintenance difficulty of the test case can be reduced, thereby reducing the maintenance cost of the test case and reducing the dependence on the professionalism of testers.

[0078] According to an embodiment of the present disclosure, the program testing method further includes:

[0079] Obtain a use case conversion request, where the use case conversion request carries a business use case logic diagram corresponding to the target program. In response to the use case conversion request, according to the business use case logic diagram, process the business use case corresponding to the target program to generate a plurality of use case units, and each use case unit corresponds to a use case unit identifier. Store the plurality of use case units in the use case library.

[0080] According to an embodiment of the present disclosure, the use case conversion request may refer to a request for digitizing the business use case logic diagram corresponding to the target program to obtain use case units. The use case conversion request can be generated, for example, according to a trigger operation of a user on a carrier.

[0081] According to an embodiment of the present disclosure, the use case unit identifier may refer to, for example, a unique identifier of the use case unit. The use case unit identifier may be composed of one or more of numbers, symbols, or letters. For example, the use case unit identifier may be "001", "002", or "A001". According to specific implementation requirements, it may also be any other arbitrary form of combination.

[0082] According to an embodiment of the present disclosure, processing the business use case corresponding to the target program according to the business use case logic diagram to generate a plurality of use case units includes:

[0083] Perform data analysis on the business use case and output an analysis result. In the case where the analysis result indicates that the business use case has target data, process the business use case corresponding to the target program according to the business use case logic diagram to generate a plurality of use case units.

[0084] According to an embodiment of the present disclosure, before converting the business use case, it is necessary to perform data analysis on the business use case to ensure that the current business use case meets the conversion conditions.

[0085] For example, when analyzing the business use case, if the business use case contains target data, then the conversion conditions are met. If the business use case lacks target data, it is necessary to re-edit the business use case.

[0086] According to an embodiment of the present disclosure, the target data may include, for example, data such as protocol data, address data, request data, and assertion data. It should be noted that, according to specific implementation requirements, the target data may also include other types of data.

[0087] According to an embodiment of the present disclosure, according to the business use case logic diagram, the business use cases corresponding to the target program are processed to generate multiple use case units, including:

[0088] Based on the business use case logic diagram, data extraction is performed on the business use cases according to the target data to generate multiple initial use case units. According to the multiple initial use case units, use case units corresponding to each use case unit identifier are generated.

[0089] According to an embodiment of the present disclosure, an initial use case unit may be composed of multiple target data, for example. By performing operations such as editing or recombining each target data in the initial use case unit, the final use case unit is generated.

[0090] A use case unit may be composed of target data in a business use case, for example.

[0091] Figure 3 A schematic diagram of a business use case template according to an embodiment of the present disclosure is schematically shown.

[0092] As Figure 3 shown, the business use case template 300 includes a business use case area 301 and a use case unit area 302.

[0093] The business use case area 301 includes the target program name, a first module and a second module corresponding to the target program name. The first module and the second module respectively correspond to multiple test scenarios, and the number of test scenarios is not limited. Each test scenario corresponds to one or more first-level sub-scenarios, and each first-level sub-scenario corresponds to one or more second-level sub-scenarios.

[0094] The use case unit area 302 includes multiple use case unit groups. Each use case unit group includes multiple use case units. Each use case unit includes data such as protocol data, address data, request data, and assertion data. Among them, each use case unit group may correspond to a second-level sub-scenario.

[0095] According to an embodiment of the present disclosure, the program testing method further includes:

[0096] Determine the management information corresponding to each use case unit according to the use case unit identifier, where the management information includes organization information and user information for managing the use case unit. Generate the use case unit corresponding to each use case unit identifier according to the management information and the initial use case unit.

[0097] According to an embodiment of the present disclosure, the organization information may include, for example, an organization ID, and the user information may include a user ID. By binding the management information to each use case unit, the usage security of the use case unit can be improved.

[0098] Figure 4 A data structure diagram of an organization, a user, and a use case unit according to an embodiment of the present disclosure is schematically shown.

[0099] As Figure 4 shown, the data structure diagram 400 includes an organization-user relationship table 401, an organization table 402, a user table 403, a test case table 404, and a use case unit data table 405.

[0100] The organization-user relationship table 401 is used to characterize the relationship between an organization and a user, and includes information such as a target program ID, an organization ID, and a user ID. The organization table 402 is used to characterize the information of each organization, and includes information such as an organization ID and an organization name. The user table 403 is used to characterize the information of each user, and includes information such as a user ID and a user name. The test case table 404 is used to characterize the relationship between each use case unit and an organization and a user, and includes a use case unit ID, an organization ID, a user ID, a use case level, and a parent use case ID, etc. The use case unit data table 405 is used to characterize the script data information of each use case unit, and includes a data ID, a use case unit ID, and a data attribute, etc.

[0101] According to an embodiment of the present disclosure, the program testing method further includes:

[0102] Displaying a use case selection page, where the use case selection page includes a business use case selection area. In response to a selection operation on the use case selection area, determining a business use case logic diagram corresponding to the target program. Generating a use case conversion request according to the business use case logic diagram.

[0103] According to an embodiment of the present disclosure, the use case selection page may refer to a page on a carrier for selecting a business use case. The type of the use case selection page may include a PC (Personal Computer) - side interface or a mobile - side interface.

[0104] According to an embodiment of the present disclosure, by selecting the business use case logic diagram, the business use case logic diagram corresponding to the target program can be imported into the system, and a corresponding use case conversion request is generated. Further, a use case editing page may also be displayed, and the use case editing page can be used by a user to edit or write a business use case to meet the usage requirements of different users.

[0105] According to an embodiment of the present disclosure, combining the target use case units to generate a target test case includes:

[0106] Generate a first target test case group according to the target use case unit. Process the first target test case group to generate target test cases.

[0107] According to an embodiment of the present disclosure, by combining target use case units, the use case units can be reconstructed into tree-shaped data, which can be used for page display or combination between test case groups.

[0108] According to an embodiment of the present disclosure, combining the target use case units to generate target test cases further includes:

[0109] Generate multiple second target test case groups according to the target use case unit, where each second target test case group includes at least one target use case unit. Generate a target test case set according to the multiple second target test case groups. Process the target test case set to generate target test cases.

[0110] According to an embodiment of the present disclosure, by combining use case units to generate a test case group or a test case set, and then generating target test cases according to the test case group or the test case set.

[0111] According to an embodiment of the present disclosure, the program testing method further includes:

[0112] Display a use case display interface, where the use case display interface includes a test case display area. In response to a display request for a target test case, import the target test case into the use case display interface so as to display the target test case based on the use case display interface.

[0113] According to an embodiment of the present disclosure, by visually displaying the target test case based on the use case display interface, the visibility of the target test case can be improved, which is convenient for users to adjust and modify the target test case.

[0114] Figure 5 Schematically shows a block diagram of a program testing apparatus according to an embodiment of the present disclosure.

[0115] As Figure 5 shown, the program testing apparatus 500 includes a first acquisition module 501, a first response module 502, a combination module 503, and a test module 504.

[0116] The first acquisition module 501 is configured to acquire a test request for testing a target program.

[0117] The first response module 502 is configured to, in response to a test request, obtain at least one target use case unit from the use case units stored in the use case library according to the business use case logic diagram corresponding to the target program, where the business use case logic diagram includes at least one business module use case identifier, each business module use case identifier corresponds to multiple levels of business scenario use case identifiers, and each final-level business scenario use case identifier in the multiple levels of business scenario use case identifiers corresponds to at least one use case unit identifier.

[0118] The combination module 503 is configured to combine the target use case units to generate a target test case.

[0119] The test module 504 is configured to test the target program according to the target test case and output a test result.

[0120] According to an embodiment of the present disclosure, by responding to a test request for testing a target program, at least one target use case unit is obtained from the use case units stored in the use case library according to the business use case logic diagram. After combining the target use case units to generate a target test case, the target program to be tested is tested according to the target test case to generate a test result. Since the target test case is composed of the target use case units determined according to the business use case logic diagram, the maintenance difficulty of the test case can be reduced, thereby reducing the maintenance cost of the test case and reducing the dependence on the professionalism of testers.

[0121] According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a second acquisition module, a second response module, and a storage module.

[0122] The second acquisition module is configured to obtain a use case conversion request, where the use case conversion request carries the business use case logic diagram corresponding to the target program.

[0123] The second response module is configured to, in response to the use case conversion request, process the business use cases corresponding to the target program according to the business use case logic diagram to generate multiple use case units, and each use case unit corresponds to a use case unit identifier.

[0124] The storage module is configured to store the multiple use case units in the use case library.

[0125] According to an embodiment of the present disclosure, the second response module includes an analysis unit and a processing unit.

[0126] The analysis unit is configured to perform data analysis on the business use cases and output an analysis result.

[0127] A processing unit, configured to, when the analysis result indicates that the business use case has target data, process the business use case corresponding to the target program according to the business use case logic diagram to generate a plurality of use case units, where the target data includes protocol data, address data, request data, and assertion data.

[0128] According to an embodiment of the present disclosure, the processing unit includes an extraction subunit and a generation subunit.

[0129] The extraction subunit is configured to perform data extraction on the business use case based on the target data according to the business use case logic diagram to generate a plurality of initial use case units.

[0130] The generation subunit is configured to generate use case units corresponding to each use case unit identifier according to the plurality of initial use case units.

[0131] According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a determination module and a first generation module.

[0132] The determination module is configured to determine management information corresponding to each use case unit according to the use case unit identifier, where the management information includes organization information and user information for managing the use case unit.

[0133] The first generation module is configured to generate use case units corresponding to each use case unit identifier according to the management information and the initial use case units.

[0134] According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a first display module, a third response module, and a second generation module.

[0135] The first display module is configured to display a use case selection page, where the use case selection page includes a business use case selection area.

[0136] The third response module is configured to determine the business use case logic diagram corresponding to the target program in response to a selection operation on the use case selection area.

[0137] The second generation module is configured to generate a use case conversion request according to the business use case logic diagram.

[0138] According to an embodiment of the present disclosure, the combination module 503 includes a first generation unit and a second generation unit.

[0139] The first generation unit is configured to generate a first target use case group according to the target use case unit.

[0140] The second generation unit is configured to process the first target use case group to generate target test cases.

[0141] According to an embodiment of the present disclosure, the combination module 503 further includes a first generation unit and a second generation unit.

[0142] A third generation unit, configured to generate a plurality of second target use case groups according to the target use case unit, where each second target use case group includes at least one target use case unit.

[0143] A fourth generation unit, configured to generate a target use case set according to the plurality of second target use case groups.

[0144] A fifth generation unit, configured to process the target use case set to generate target test cases.

[0145] According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a second display module and a fourth response module.

[0146] The second display module is configured to display a use case display interface, where the use case display interface includes a test case display area;

[0147] The fourth response module is configured to, in response to a display request for a target test case, import the target test case into the use case display interface, so as to display the target test case based on the use case display interface.

[0148] It should be noted that the embodiments of the apparatus part of the present disclosure are the same as or similar to the corresponding embodiments of the method part of the present disclosure, and the present disclosure will not be repeated herein.

[0149] According to an embodiment of the present disclosure, any plurality of modules, units, and subunits, or at least part of the functions of any plurality of them, can be implemented in one module. Any one or more of the modules, units, and subunits according to the embodiments of the present disclosure can be split into multiple modules to be implemented. Any one or more of the modules, units, and subunits according to the embodiments of the present disclosure can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by any other reasonable way of integrating or packaging circuits in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, one or more of the modules, units, and subunits according to the embodiments of the present disclosure can be at least partially implemented as a computer program module, and when the computer program module runs, it can execute the corresponding functions.

[0150] For example, any combination of the first acquisition module 501, the first response module 502, the combination module 503, and the test module 504 can be combined and implemented in one module / unit / sub-unit, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first acquisition module 501, the first response module 502, the combination module 503, and the test module 504 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging circuits, etc., in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, at least one of the first acquisition module 501, the first response module 502, the combination module 503, and the test module 504 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0151] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0152] As Figure 6 shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603. The processor 601 can include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), and so on. The processor 601 can also include on-board memory for caching purposes. The processor 601 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0153] In the RAM 603, various programs and data required for the operation of the electronic device 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via the bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present disclosure by executing the programs in the ROM 602 and / or the RAM 603. It should be noted that the programs may also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 may also perform various operations of the method flow according to the embodiments of the present disclosure by executing the programs stored in the one or more memories.

[0154] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, and the input / output (I / O) interface 605 is also connected to the bus 604. The system 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. The drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage portion 608 as needed.

[0155] According to an embodiment of the present disclosure, the method flow according to the embodiments of the present disclosure may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable storage medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication portion 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-described functions defined in the system according to the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the above-described systems, devices, apparatuses, modules, units, etc. may be implemented by computer program modules.

[0156] The present disclosure also provides a computer-readable storage medium, which may be included in the device / device / system described in the above embodiments; or may exist separately without being assembled into the device / device / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.

[0157] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0158] For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include one or more memories other than the ROM 602 and / or RAM 603 and / or ROM 602 and RAM 603 described above.

[0159] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combinations of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0160] Those skilled in the art can understand that the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly recited in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.

[0161] The embodiments of the present disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present disclosure.

Claims

1. A program testing method, comprising: Obtain a test request for testing a target program; In response to the test request, according to the business use case logic diagram corresponding to the target program, obtain at least one target use case unit from the use case units stored in the use case library, wherein the business use case logic diagram includes at least one business module use case identifier, each of the business module use case identifiers corresponds to multiple levels of business scenario use case identifiers, and each of the last-level business scenario use case identifiers in the multiple levels of business scenario use case identifiers corresponds to at least one use case unit identifier; Combine the target use case units to generate a target test case; Test the target program according to the target test case and output a test result.

2. The method according to claim 1, further comprising: Obtain a use case conversion request, wherein the use case conversion request carries a business use case logic diagram corresponding to the target program; In response to the use case conversion request, process the business use cases corresponding to the target program according to the business use case logic diagram to generate multiple use case units, and each use case unit corresponds to a use case unit identifier; Store the multiple use case units in the use case library.

3. The method according to claim 2, wherein The processing the business use cases corresponding to the target program according to the business use case logic diagram to generate multiple use case units includes: Perform data analysis on the business use cases and output an analysis result; In the case that the analysis result indicates that the business use cases have target data, process the business use cases corresponding to the target program according to the business use case logic diagram to generate multiple use case units, wherein the target data includes protocol data, address data, request data, and assertion data.

4. The method according to claim 3, wherein The processing the business use cases corresponding to the target program according to the business use case logic diagram to generate multiple use case units includes: Based on the business use case logic diagram, extract data from the business use cases according to the target data to generate multiple initial use case units; Generate the use case units corresponding to each use case unit identifier according to the multiple initial use case units.

5. The method according to claim 4, further comprising: Determine management information corresponding to each use case unit according to the use case unit identifier, wherein the management information includes organization information and user information for managing the use case unit; Generate the use case units corresponding to each use case unit identifier according to the management information and the initial use case units.

6. The method according to claim 2, further comprising: Display a use case selection page, wherein the use case selection page includes a business use case selection area; In response to a selection operation on the use case selection area, determine the business use case logic diagram corresponding to the target program; Generate the use case conversion request according to the business use case logic diagram.

7. The method according to claim 1, wherein The combining the target use case units to generate a target test case includes: Generate a first target use case group according to the target use case units; Process the first target use case group to generate the target test case.

8. The method according to claim 1, wherein The combining the target use case units to generate a target test case further includes: Generate a plurality of second target use case groups according to the target use case unit, wherein each of the second target use case groups includes at least one of the target use case units; Generate a target use case set according to the plurality of second target use case groups; Process the target use case set to generate the target test case.

9. The method according to any one of claims 1 to 8, further comprising: Display a use case display interface, wherein the use case display interface includes a test case display area; In response to a display request for the target test case, import the target test case into the use case display interface so as to display the target test case based on the use case display interface.

10. A program testing device, comprising: A first acquisition module for acquiring a test request for testing a target program; A first response module for, in response to the test request, acquiring at least one target use case unit from the use case units stored in the use case library according to a business use case logic diagram corresponding to the target program, wherein the business use case logic diagram includes at least one business module use case identifier, each of the business module use case identifiers corresponds to a multi-level business scenario use case identifier, and each of the last-level business scenario use case identifiers in the multi-level business scenario use case identifiers corresponds to at least one use case unit identifier; A combination module for combining the target use case units to generate a target test case; A test module for testing the target program according to the target test case and outputting a test result.

11. A computer system, comprising: One or more processors; A memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having executable instructions stored thereon, which when executed by a processor cause the processor to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Test method and device, electronic equipment and computer readable medium

    CN112597047A

  • Service Test Validation Framework

    US20180137026A1