CN113656326A - Program testing method, program testing device, computer system and storage medium - Google Patents
Program testing method, program testing device, computer system and storage medium Download PDFInfo
- Publication number
- CN113656326A CN113656326A CN202111017701.2A CN202111017701A CN113656326A CN 113656326 A CN113656326 A CN 113656326A CN 202111017701 A CN202111017701 A CN 202111017701A CN 113656326 A CN113656326 A CN 113656326A
- Authority
- CN
- China
- Prior art keywords
- case
- target
- use case
- service
- test
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 claims abstract description 153
- 238000010586 diagram Methods 0.000 claims abstract description 71
- 238000012545 processing Methods 0.000 claims description 30
- 238000000034 method Methods 0.000 claims description 25
- 238000006243 chemical reaction Methods 0.000 claims description 21
- 230000008520 organization Effects 0.000 claims description 19
- 238000004458 analytical method Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 11
- 230000015654 memory Effects 0.000 claims description 10
- 238000007405 data analysis Methods 0.000 claims description 5
- 238000013075 data extraction Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000012423 maintenance Methods 0.000 description 6
- 238000011161 development Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004806 packaging method and process Methods 0.000 description 3
- 108010001267 Protein Subunits Proteins 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000000758 substrate Substances 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003340 mental effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The present disclosure provides a program testing method. The program testing method comprises the following steps: acquiring a test request for testing a target program; responding to a test request, and acquiring at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to a target program, wherein the service case logic diagram comprises at least one service module case identifier, each service module case identifier corresponds to a multi-level service scene case identifier, and each last-level service scene case identifier in the multi-level service scene case identifiers corresponds to at least one case unit identifier; combining the target case units to generate a target test case; and testing the target program according to the target test case and outputting a test result. The present disclosure provides a program testing device, a computer system and a storage medium.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a program testing method, an apparatus, a computer system, and a storage medium.
Background
Microservice (or microservice architecture) is a cloud-native architecture approach in which a single application is composed of many loosely-coupled and independently deployable smaller components or services. With the development of microservices, data interfaces become more and more complex, and testing work for data interfaces becomes more and more difficult.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: the existing testing tool needs to be subjected to customized secondary development and packaging when in use, has higher professional dependence on testers and needs higher time cost.
Disclosure of Invention
In view of the above, the present disclosure provides a program testing method, device, computer system and storage medium.
One aspect of the present disclosure provides a program testing method, including:
acquiring a test request for testing a target program;
responding to the test request, and acquiring at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to the target program, wherein the service case logic diagram comprises at least one service module case identifier, each service module case identifier corresponds to a multi-level service scene case identifier, and each final-level service scene case identifier in the multi-level service scene case identifiers corresponds to at least one case unit identifier;
combining the target case units to generate a target test case;
and testing the target program according to the target test case, and outputting a test result.
According to an embodiment of the present disclosure, the program testing method further includes:
acquiring a use case conversion request, wherein the use case conversion request carries a service use case logic diagram corresponding to the target program;
responding to the use case conversion request, processing the service use case corresponding to the target program according to the service use case logic diagram, and generating a plurality of use case units, wherein each use case unit corresponds to a use case unit identifier;
storing a plurality of case units into the case library.
According to an embodiment of the present disclosure, the processing a service use case corresponding to the target program according to the service use case logic diagram, and generating a plurality of use case units includes:
performing data analysis on the service case, and outputting an analysis result;
and under the condition that the analysis result represents that the service use case has target data, processing the service use case corresponding to the target program according to the service use case logic diagram to generate a plurality of use case units, wherein the target data comprises protocol data, address data, request data and assertion data.
According to the embodiment of the disclosure, processing the service use case corresponding to the target program, and generating a plurality of use case units includes:
based on the service case logic diagram, performing data extraction on the service cases according to the target data to generate a plurality of initial case units;
and generating the use case unit corresponding to each use case unit identification according to the plurality of initial use case units.
According to an embodiment of the present disclosure, the program testing method further includes:
determining management information corresponding to each use case unit according to the use case unit identification, wherein the management information comprises organization information and user information for managing the use case units;
and generating the use case unit corresponding to each use case unit identification according to the management information and the initial use case unit.
According to an embodiment of the present disclosure, the program testing method further includes:
displaying a use case selection page, wherein the use case selection page comprises a service use case selection area;
responding to the selection operation aiming at the use case selection area, and determining the service use case logic diagram corresponding to the target program;
and generating the use case conversion request according to the service use case logic diagram.
According to an embodiment of the present disclosure, the combining the target case units to generate the target test case includes:
generating a first target case group according to the target case unit;
and processing the first target case group to generate the target test case.
According to an embodiment of the present disclosure, the combining the target case units to generate the target test case further includes:
generating a plurality of second target use case groups according to the target use case units, wherein each second target use case group at least comprises one target use case unit;
generating a target case set according to the second target case groups;
and processing the target case set to generate the target test case.
According to an embodiment of the present disclosure, the program testing method further includes:
displaying a case display interface, wherein the case display interface comprises a test case display area;
and responding to a display request aiming at the target test case, and importing the target test case into the case display interface so as to display the target test case based on the case display interface.
Another aspect of the present disclosure provides a program testing apparatus including:
the first acquisition module is used for acquiring a test request for testing a target program;
the first response module is used for responding to the test request and acquiring at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to the target program, wherein the service case logic diagram comprises at least one service module case identifier, each service module case identifier corresponds to a multi-level service scene case identifier, and each final-level service scene case identifier in the multi-level service scene case identifiers corresponds to at least one case unit identifier;
the combination module is used for combining the target case units to generate a target test case;
and the test module is used for testing the target program according to the target test case and outputting a test result.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method of the embodiments of the present disclosure when executed.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions for implementing the method of the embodiments of the present disclosure when executed.
According to the embodiment of the disclosure, at least one target case unit is obtained from case units stored in a case library according to a service case logic diagram by responding to a test request for testing a target program. And after the target case units are combined to generate a target test case, testing the target program to be tested according to the target test case to generate a test result. The target test case is composed of the target case units determined according to the service case logic diagram, so that the maintenance difficulty of the test case can be reduced, the maintenance cost of the test case is further reduced, and the dependence on the professional of a tester is reduced.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically shows an exemplary system architecture to which a program test method may be applied according to an embodiment of the present disclosure.
FIG. 2 schematically shows a flow chart of a program testing method according to an embodiment of the present disclosure.
Fig. 3 schematically illustrates a schematic diagram of a business case template according to an embodiment of the present disclosure.
FIG. 4 schematically illustrates a data structure diagram of an organization, user, and use case unit, according to an embodiment of the disclosure.
Fig. 5 schematically shows a block diagram of a program test device according to an embodiment of the present disclosure.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
With the development of micro services, systems of various organizations are also developing towards micro service architecture. But as the architecture becomes micro-serviced, the interfaces become more and more complex, and the testing work for the data interface becomes more and more difficult. At present, joint test tools which are used more are Jmeter, Postman and the like, and test frames are TestNG, JBehave and the like.
However, the above-mentioned test tool and frame function are too general, need to carry on the secondary development while using, time and technological cost are higher; moreover, when the test tool and the frame are used for testing, the test case is not easy to maintain.
The embodiment of the disclosure provides a program testing method, a program testing device, a computer system and a storage medium. The program testing method comprises the steps of obtaining a testing request for testing a target program; responding to a test request, and acquiring at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to a target program, wherein the service case logic diagram comprises at least one service module case identifier, each service module case identifier corresponds to a multi-level service scene case identifier, and each last-level service scene case identifier in the multi-level service scene case identifiers corresponds to at least one case unit identifier; combining the target case units to generate a target test case; and testing the target program according to the target test case and outputting a test result.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which a program test method may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, 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 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the program testing method provided by the embodiment of the present disclosure may be generally executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the program testing apparatus provided in the embodiments of the present disclosure may be generally disposed in the terminal device 101, 102, or 103, or disposed in another terminal device different from the terminal device 101, 102, or 103. Alternatively, the program testing method provided by the embodiment of the present disclosure may also be executed by the server 105. Accordingly, the program testing device provided by the embodiment of the present disclosure may also be disposed in the server 105. The program testing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the program testing apparatus provided in the embodiments of the present disclosure may also be disposed 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.
For example, the pending test request may be originally obtained by any one of the terminal devices 101, 102, or 103 (e.g., but not limited to, the terminal device 101). Then, the terminal device 101 may locally execute the program testing method provided by the embodiment of the present disclosure, or send a test request to be processed to another terminal device, a server, or a server cluster, and execute the program testing method provided by the embodiment of the present disclosure by another terminal device, a server, or a server cluster that receives the image to be processed. It should be noted that, in the case that the program testing method provided by the embodiment of the present disclosure is executed by a server (for example, the server 105), when an interface (for example, a use case display interface and a use case selection page) needs to be displayed, the interface that needs to be displayed may be sent to any one of the terminal devices 101, 102, or 103 or any other display device for displaying.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 2 schematically shows a flow chart of a program testing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S204.
In operation S201, a test request for testing a target program is acquired.
According to the embodiment of the disclosure, the test request may include information such as a service scenario, a test requirement, or a test target that needs to be tested on the target program, for example. The test request may be generated, for example, from a user's trigger action on the carrier. The carrier may comprise an electronic device, the electronic device may comprise a terminal device, and the terminal device may comprise a smartphone, a tablet, a laptop or desktop computer, or the like. The trigger operation may include a click or a slide.
In operation S202, in response to the test request, at least one target case unit is obtained from case units stored in a case library according to a service case logic diagram corresponding to the target program, where the service case logic diagram includes at least one service module case identifier, each service module case identifier corresponds to a multi-stage service scenario case identifier, and each last-stage service scenario case identifier in the multi-stage service scenario case identifiers corresponds to at least one case unit identifier.
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 mental brain diagram. The case unit can include, for example, an automated test case obtained by templating a service case in the form of a mind brain diagram according to a service case template. The use case library stores, for example, all use case units for the target program, or may store use case units for a plurality of target programs.
In operation S203, the target case units are combined to generate a target test case.
According to the embodiment of the disclosure, the target case units are combined in order based on actual test requirements, that is, the target test cases for the test requests are generated.
In operation S204, the target program is tested according to the target test case, and a test result is output.
According to an embodiment of the present disclosure, outputting the test result may generate a test report, for example, which may refer to analysis of the test result and health analysis and ranking of the interface, module or microservice according to the test result, and the like. The test report may be presented in the form of, for example, hypertext Markup Language (HTML), mail, and Text message.
According to the embodiment of the disclosure, at least one target case unit is obtained from case units stored in a case library according to a service case logic diagram by responding to a test request for testing a target program. And after the target case units are combined to generate a target test case, testing the target program to be tested according to the target test case to generate a test result. The target test case is composed of the target case units determined according to the service case logic diagram, so that the maintenance difficulty of the test case can be reduced, the maintenance cost of the test case is further reduced, and the dependence on the professional of a tester is reduced.
According to an embodiment of the present disclosure, the program testing method further includes:
acquiring a use case conversion request, wherein the use case conversion request carries a service use case logic diagram corresponding to a target program. And responding to the use case conversion request, processing the service use case corresponding to the target program according to the service use case logic diagram, and generating a plurality of use case units, wherein each use case unit corresponds to a use case unit identifier. And storing a plurality of case units into a case library.
According to an embodiment of the present disclosure, the use case conversion request may refer to a request for digitizing a service use case logic diagram corresponding to the target program to obtain a use case unit. The use case conversion request can be generated according to a trigger operation of a user on the carrier.
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 a number, a symbol, or a letter, for example. For example, the use case element identification may be "001", "002", or "A001". And other combinations in any form may be used according to specific implementation requirements.
According to the embodiment of the disclosure, processing the service use case corresponding to the target program according to the service use case logic diagram, and generating a plurality of use case units comprises:
and carrying out data analysis on the service case and outputting an analysis result. And under the condition that the analysis result represents that the service case has target data, processing the service case corresponding to the target program according to the service case logic diagram to generate a plurality of case units.
According to the embodiment of the disclosure, before the business case is converted, data analysis needs to be performed on the business case to ensure that the current business case meets the conversion condition.
For example, when a business case is analyzed and the business case contains target data, a conversion condition is satisfied. And if the business case lacks target data, the business case needs to be edited again.
According to embodiments of the present disclosure, the target data may include, for example, protocol data, address data, request data, and assertion data. It should be noted that the target data may also include other types of data according to the specific implementation needs.
According to the embodiment of the disclosure, processing the service use case corresponding to the target program according to the service use case logic diagram, and generating a plurality of use case units comprises:
and based on the service case logic diagram, performing data extraction on the service cases according to the target data to generate a plurality of initial case units. And generating a use case unit corresponding to each use case unit identification according to the plurality of initial use case units.
According to an embodiment of the present disclosure, an initial use case unit may be composed of a plurality of target data, for example. And generating a final use case unit by editing or recombining each target data in the initial use case unit.
The use case unit may be configured by target data in a business use case, for example.
Fig. 3 schematically illustrates a schematic diagram of a business case template according to an embodiment of the present disclosure.
As shown in fig. 3, the business case template 300 includes a business case area 301 and a case unit area 302.
The business use case area 301 includes a target program name, and a first module and a second module corresponding to the target program name. The first module and the second module are respectively corresponding to a plurality of test scenes, and the number of the test scenes is not limited. Each test scene corresponds to one or more primary sub-scenes, and each primary sub-scene corresponds to one or more secondary sub-scenes.
The use case unit area 302 includes a plurality of use case unit groups, each of which includes a plurality of use case units, each of which includes data such as protocol data, address data, request data, and assertion data. Each use case unit group can correspond to one secondary sub-scene.
According to an embodiment of the present disclosure, the program testing method further includes:
and determining management information corresponding to each use case unit according to the use case unit identification, wherein the management information comprises organization information and user information for managing the use case units. And generating a use case unit corresponding to each use case unit identification according to the management information and the initial use case unit.
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 case unit, the use safety of the case unit can be improved.
FIG. 4 schematically illustrates a data structure diagram of an organization, user, and use case unit, according to an embodiment of the disclosure.
As shown in fig. 4, 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.
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 information of each organization, including organization ID and organization name. The user table 403 is used to represent information of each user, including information such as a user ID and a user name. The test case table 404 is used to characterize the relationship between each case unit and the organization and the user, including the case unit ID, the organization ID, the user ID, the case level, the parent case ID, and the like. The use case unit data table 405 is used to characterize script data information of each use case unit, including a data ID, a use case unit ID, a data attribute, and the like.
According to an embodiment of the present disclosure, the program testing method further includes:
and displaying a use case selection page, wherein the use case selection page comprises a service use case selection area. And determining a business use case logic diagram corresponding to the target program in response to the selection operation aiming at the use case selection area. And generating a use case conversion request according to the service use case logic diagram.
According to an embodiment of the present disclosure, a 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.
According to the embodiment of the disclosure, the business use case logic diagram corresponding to the target program can be imported into the system through selection of the business use case logic diagram, and a corresponding use case conversion request is generated. Furthermore, a use case editing page can be displayed, and users can edit or compile the service use case so as to meet the use requirements of different users.
According to the embodiment of the disclosure, combining the target case units to generate the target test case comprises:
and generating a first target case group according to the target case unit. And processing the first target case group to generate a target test case.
According to the embodiment of the disclosure, by combining the target use case units, the use case units can be reconstructed into tree data, and the tree data can be used for page display or combination among use case groups.
According to the embodiment of the present disclosure, combining the target case units, and generating the target test case further includes:
and generating a plurality of second target use case groups according to the target use case units, wherein each second target use case group at least comprises one target use case unit. And generating a target case set according to the plurality of second target case groups. And processing the target case set to generate a target test case.
According to the embodiment of the disclosure, the use case units are combined to generate the use case group or the use case set, and then the target test case is generated according to the use case group or the use case set.
According to an embodiment of the present disclosure, the program testing method further includes:
and displaying a case display interface, wherein the case display interface comprises a test case display area. And responding to a display request aiming at the target test case, and importing the target test case into a case display interface so as to display the target test case based on the case display interface.
According to the embodiment of the disclosure, the target test case is displayed in a visual mode based on the case display interface, so that the visibility of the target test case can be improved, and a user can conveniently adjust and modify the target test case.
Fig. 5 schematically shows a block diagram of a program test device according to an embodiment of the present disclosure.
As shown in fig. 5, the program testing apparatus 500 includes a first obtaining module 501, a first responding module 502, a combining module 503, and a testing module 504.
A first obtaining module 501, configured to obtain a test request for testing a target program.
A first response module 502, configured to respond to the test request, obtain at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to the target program, where the service case logic diagram includes at least one service module case identifier, each service module case identifier corresponds to a multi-stage service scene case identifier, and each last-stage service scene case identifier in the multi-stage service scene case identifier corresponds to at least one case unit identifier.
And the combining module 503 is configured to combine the target case units to generate a target test case.
The test module 504 is configured to test the target program according to the target test case and output a test result.
According to the embodiment of the disclosure, at least one target case unit is obtained from case units stored in a case library according to a service case logic diagram by responding to a test request for testing a target program. And after the target case units are combined to generate a target test case, testing the target program to be tested according to the target test case to generate a test result. The target test case is composed of the target case units determined according to the service case logic diagram, so that the maintenance difficulty of the test case can be reduced, the maintenance cost of the test case is further reduced, and the dependence on the professional of a tester is reduced.
According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a second obtaining module, a second responding module, and a storing module.
And the second acquisition module is used for acquiring the use case conversion request, wherein the use case conversion request carries the service use case logic diagram corresponding to the target program.
And the second response module is used for responding to the use case conversion request, processing the service use case corresponding to the target program according to the service use case logic diagram and generating a plurality of use case units, wherein each use case unit corresponds to a use case unit identifier.
And the storage module is used for storing the plurality of case units into the case library.
According to an embodiment of the present disclosure, the second response module includes an analysis unit and a processing unit.
And the analysis unit is used for carrying out data analysis on the service cases and outputting analysis results.
And the processing unit is used for processing the service cases corresponding to the target program according to the service case logic diagram under the condition that the analysis result represents that the service cases have target data, and generating a plurality of case units, wherein the target data comprises protocol data, address data, request data and assertion data.
According to an embodiment of the present disclosure, a processing unit includes an extraction subunit and a generation subunit.
And the extraction subunit is used for performing data extraction on the service cases according to the target data based on the service case logic diagram to generate a plurality of initial case units.
And the generating subunit is used for generating the use case unit corresponding to each use case unit identifier according to the plurality of initial use case units.
According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a determining module and a first generating module.
And the determining module is used for determining the management information corresponding to each use case unit according to the use case unit identification, wherein the management information comprises organization information and user information for managing the use case units.
And the first generation module is used for generating the case units corresponding to the identifiers of each case unit according to the management information and the initial case units.
According to an embodiment of the present disclosure, the program testing apparatus 500 further includes a first presentation module, a third response module, and a second generation module.
The first display module is used for displaying a use case selection page, wherein the use case selection page comprises a service use case selection area.
And the third response module is used for responding to the selection operation aiming at the use case selection area and determining the service use case logic diagram corresponding to the target program.
And the second generation module is used for generating a use case conversion request according to the service use case logic diagram.
According to an embodiment of the present disclosure, the combining module 503 includes a first generating unit and a second generating unit.
And the first generating unit is used for generating a first target case group according to the target case unit.
And the second generating unit is used for processing the first target case group to generate the target test case.
According to an embodiment of the present disclosure, the combining module 503 further includes a first generating unit and a second generating unit.
And the third generating unit is used for generating a plurality of second target case groups according to the target case units, wherein each second target case group at least comprises one target case unit.
And the fourth generating unit is used for generating the target case set according to the plurality of second target case groups.
And the fifth generating unit is used for processing the target case set to generate the target test case.
According to an embodiment of the present disclosure, the program testing device 500 further includes a second presentation module and a fourth response module.
The second display module is used for displaying a case display interface, wherein the case display interface comprises a test case display area;
and the fourth response module is used for responding to the display request aiming at the target test case, and guiding the target test case into the case display interface so as to display the target test case based on the case display interface.
It should be noted that, the embodiments of the apparatus portion of the present disclosure correspond to the same or similar embodiments of the method portion of the present disclosure, and the detailed description of the present disclosure is omitted here.
Any of the modules, units, sub-units, or at least part of the functionality of any of them according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, units and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, units, sub-units according to the embodiments of the present disclosure may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any of them. Alternatively, one or more of the modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as computer program modules, which, when executed, may perform the corresponding functions.
For example, any plurality of the first obtaining module 501, the first responding module 502, the combining module 503 and the testing module 504 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality 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 obtaining module 501, the first responding module 502, the combining module 503 and the testing module 504 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of three implementations of software, hardware and firmware, or in a suitable combination of any of them. Alternatively, at least one of the first obtaining module 501, the first responding module 502, the combining module 503 and the testing module 504 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, an 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. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations 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 diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.
Claims (12)
1. A program testing method, comprising:
acquiring a test request for testing a target program;
responding to the test request, and acquiring at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to the target program, wherein the service case logic diagram comprises at least one service module case identifier, each service module case identifier corresponds to a multi-level service scene case identifier, and each final-level service scene case identifier in the multi-level service scene case identifiers corresponds to at least one case unit identifier;
combining the target case units to generate a target test case;
and testing the target program according to the target test case, and outputting a test result.
2. The method of claim 1, further comprising:
acquiring a use case conversion request, wherein the use case conversion request carries a service use case logic diagram corresponding to the target program;
responding to the use case conversion request, processing the service use case corresponding to the target program according to the service use case logic diagram, and generating a plurality of use case units, wherein each use case unit corresponds to a use case unit identifier;
storing a plurality of case units into the case library.
3. The method of claim 2, wherein the processing the service use case corresponding to the target program according to the service use case logic diagram to generate a plurality of use case units comprises:
performing data analysis on the service case, and outputting an analysis result;
and under the condition that the analysis result represents that the service use case has target data, processing the service use case corresponding to the target program according to the service use case logic diagram to generate a plurality of use case units, wherein the target data comprises protocol data, address data, request data and assertion data.
4. The method of claim 3, wherein the processing the service use case corresponding to the target program according to the service use case logic diagram to generate a plurality of use case units comprises:
based on the service case logic diagram, performing data extraction on the service cases according to the target data to generate a plurality of initial case units;
and generating the use case unit corresponding to each use case unit identification according to the plurality of initial use case units.
5. The method of claim 4, further comprising:
determining management information corresponding to each use case unit according to the use case unit identification, wherein the management information comprises organization information and user information for managing the use case units;
and generating the use case unit corresponding to each use case unit identification according to the management information and the initial use case unit.
6. The method of claim 2, further comprising:
displaying a use case selection page, wherein the use case selection page comprises a service use case selection area;
responding to the selection operation aiming at the use case selection area, and determining the service use case logic diagram corresponding to the target program;
and generating the use case conversion request according to the service use case logic diagram.
7. The method of claim 1, wherein the combining the target use case units to generate a target test case comprises:
generating a first target case group according to the target case unit;
and processing the first target case group to generate the target test case.
8. The method of claim 1, wherein the combining the target use case units to generate a target test case further comprises:
generating a plurality of second target use case groups according to the target use case units, wherein each second target use case group at least comprises one target use case unit;
generating a target case set according to the second target case groups;
and processing the target case set to generate the target test case.
9. The method of any of claims 1-8, further comprising:
displaying a case display interface, wherein the case display interface comprises a test case display area;
and responding to a display request aiming at the target test case, and importing the target test case into the case display interface so as to display the target test case based on the case display interface.
10. A program test device, comprising:
the first acquisition module is used for acquiring a test request for testing a target program;
the first response module is used for responding to the test request and acquiring at least one target case unit from case units stored in a case library according to a service case logic diagram corresponding to the target program, wherein the service case logic diagram comprises at least one service module case identifier, each service module case identifier corresponds to a multi-level service scene case identifier, and each final-level service scene case identifier in the multi-level service scene case identifiers corresponds to at least one case unit identifier;
the combination module is used for combining the target case units to generate a target test case;
and the test module is used 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 the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-9.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111017701.2A CN113656326A (en) | 2021-08-31 | 2021-08-31 | Program testing method, program testing device, computer system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111017701.2A CN113656326A (en) | 2021-08-31 | 2021-08-31 | Program testing method, program testing device, computer system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113656326A true CN113656326A (en) | 2021-11-16 |
Family
ID=78493395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111017701.2A Pending CN113656326A (en) | 2021-08-31 | 2021-08-31 | Program testing method, program testing device, computer system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113656326A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102799532A (en) * | 2012-07-20 | 2012-11-28 | 上海斐讯数据通信技术有限公司 | Method and system for designing test case |
US20140026120A1 (en) * | 2012-07-19 | 2014-01-23 | International Business Machines Corporation | Unit testing an enterprise javabeans (ejb) bean class |
US20180137026A1 (en) * | 2016-11-16 | 2018-05-17 | Paypal, Inc. | Service Test Validation Framework |
US20180343352A1 (en) * | 2017-05-29 | 2018-11-29 | Yuuichiroh Hayashi | Information processing system, information processing apparatus, and information processing method |
US20190361801A1 (en) * | 2018-05-23 | 2019-11-28 | 10546658 Canada Inc. | Method and system for cloud-based automated software testing |
CN112433944A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Service testing method, device, computer equipment and storage medium |
CN112597047A (en) * | 2020-12-29 | 2021-04-02 | 上海瑞家信息技术有限公司 | Test method, test device, electronic equipment and computer readable medium |
CN113032263A (en) * | 2021-03-25 | 2021-06-25 | 成都新希望金融信息有限公司 | Case test processing method and device, server and readable storage medium |
CN113032256A (en) * | 2021-03-19 | 2021-06-25 | 中国工商银行股份有限公司 | Automatic test method, device, computer system and readable storage medium |
WO2021135809A1 (en) * | 2019-12-30 | 2021-07-08 | 北京金山云网络技术有限公司 | Testing method, device, terminal apparatus, and storage medium |
CN113238968A (en) * | 2021-06-23 | 2021-08-10 | 中国农业银行股份有限公司 | System test method, apparatus, device, medium, and program product |
-
2021
- 2021-08-31 CN CN202111017701.2A patent/CN113656326A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140026120A1 (en) * | 2012-07-19 | 2014-01-23 | International Business Machines Corporation | Unit testing an enterprise javabeans (ejb) bean class |
CN102799532A (en) * | 2012-07-20 | 2012-11-28 | 上海斐讯数据通信技术有限公司 | Method and system for designing test case |
US20180137026A1 (en) * | 2016-11-16 | 2018-05-17 | Paypal, Inc. | Service Test Validation Framework |
US20180343352A1 (en) * | 2017-05-29 | 2018-11-29 | Yuuichiroh Hayashi | Information processing system, information processing apparatus, and information processing method |
US20190361801A1 (en) * | 2018-05-23 | 2019-11-28 | 10546658 Canada Inc. | Method and system for cloud-based automated software testing |
WO2021135809A1 (en) * | 2019-12-30 | 2021-07-08 | 北京金山云网络技术有限公司 | Testing method, device, terminal apparatus, and storage medium |
CN112433944A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Service testing method, device, computer equipment and storage medium |
CN112597047A (en) * | 2020-12-29 | 2021-04-02 | 上海瑞家信息技术有限公司 | Test method, test device, electronic equipment and computer readable medium |
CN113032256A (en) * | 2021-03-19 | 2021-06-25 | 中国工商银行股份有限公司 | Automatic test method, device, computer system and readable storage medium |
CN113032263A (en) * | 2021-03-25 | 2021-06-25 | 成都新希望金融信息有限公司 | Case test processing method and device, server and readable storage medium |
CN113238968A (en) * | 2021-06-23 | 2021-08-10 | 中国农业银行股份有限公司 | System test method, apparatus, device, medium, and program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110020329B (en) | Method, device and system for generating webpage | |
CN109359194B (en) | Method and apparatus for predicting information categories | |
CN109684188B (en) | Test method and device | |
CN111045653B (en) | System generation method and device, computer readable medium and electronic equipment | |
US10951486B2 (en) | Terminal device, UI expansion method, and UI expansion program | |
CN111913738A (en) | Access request processing method, device, computing equipment and medium | |
CN110780874B (en) | Method and device for generating information | |
CN113553123B (en) | Data processing method, device, electronic equipment and storage medium | |
CN111752834A (en) | Automatic testing method and device | |
CN113495498B (en) | Simulation method, simulator, device and medium for hardware device | |
CN113805877B (en) | Project engineering construction method and device based on IDEA plug-in | |
CN112965916B (en) | Page testing method, page testing device, electronic equipment and readable storage medium | |
CN113986258A (en) | Service publishing method, device, equipment and storage medium | |
CN108536715B (en) | Preview page generation method, device, equipment and storage medium | |
CN113362173A (en) | Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium | |
CN112860344A (en) | Component processing method and device, electronic equipment and storage medium | |
CN114691527A (en) | Unit test case generation method, apparatus, device, medium, and program product | |
CN113656326A (en) | Program testing method, program testing device, computer system and storage medium | |
CN113656041A (en) | Data processing method, device, equipment and storage medium | |
CN110874253B (en) | Display method and display system | |
CN111460273B (en) | Information pushing method and device | |
CN110196803B (en) | Software defect training method and system | |
CN113626301A (en) | Method and device for generating test script | |
CN113360417B (en) | Test method, session modifier, electronic device and medium | |
CN113760706B (en) | Webpage debugging method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |