CN117743128A - Test case construction method, storage medium and electronic equipment - Google Patents

Test case construction method, storage medium and electronic equipment Download PDF

Info

Publication number
CN117743128A
CN117743128A CN202211110470.4A CN202211110470A CN117743128A CN 117743128 A CN117743128 A CN 117743128A CN 202211110470 A CN202211110470 A CN 202211110470A CN 117743128 A CN117743128 A CN 117743128A
Authority
CN
China
Prior art keywords
test case
test
target
determining
data
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
Application number
CN202211110470.4A
Other languages
Chinese (zh)
Inventor
徐新杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211110470.4A priority Critical patent/CN117743128A/en
Publication of CN117743128A publication Critical patent/CN117743128A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a method and a device for constructing a test case, a storage medium and electronic equipment. Wherein the method comprises the following steps: acquiring business demand data of a target application; acquiring N test case templates matched with a target application based on service demand data, wherein N is a natural number greater than 1; under the condition that the operation steps of each test case template in the N test case templates are obtained, determining the business rule hung on each operation step; determining the testing intention corresponding to each testing case template by utilizing a business rule; and constructing test case templates corresponding to different test intentions in the N test cases to obtain M target test cases for testing the target application, wherein M is a natural number greater than 1. The application solves the technical problem of lower construction efficiency of the test case.

Description

Test case construction method, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computers, and in particular, to a method for constructing a test case, a storage medium, and an electronic device.
Background
In the construction scene of the test cases, the construction method is limited to factors such as test cost, and generally cannot be used for constructing all the test cases, but the construction method of the test cases needs to be manually planned;
However, the construction mode relying on human experience has certain misjudgment probability, the correct planning of the test cases which are favorable for improving the test effect cannot be ensured, meanwhile, the artificial participation also reduces the construction speed of the test cases, and the overall improvement of the construction efficiency is not facilitated. Therefore, there is a problem in that the construction efficiency of the test case is low.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a construction method, a storage medium and electronic equipment of a test case, and aims to at least solve the technical problem that the construction efficiency of the test case is low.
According to an aspect of an embodiment of the present application, there is provided a method for building a test case, including:
acquiring business demand data of a target application;
acquiring N test case templates matched with the target application based on the service demand data, wherein N is a natural number greater than 1;
under the condition that the operation steps of each test case template in the N test case templates are obtained, determining the business rule hung on each operation step;
determining the testing intention corresponding to each testing case template by using the business rule;
And constructing test case templates corresponding to different test intents in the N test cases to obtain M target test cases for testing the target application, wherein M is a natural number greater than 1.
According to another aspect of the embodiments of the present application, there is also provided a construction apparatus for a test case, including:
the first acquisition unit is used for acquiring business demand data of the target application;
the second acquisition unit is used for acquiring N test case templates matched with the target application based on the service demand data, wherein N is a natural number greater than 1;
the first determining unit is used for determining the business rule hung by each operation step under the condition that the operation step of each test case template in the N test case templates is obtained;
the second determining unit is used for determining the testing intention corresponding to each testing case template by using the business rule;
and the first construction unit is used for constructing test case templates corresponding to different test intents in the N test cases to obtain M target test cases for testing the target application, wherein M is a natural number greater than 1.
As an alternative, the second determining unit includes:
the first determining module is used for determining key operation steps of each test case template from the operation steps of each test case template by using the business rule;
and the second determining module is used for determining the testing intention corresponding to each testing case template based on the key operation steps.
As an alternative, the second determining module includes:
the first acquisition submodule is used for acquiring the operation type of the key operation step of each test case template;
and the first determining submodule is used for determining the operation intention corresponding to the operation type and determining the operation intention as the test intention.
As an optional solution, the first determining module further includes:
the second determining submodule is used for determining a plurality of first operation steps hung with the same business rule from the operation steps of each test case template;
a second obtaining sub-module, configured to obtain a target number of times that each of the plurality of first operation steps occurs in the respective test case template;
And the third determining submodule is used for determining a first target operation step with the target frequency being greater than or equal to a first preset threshold value from the plurality of first operation steps, and determining the first target operation step as the key operation step.
As an optional solution, the first determining module further includes:
the first clustering sub-module is used for clustering the operation steps of each test case template by utilizing the business rule to obtain a plurality of clustering sets, wherein the clustering sets comprise at least one second operation step;
a third obtaining sub-module, configured to obtain a target distance between each of the second operation steps and a cluster center of the respective cluster set;
and a fourth determining sub-module, configured to determine, from the plurality of second operation steps, a second target operation step in which the target distance is greater than or equal to a second preset threshold, and determine the second target operation step as the key operation step.
As an alternative, the first obtaining unit includes: and the third determining module is used for converting the service demand text into structured demand data and determining the structured demand data as the service demand data under the condition that the service demand text of the target application is acquired.
As an alternative, the apparatus further includes: :
the first display module is used for displaying a business requirement interface associated with the target application after the business requirement text is converted into structured requirement data and the structured requirement data is determined to be the business requirement data;
the second display module is used for responding to the query request executed on the service demand interface after the service demand text is converted into the structured demand data and the structured demand data is determined to be the service demand data, and displaying the queried service demand data; or, in response to the modification request executed on the service requirement interface, modifying the service requirement data.
As an alternative, the second display module includes at least one of the following:
the first response sub-module is used for responding to the modification and supplement request executed on the service demand interface and determining the corresponding charge demand data of the modification and supplement request as the service demand data;
the second response sub-module is used for responding to the modification and deletion request executed on the service requirement interface and deleting the requirement data corresponding to the modification and deletion request in the service requirement data;
And the third response sub-module is used for responding to the modification adjustment request executed on the service demand interface and adjusting the first demand data corresponding to the modification adjustment request in the service demand data into second demand data.
As an alternative, the apparatus further includes:
the first conversion module is used for converting the service demand text into characteristic demand data under the condition that the service demand text of the target application is acquired before the service demand data of the target application is acquired;
the first classification module is used for classifying the characterized demand data before acquiring the service demand data of the target application to obtain target indication information, wherein the target indication information is used for indicating the type of each information in the service demand text;
the fourth obtaining module, configured to obtain N test case templates matched with the target application based on the service requirement data, includes: and acquiring the N test case templates matched with the service demand data by utilizing the target indication information.
As an alternative, the apparatus further includes:
The first attribution unit is used for attributing the test case templates corresponding to the same test case group after determining the test intention corresponding to each test case template by using the business rule to obtain P test case groups, wherein P is a natural number greater than 1;
the first dividing unit is used for dividing the priorities of the test cases in each test case group in the P test case groups after determining the test intention corresponding to each test case template by using the business rule;
the third determining unit is configured to determine, after determining the test intention corresponding to each test case template by using the service rule, a target test case template from the N test case templates based on the priority when the case construction request is acquired;
and the second construction unit is used for constructing the target test case template after determining the test intention corresponding to each test case template by using the business rule so as to obtain the target test case.
As an alternative, the first construction unit includes: the construction module is used for constructing P test case templates of the N test cases based on the test intention to obtain P target test cases when the target number corresponding to the case construction resources is obtained and is greater than or equal to M, wherein the case construction resources are resources required for constructing the target test cases of the target number, and the P target test cases comprise the M target test cases.
As an alternative, the apparatus further includes:
a third obtaining unit, configured to obtain a plurality of sample test cases before obtaining N test case templates matched with the target application based on the service requirement data;
the analysis unit is used for analyzing the plurality of sample test cases to obtain a test case model before acquiring N test case templates matched with the target application based on the service demand data, wherein the test case model is used for outputting the test case templates;
the output unit, configured to obtain N test case templates matched with the target application based on the service requirement data before obtaining N test case templates matched with the target application based on the service requirement data, includes: and inputting the business requirement data into the test case model to obtain the N test case templates output by the test case model.
According to yet another aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the construction method of the test case as above.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the method for building the test case described above through the computer program.
In the embodiment of the application, service demand data of a target application is acquired; acquiring N test case templates matched with the target application based on the service demand data, wherein N is a natural number greater than 1; under the condition that the operation steps of each test case template in the N test case templates are obtained, determining the business rule hung on each operation step; determining the testing intention corresponding to each testing case template by using the business rule; the test case templates corresponding to different test intents in the N test cases are built to obtain M target test cases for testing the target applications, wherein M is a natural number larger than 1, under the condition that service demand data are acquired, the test case templates are firstly matched, then the test intents corresponding to the different test templates are determined according to the service rules hung in the different operation steps in the templates, the test cases are built according to the test templates with the determined test intents, and further the purposes of automatically building the test cases, avoiding the problems that important scenes cannot be covered and the test is damaged comprehensively due to misjudgment of the test personnel are achieved, so that the technical effect of improving the construction efficiency of the test cases is achieved, and the technical problem that the construction efficiency of the test cases is lower is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a schematic illustration of an application environment of an alternative test case construction method according to an embodiment of the present application;
FIG. 2 is a schematic illustration of a flow of an alternative test case construction method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 7 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 9 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 11 is a schematic illustration of a method of construction of an alternative test case according to an embodiment of the present application;
FIG. 12 is a schematic illustration of a method of construction of an alternative test case according to an embodiment of the present application;
FIG. 13 is a schematic illustration of a method of construction of an alternative test case according to an embodiment of the present application;
FIG. 14 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 15 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 16 is a schematic illustration of a method of construction of an alternative test case according to an embodiment of the present application;
FIG. 17 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 18 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 19 is a schematic diagram of an alternative test case construction method according to an embodiment of the present application;
FIG. 20 is a schematic diagram of a construction device for an alternative test case according to an embodiment of the present application;
Fig. 21 is a schematic structural view of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiment of the present application, a method for constructing a test case is provided, optionally, as an optional implementation manner, the method for constructing a test case may be, but is not limited to, applied to an environment as shown in fig. 1. Which may include, but is not limited to, a user device 102 and a server 112, which may include, but is not limited to, a display 104, a processor 106, and a memory 108, the server 112 including a database 114 and a processing engine 116.
The specific process comprises the following steps:
step S102, the user equipment 102 matches the test case template according to the service requirement data uploaded by the service requirement interface 1102;
step S104-S106, the test case template is sent to a server 112 through a network 110;
step S108-S110, the server 112 determines the corresponding test intention from the business rules corresponding to the test case templates through the processing engine, and further builds test cases based on the test case templates of different test intents;
steps S112-S114, send the built test cases to the user equipment 102 via the network 110,
in step S116, the user device 102 displays the target test cases on the user device via the processor 106 and the display 108, and further stores the test cases in the memory 104.
In addition to the example shown in fig. 1, the above steps may be performed by the client or the server independently, or by a combination of the client and the server, such as by the user device 102 executing the above steps of building the target test case, thereby relieving the processing pressure of the server 112. The user device 102 includes, but is not limited to, a handheld device (e.g., a mobile phone), a notebook computer, a desktop computer, a vehicle-mounted device, etc., and the present application is not limited to a particular implementation of the user device 102.
Optionally, as an optional implementation manner, as shown in fig. 2, the method for constructing the test case includes:
s202, acquiring business demand data of a target application;
s204, acquiring N test case templates matched with a target application based on service demand data, wherein N is a natural number greater than 1;
s206, under the condition that operation steps of each test case template in the N test case templates are obtained, determining a business rule hung on each operation step;
s208, determining the test intention corresponding to each test case template by using the business rule;
s210, building test case templates corresponding to different test intents in the N test cases to obtain M target test cases for testing target applications, wherein M is a natural number greater than 1.
Optionally, in this embodiment, the method for constructing test cases may be applied, but not limited to, in a software test scenario, in the existing software test technology, all test cases in a test case set are manually read, and according to the importance degree of the test scenario, the priorities of the test cases are manually marked, so as to guide the construction order of the test cases, but the manual marking has higher requirements on testers, and is difficult to avoid the influence caused by subjective judgment of the testers, and the efficiency of constructing the test cases is lower.
Optionally, in this embodiment, the service requirement data may be, but not limited to, a requirement document written according to a service flow of a user, may be, but not limited to, a service context, a processor, flow information, a user requirement, an interface requirement, and the like, and may be, but not limited to, a docx, doc, and the like format, for example, a requirement document corresponding to the map service requirement data includes a path step page, a service rule page, and a json format of the requirement document.
Optionally, in this embodiment, the path step page is composed of, for example, as shown in fig. 3, a target system 302, a case name 304, a main executor 306, an auxiliary executor 308, and a detailed step 310, where in the target system 302, the case name 304 records a test case in the system, the main executor 306 and the auxiliary executor 308 respectively record a party that actively triggers the flow and a party that follows the triggering flow, for example, in a payment system, the main executor 306 is a payment simplified registered user, the auxiliary executor 308 is a banking system, and in a payment test case where the case name 304 is a payment simplified registered user for a bank, the detailed step 310 is: the user submits payment information to request payment, the user cancels payment, the user submits payment information to request payment, the user selects to add bank card payment, the user submits payment information to request payment, and the user determines payment.
Optionally, in this embodiment, a business rule page of the requirement document, for example, as shown in fig. 4, shows a constraint association path 402 and a detailed rule 404, where the constraint association path 402 records an execution path where the business rule is located, and the detailed rule 404 may be formed by checking points, checking results, and processing modes, and specific rule content is configured in advance by a developer; json format of the requirements document.
Optionally, in this embodiment, the test case template is a test case template matched based on the service requirement data and the application where the service requirement data is located, which may be, but not limited to, a description of performing a test task on a specific software product, and may be, but not limited to, a service rule and a field list in a basic path, an extended path, a precondition, a post-condition, and a constraint.
Optionally, in this embodiment, the business rule may be, but not limited to, a constraint or definition of a business when the business is running, and is used to construct, control and influence a behavior of the business for the business, an operation specification, a management rule, a regulation system, an industry standard, and the like related to the business, and the test intention may be, but not limited to, a purpose of using a certain test case by a developer, where a name of the test case may basically embody a test intention of the test case template.
Optionally, in this embodiment, service requirement data of the target application is obtained, where the service requirement data includes a path step for operating the target application, service rules related to each operation step of the target application, and JSON format documents corresponding to the service requirement data, and a test case template is generated according to the service requirement data, where the test case template is shown in fig. 5, for example, and is displayed in an excel form, and includes a case type 502, an automation 504, a case name 506, a pre-condition 508, a case step 510, and an expected result 512, so that the operation steps of each test case template in the test case template are each hung with a service rule, one test case includes a plurality of operation steps, and the plurality of operation steps are hung with different service rules, so that corresponding to a plurality of test intents, further, different test intents are selected, and a plurality of test cases including the service rules corresponding to the different test intents are obtained, and construction is performed, so as to obtain M target test cases for testing the target application.
It should be noted that, through the test case template construction test case according to different test intentions, no longer rely on the experience of tester and the understanding to the test case, avoided because the misjudgement of people's reason, the important scene that leads to is not covered by the construction, and the test is comprehensively impaired, in addition through using the automatic construction test case of program, the efficiency compares people's brain analysis to separate out a large amount of test cases, has improved efficiency by a wide margin.
By way of further example, an optional path step 602 in the business need data, such as shown in fig. 6, comprises: the business rules 604 for the payment step in the business requirement data include: the method comprises the steps of meeting the rules that the balance of a user is larger than the commodity amount, user information fills in the specification, commodity transaction accords with laws and regulations and the like, converting business requirement data into a plurality of test case templates 606 containing information such as case types, automation, case names and the like, and dividing the test case templates 606 into payment function tests, canceling function tests and putting the payment function tests into shopping cart function tests through business rules 604 corresponding to path steps 602 contained in the test case templates 606, and constructing the test case templates 606 according to test intents 608 to obtain target test cases 610.
Further, for example, in the optional payment mode after the user submits the payment information and whether to use the voucher, in the using voucher step in the service requirement data, the related service rules include constraints on conditions such as the valid period of the voucher, applicable commodity, and the amount, the service requirement data is converted into a plurality of test case templates including information such as case types, automation, case names, and the like, different test intents are obtained through the service rules corresponding to the path steps included in the plurality of test case templates, the test intents are divided into a normal payment function test, a cancel payment function test, and a plurality of test intents such as the voucher function test are used, and the plurality of test case templates are constructed according to the plurality of test intents to obtain a plurality of target test cases.
According to the embodiment provided by the application, the service demand data of the target application is obtained; acquiring N test case templates matched with a target application based on service demand data, wherein N is a natural number greater than 1; under the condition that the operation steps of each test case template in the N test case templates are obtained, determining the business rule hung on each operation step; determining the testing intention corresponding to each testing case template by utilizing a business rule; and constructing test case templates corresponding to different test intentions in the N test cases to obtain M target test cases for testing target applications, wherein M is a natural number larger than 1, under the condition that service demand data are acquired, the test case templates are firstly matched, then the test intentions corresponding to the different test templates are determined according to the service rules hung in the different operation steps in the templates, and the test cases are constructed according to the test templates with the determined test intentions, so that the purposes of automatically constructing the test cases, avoiding the problems that important scenes cannot be covered and the comprehensiveness of the test is damaged due to misjudgment of the test personnel are achieved, and further realizing the technical effect of improving the construction efficiency of the test cases.
As an alternative, determining the test intention corresponding to each test case template by using the business rule comprises the following steps:
s1, determining key operation steps of each test case template from operation steps of each test case template by using business rules;
s2, determining the test intention corresponding to each test case template based on the key operation steps.
Optionally, in this embodiment, the key operation steps may, but are not limited to, operation steps for determining according to the combination of the repetition times of the operation steps and the risk degrees corresponding to different operation steps, so that the problem that the test comprehensiveness is low in the operation steps with fewer times but greater risk degrees in actual situations is considered, and the comprehensiveness of the test case construction is improved by the technical means of combining the combination times and the risk degrees.
Further illustratively, optionally, as shown in FIG. 7, for example, the operation 702 of a test case template is as follows: clicking the target application, setting information, adding a bank card, identifying face, confirming user information, setting a small amount of secret-free payment, selecting goods, paying goods, reminding a user of confirming information, confirming payment, setting the paid goods as a key operation step 704 because the paid goods are the steps with the largest repetition times, and setting the added bank card as the key operation step 704 because the risk coefficient of the added bank card is the highest.
It should be noted that, the testing intention of the test case template is determined through the operation steps hung with the same business rule, so that the key operation steps are determined according to different business rules, and the comprehensiveness and accuracy of the selection of the test case template are improved.
According to the embodiment provided by the application, the key operation steps of each test case template are determined from the operation steps of each test case template by utilizing the business rule; the testing intention corresponding to each testing case template is determined based on the key operation steps, so that the purpose of accurately determining the key operation steps in the testing case templates is achieved, and the technical effect of improving the comprehensiveness and the accuracy of testing case construction is achieved.
As an alternative, determining the test intent corresponding to each test case template based on the key operation steps includes:
s1, acquiring operation types of key operation steps of each test case template;
s2, determining an operation intention corresponding to the operation type, and determining the operation intention as a test intention.
Alternatively, in the present embodiment, the operation types may be, but are not limited to, classifying the key operation steps according to different test environments.
Optionally, in this embodiment, numbering or naming operations are performed according to key operation steps with different operation types, and then the test intention is obtained according to the numbers or names, so as to improve intuitiveness and accuracy of the test intention.
According to the embodiment provided by the application, the operation type of the key operation step of each test case template is obtained; the operation intention corresponding to the operation type is determined, the operation intention is determined as the test intention, and the purpose of directly determining the test intention according to different operation types is further achieved, so that the technical effects of improving the intuitiveness and efficiency of determining the test intention are achieved.
As an alternative, determining the key operation steps of each test case template from the operation steps of each test case template by using the business rule comprises the following steps:
s1, determining a plurality of first operation steps hung with the same business rule from the operation steps of each test case template;
s2, acquiring the target times of each first operation step in the plurality of first operation steps in the respective test case templates;
s3, determining a first target operation step with the target frequency being greater than or equal to a first preset threshold value from the plurality of first operation steps, and determining the first target operation step as a key operation step.
It should be noted that, by determining the first operation step with the target number of times greater than the threshold value as the technical means of the critical operation step, the purpose of performing repeated testing in the high-demand scenario is achieved.
Further by way of example, the content of the optional first test case template is, for example, a click target application-select target commodity-pay commodity-confirm payment, wherein the business rules are comprised of a rule for selecting target commodity and a payment rule, the content of the second test case template is, for example, a click target application-select target commodity-pay commodity-cancel payment, wherein the business rules are comprised of a rule for selecting target commodity and a rule for canceling payment, the third test case template is a click target application-selection target commodity-placement shopping cart, wherein the business rules are a rule for selecting the target commodity and a rule for placing the shopping cart, the operation of selecting the target commodity corresponding to the rule for selecting the target commodity is performed, the number of times of targets appearing in the three test case templates is 3 and is larger than a first preset threshold, and the step is determined as a key step.
According to the embodiment provided by the application, a plurality of first operation steps hung with the same business rule are determined from the operation steps of each test case template; acquiring the target times of each first operation step in the plurality of first operation steps in the respective test case templates; from a plurality of first operation steps, determining a first target operation step with the target frequency being greater than or equal to a first preset threshold value, and determining the first target operation step as a key operation step, thereby achieving the purpose of repeatedly testing under a high-demand scene, and further achieving the technical effect of saving test resources.
As an alternative, determining the key operation steps of each test case template from the operation steps of each test case template by using the business rule comprises the following steps:
s1, clustering operation steps of each test case template by utilizing a business rule to obtain a plurality of clustering sets, wherein the clustering sets comprise at least one second operation step;
s2, obtaining a target distance between each second operation step and a clustering center of each clustering set;
s3, determining a second target operation step with the target distance being greater than or equal to a second preset threshold value from the plurality of second operation steps, and determining the second target operation step as a key operation step.
Optionally, in this embodiment, the multiple clustering sets may, but are not limited to, be a process of classifying multiple test cases into multiple classes composed of test cases with higher similarity, and the clustering center may, but is not limited to, be a special test case in the cluster, and other test cases determine whether the test cases belong to the classes according to the distance between the calculation and the clustering center and the similarity difference.
Further by way of example, as shown in fig. 8, optionally, a machine learning algorithm is used, ten thousand test case templates are put into a machine learning algorithm model that has been learned, cluster analysis is performed on a plurality of test cases, and a cluster center 802 in each cluster set is determined, so as to obtain a plurality of different classes, such as a browsing class, a payment class, a filling information class, and the like, and obtain a target distance between a second operation step of each test case in each class and a respective cluster center 802, where the second operation step is greater than or equal to a second preset threshold, and the operation step is determined to be a key operation step 804.
It should be noted that, the machine learning algorithm is adopted to perform cluster analysis on the test cases in the case set, so as to determine the key operation steps, and under the condition of large data volume, the machine learning algorithm can improve the speed of determining the key operation steps.
Through the embodiment provided by the application, the operation steps of each test case template are clustered by utilizing the business rule to obtain a plurality of clustering sets, wherein the clustering sets comprise at least one second operation step; obtaining a target distance between each second operation step and a cluster center of the respective cluster set; and determining a second target operation step with the target distance being greater than or equal to a second preset threshold value from a plurality of second operation steps, and determining the second target operation step as a key operation step, so that the aim of determining the key operation step by adopting cluster analysis is fulfilled under the condition of large data volume, and the technical effect of improving the efficiency and speed of determining the key operation step is realized.
As an alternative, acquiring service requirement data of the target application includes:
and under the condition that the service demand text of the target application is acquired, converting the service demand text into structured demand data, and determining the structured demand data as the service demand data.
Optionally, in this embodiment, the service requirement text may be, but not limited to, an original text written for a scenario to be tested according to the target application, and the structured requirement data may be, but not limited to, data after processing the service requirement text and analyzing the service requirement text according to a certain rule.
It should be noted that, by converting the service requirement text into the structured requirement data, the subsequent deletion and correction of the service requirement data are facilitated, and the flexibility of editing the service requirement data is improved.
According to the embodiment provided by the application, under the condition that the service demand text of the target application is obtained, the service demand text is converted into the structured demand data, the structured demand data is determined to be the service demand data, and the purpose of converting the text into a computer language is achieved, so that the technical effect of improving the flexibility of editing the service demand data is achieved.
As an alternative, after converting the business requirement text into the structured requirement data and determining the structured requirement data as the business requirement data, the method further includes:
s1, displaying a business requirement interface associated with a target application;
s2, responding to the query request executed on the service demand interface, and displaying the queried service demand data; or, modifying the business requirement data in response to a modification request executed on the business requirement interface. ,
optionally, in this embodiment, the service requirement interface may be, but not limited to, a visual interface for performing censoring on the service requirement data, and may be, but not limited to, a module including modification information, text content, title, and the like.
Further by way of example, as shown in fig. 9, an optional interface presentation for modifying a structured requirement document, which is composed of an edit content 902 and a modification area 904, may be, but not limited to, operations of simultaneously selecting multiple steps to query and modify the interface.
By the embodiment provided by the application, the service demand interface associated with the target application is displayed; responding to the query request executed on the service demand interface, and displaying the queried service demand data; or, the service demand data is modified in response to the modification request executed on the service demand interface, so that the purpose of improving the modification efficiency of the service demand interface is achieved, and the technical effects of improving the flexibility and the diversity of the service demand interface are achieved.
As an alternative, the modification of the business requirement data in response to the modification request performed on the business requirement interface includes at least one of:
s1, responding to a modification and supplement request executed on a service demand interface, and determining charging demand data corresponding to the modification and supplement request as service demand data;
s2, deleting the demand data corresponding to the modification and deletion request in the service demand data in response to the modification and deletion request executed on the service demand interface;
And S3, responding to the modification adjustment request executed on the service demand interface, and adjusting the first demand data corresponding to the modification adjustment request in the service demand data into second demand data.
Further by way of example, optionally, for example, sending an add service requirement data request is performed on the service requirement interface 1002, and the service requirement data to be added is acquired, for example, as shown in (a) in fig. 10, in response to the add service requirement data request performed on the service requirement interface 1002, the add service requirement data is filled into the filling area 1004, and a filling result is returned to the service requirement interface 1002, after the service requirement interface 1002 receives the filling result, for example, as shown in (b) in fig. 10, the validity of the newly added document is checked, and detection is performed in the checking area 1006, so as to further improve accuracy.
According to the embodiment provided by the application, the modification and supplement request is responded to the modification and supplement request executed on the service demand interface, and the charging demand data corresponding to the modification and supplement request is determined to be the service demand data; deleting the demand data corresponding to the modification and deletion request in the service demand data in response to the modification and deletion request executed on the service demand interface; and responding to the modification and adjustment request executed on the service demand interface, and adjusting the first demand data corresponding to the modification and adjustment request in the service demand data into the second demand data, thereby achieving the purpose of directly supplementing, deleting and inquiring the service demand interface, and further achieving the technical effect of improving the convenience of editing the service demand data.
As an alternative, before acquiring the service requirement data of the target application, the method further includes:
s1, converting a business demand text into characteristic demand data under the condition that the business demand text of a target application is acquired;
s2, classifying the characterized demand data to obtain target indication information, wherein the target indication information is used for indicating the type of each information in the service demand text;
s3, based on the business demand data, acquiring N test case templates matched with the target application, wherein the N test case templates comprise: and acquiring N test case templates matched with the service demand data by utilizing the target indication information.
Optionally, in this embodiment, the characterized demand data may, but is not limited to, be a type of the target indication information obtained by performing the characterizing and classifying processing on the extracted corpus of the service demand data based on the service demand data, where the target indication information indicates a type of each information in the service demand text, and when the test case template is obtained, the matching may be performed based on the target indication information, so that the matching efficiency of the test case template is improved by using the classified information.
According to the embodiment provided by the application, under the condition that the service demand text of the target application is obtained, converting the service demand text into the characterized demand data; classifying the characterized demand data to obtain target indication information, wherein the target indication information is used for indicating the type of each information in the service demand text; based on the business demand data, acquiring N test case templates matched with the target application, including: the N test case templates matched with the business demand data are obtained by utilizing the target indication information, so that the purposes of obtaining classification information based on corpus analysis and the like and further improving the matching efficiency of the test case templates by utilizing the classification information are achieved, and the technical effects of improving the efficiency and accuracy of obtaining the test case templates are achieved.
As an alternative, after determining the test intent corresponding to each test case template by using the business rule, the method further includes:
s1, attributing test case templates corresponding to the same test intention to the same test case group to obtain P test case groups, wherein P is a natural number greater than 1;
s2, dividing the priorities of the test cases in each test case group in the P test case groups;
s3, under the condition that a case construction request is acquired, determining a target test case template from N test case templates based on priority;
and S4, building a target test case template to obtain a target test case.
Alternatively, in this embodiment, the test case groups may be, but are not limited to, a set of test cases divided according to the test intention, and the test cases in each test case group may be, but are not limited to, prioritized based on the risk and complexity, or any one of the test cases in the group may be randomly determined to be the highest priority.
It should be noted that, the test cases in the test case group are grouped, the priorities of the cases in the group are automatically marked, the manual marking of the test staff is not relied on, the problem that important scenes or more repeated test scenes cannot be covered by construction due to misjudgment of human reasons and the comprehensive damage of the test is caused because the priorities of the cases cannot be accurately marked is avoided, and the priorities of the test cases are automatically marked according to the program.
By way of further illustration, as shown in FIG. 11, the test case set name 1102 is a payment case set, there are three test cases in the case set, the first test case 1104 has contents of a click target application-select target commodity-enter payment interface-pay using bank card-cancel payment, the second test case 1106 has contents of a skip target application-skip target commodity-enter payment interface-pay using installment payment-confirm payment, and the third test case 1108 has contents of a click target application-select target commodity-enter payment interface-pay using credit card-confirm payment. The three test cases 1104 share the same steps: the step is marked as high priority, other steps are marked as low priority, and under the condition that a case construction request is acquired, the step is marked as high priority, a target test case template is determined based on the test intention of the same business rule corresponding to the step, and construction is carried out to obtain the target test case.
By way of further illustration, as shown in fig. 12, the test case set name 1202 is a payment case set, in which there are three test cases, the first test case 1204 has contents of a click target application-select target commodity-enter payment interface-pay using bank card-cancel payment, the second test case 1206 has contents of a skip target application-skip target commodity-enter payment interface-pay using installment payment-confirm payment, and the third test case 1208 has contents of a click target application-select target commodity-enter payment interface-pay using credit card-confirm payment. The three test cases 1204 share the same steps: the method comprises the steps of entering a payment interface, marking the step as a first priority, marking the step of paying by using a bank card as a second priority according to the highest risk coefficient of using the bank card, marking the step of paying by using the bank card as a third priority according to the highest risk coefficient, combining the risk coefficient and the times, marking the step of confirming the payment as a third priority, selecting test case templates according to the order of the priorities to construct when constructing test cases based on the marked priorities, and preferentially constructing the test case templates with higher priorities if construction resources are limited.
Through the embodiment provided by the application, the test case templates corresponding to the same test intention are assigned to the same test case group, so that P test case groups are obtained, wherein P is a natural number greater than 1; the method comprises the steps of dividing the priorities of test cases in each test case group in P test case groups; under the condition that a case construction request is acquired, determining a target test case template from N test case templates based on priority; and constructing the target test case template to obtain the target test case, so that the aim of automatically marking the priority of the test case is fulfilled, and the technical effects of improving the comprehensiveness and efficiency of the test case construction are realized.
As an alternative scheme, a test case template corresponding to different test intents in N test cases is constructed to obtain M target test cases for testing target applications, including:
under the condition that the target number corresponding to the case construction resources is obtained, and the target number is greater than or equal to M, building P test case templates of N test cases based on the test intention to obtain P target test cases, wherein the case construction resources are resources required for building the target number of target test cases, and the P target test cases comprise M target test cases.
Alternatively, in the present embodiment, the use case construction resource may be, but is not limited to, a resource required when constructing a target number of target test cases.
The construction target test cases are determined based on the quantity corresponding to the construction resources of the cases, and the beneficial effect of reducing the construction cost is achieved.
If the number of targets corresponding to the case construction resources is 100, if 120 target test cases are currently used, constructing 100 test cases with higher priority in the 120 test cases based on the test intention, and discarding the test cases with lower priority; if 90 target test cases are currently available, building the 90 test cases based on the test intention to obtain 90 target test cases.
According to the embodiment provided by the application, under the condition that the target number corresponding to the case construction resources is obtained and is greater than or equal to M, P test case templates of N test cases are constructed based on the test intention to obtain P target test cases, wherein the case construction resources are resources required for constructing the target test cases of the target number, the P target test cases comprise the M target test cases, and the purpose of determining the construction test case templates according to the number corresponding to the construction resources is achieved, so that the technical effect of saving computing resources is achieved.
As an alternative, before acquiring N test case templates matched by the target application based on the service requirement data, the method further includes:
s1, acquiring a plurality of sample test cases;
s2, analyzing a plurality of sample test cases to obtain a test case model, wherein the test case model is used for outputting a test case template;
s3, based on the business demand data, acquiring N test case templates matched with the target application, wherein the N test case templates comprise: and inputting the business demand data into the test case model to obtain N test case templates output by the test case model.
Alternatively, in this embodiment, the sample test case may include, but is not limited to, a system case or a historical case, and the test case model may be, but is not limited to, a model constructed by a test case algorithm customized by a developer.
Optionally, in this embodiment, before the matched test case templates are obtained, the system case and the historical case may be analyzed, where the system case is a test case preconfigured in the system according to different test environments, the historical case is a test case used when the test case templates are matched in the history, a test model is constructed after analysis, a test model may be constructed in the test model by using a directed graph of case steps, traversing paths in multiple steps, mounting service rules on key nodes, and the like, then the test case algorithm is customized to analyze the test model, and a test scene set is abstracted, that is, a test case template is automatically generated for each test scene, and finally a test case set is constructed, where thousands of test case templates may exist in each test case set.
According to the embodiment provided by the application, a plurality of sample test cases are obtained; analyzing the plurality of sample test cases to obtain a test case model, wherein the test case model is used for outputting a test case template; based on the business demand data, acquiring N test case templates matched with the target application, including: the business demand data is input into the test case model to obtain N test case templates output by the test case model, so that the purpose of matching the test case templates through the model is achieved, and the technical effect of improving the matching efficiency of the test case templates is achieved.
The method for constructing the test case is applied to a specific software test scene, and optionally, as shown in fig. 13, the embodiment mainly relates to three systems, which are respectively: a demand management system 1302, a feature library system 1304, and a test case automatic generation system 1306; the specific flow is that the demand management system 1302 sends the demand document information to the test case automatic generation system 1306, and simultaneously sends the extracted corpus to the feature library system 1304 for characterization and classification requests, and the feature library system 1304 reads corpus classification information and conflict corpus information to the test case automatic generation system 1306 after characterization and classification; the requirement management system 1302 is an architecture mode of a browser and a server, and the feature library system 1304 and the test case automatic generation system 1306 are background services, which are deployed in the server, and can be divided into deployment environment hardware parameters and deployment environment software parameters, but not limited to. The following specific method according to the three systems is as follows:
The demand management system 1302 is a typical management information system, and is a browser-server structure, and a complete information management cycle of demand is shown in fig. 14, where (a) in fig. 14 is a new demand, a user uploads a demand document to the web browser 1402, the web browser 1402 parses and processes the demand document to the demand management system logic layer 1404, at this time, the demand management system logic layer 1404 reports a new corpus to the feature library system 1304, the feature library system 1304 receives the new corpus, and feeds back a successful report result to the demand management system logic layer 1404, the demand management system logic layer 1404 receives the report success feedback, and then constructs document data in the demand management system data processing layer 1406, and further, records data in the database 1408, and at the same time, the demand management system data processing layer 1406 returns a recording and receiving result to the demand management system logic layer 1404, and then returns a recording and receiving result to the web browser 1402, and finally, the web browser 1402 confirms the recording result to the user.
In fig. 14 (b), in the case of a query request, the user sends a query request to the web browser 1402, the requirement management system logic layer 1404 processes the query request and assembles data in the requirement management system data processing layer 1406, the requirement management system data processing layer 1406 assembles data and then reads the data from the database 1408, the requirement management system logic layer 1404 further returns data to the requirement management system logic layer 1404 after receiving the data returned from the database 1408, the requirement management system logic layer 1404 further returns data to the web browser 1402, and the web browser 1402 returns browsing data to the user after receiving the returned data.
In fig. 14 (c), in the scenario of modification requirement, the user sends modification requirement to the web browser 1402, the requirement management system logic layer 1404 processes the modification requirement and then reports the new corpus to the feature library system 1304, the feature library system 1304 receives the new corpus and feeds back the successful reporting result to the requirement management system logic layer 1404, the requirement management system logic layer 1404 receives the successful reporting result and then processes the modification requirement to the requirement management system data processing layer 1406, after the requirement management system data processing layer 1406 processes the modification requirement, the requirement management system data processing layer 1406 sends modification data to the database 1408, and meanwhile returns a received modification result to the requirement management system logic layer 1404, the requirement management system logic layer 1404 returns a received modification result to the web browser 1402, and the web browser 1402 receives the modification result and then sends confirmation modification result to the user.
The working content of the feature library system 1304 is to characterize the natural language corpus in the system cases, select a proper implementation mode for the features, namely, classify the features, maintain conflict relations among the features, and the results of the feature library system after the processing are used by an automatic test case generation system as some materials referenced in the generation process.
The working content of the test case automatic generation system 1306 mainly includes 5 parts, for example, as shown in fig. 15, respectively, step S1502, test case basic data screening; step S1504, generating a test case set; step S1506, grouping the test cases concentrated in force according to the test intention; step S1508, marking the priorities of the test cases in the same group; step S1510, guiding the construction order of the cases according to the priorities of the test cases.
In step S1502, test case basic data is screened, and abstract services are converted into standard models mainly through UML modeling, so as to guide the whole software development process. After the service modeling and the conceptual modeling, a system use case of the service can be abstracted, as shown in fig. 16, the system use case is mainly composed of an executor 1602, a pre-condition 1604, a post-condition 1606, a basic path 1608, a basic path 1610, an extended path 1612, a supplemental constraint 1614 and a crowd-related benefit 1616, wherein the supplemental constraint 1614 is mainly composed of a field list, a service rule, a non-functional requirement and a design constraint, and a path is further formed according to a step corresponding to the supplemental constraint 1614, or the supplemental constraint 1614 directly generates the path, wherein the path includes the basic path 1608 and the extended path 1612, the executor is mainly divided into a main executor and an auxiliary executor, and in addition, the system use case has a relationship with a target object in a database. The demand management system organizes and lands the components in the system cases in an organized manner, wherein the data on which the test case generation is most dependent includes basic paths, extended paths, preconditions, post-conditions, and business rules and field lists in supplemental constraints.
Step S1504, generating a test case set, which is specifically as follows: analyzing the system cases, constructing a test model (a case step directed graph, a plurality of step traversing paths, business rules hung on key nodes and the like), analyzing the test model by a customized test case algorithm, abstracting a test scene set, automatically generating test cases for each test scene, and finally constructing a test case set. There may be thousands of test cases in each test case set, each of which consists of a name, preconditions, operating steps, and expected results.
Step S1506, grouping the test cases with concentrated forces according to the test intention, and crying as follows: the names of the test cases can be designed as follows: the name of the behavior test case type test case= { the name of the system case } { the two-stage step description on the- { key node } { the system verification user step description }, or the name of the rule test case type test case = { the name of the system case } { the- { system request user step description } -check { the name of the service rule table }, so that the name of the case basically reflects the test intention of the test case, the names of some test cases can be the same because the same step description appears multiple times in the system case and the same service rule is hung on the same step, and therefore, the generation algorithm can generate the test case with the same name for the same service rule under the same step. Each test case is thus generated by a step, i.e., the critical step of the test case.
For example, as shown in fig. 17, the result of the feedback of the verification user is that the short message verification code is submitted, and verification does not pass through this step many times in the use case, but a validity rule of the system verification subscription short message verification code is hung on this step, and the validity rule of the system verification subscription short message verification code has 2 columns and represents 2 scenes, so that the 2 scenes on each step are covered by the test case. Therefore, the test cases in the case set may be grouped according to the test names, and the test cases in each group may be counted according to the key steps to which they belong, so that, for example, as shown in fig. 18, it may be composed of step number 1802 and test case number 1804.
Step S1508, performing priority labeling on test cases in the same packet, specifically: considering that the same business rule in the system cases basically corresponds to the same block of processing codes, the same business rule is normally effective in one step, but the possibility of failure in another step is low, so that for the test cases in the same group, the test cases in a certain key step can be marked as high priority, and the test cases in other key steps are marked as low priority. For example, as shown in FIG. 19, a priority label 1902 is displayed at the test number, with test cases for every 1 critical step labeled high priority, and test cases for other critical steps labeled low priority.
Step S1510, according to the priority of the test cases, guiding the construction order of the test cases, specifically: and finally, according to the priorities of the test cases, planning the sequence of the case construction by combining the resource abundance conditions of the case construction, and preferentially constructing the test cases with high priorities, wherein the test cases with low priorities are delayed to be constructed or directly discarded.
It will be appreciated that in the specific embodiments of the present application, related data such as user information is referred to, and when the above embodiments of the present application are applied to specific products or technologies, user permissions or consents need to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
According to another aspect of the embodiment of the application, a construction device for a test case is also provided, wherein the construction device is used for implementing the construction method for the test case. As shown in fig. 20, the apparatus includes:
a first obtaining unit 2002, configured to obtain service requirement data of a target application;
a second obtaining unit 2004, configured to obtain N test case templates matched with the target application based on the service requirement data, where N is a natural number greater than 1;
a first determining unit 2006, configured to determine, when operation steps of each of the N test case templates are acquired, a service rule that is hung by each operation step;
a second determining unit 2008, configured to determine a test intention corresponding to each test case template by using a business rule;
the first construction unit 2010 is configured to construct test case templates corresponding to different test intents in the N test cases, so as to obtain M target test cases for the test target application, where M is a natural number greater than 1.
The specific embodiments may refer to examples shown in the construction apparatus of the test case, and in this example, details are not described herein.
As an alternative, the second determining unit 2008 includes:
The first determining module is used for determining key operation steps of each test case template from the operation steps of each test case template by utilizing the business rules;
and the second determining module is used for determining the test intention corresponding to each test case template based on the key operation steps.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the second determining module includes:
the first acquisition submodule is used for acquiring the operation type of the key operation step of each test case template;
the first determining submodule is used for determining an operation intention corresponding to the operation type and determining the operation intention as a test intention.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an optional solution, the first determining module further includes:
the second determining submodule is used for determining a plurality of first operation steps hung with the same business rule from the operation steps of each test case template;
the second acquisition submodule is used for acquiring the target times of each first operation step in the plurality of first operation steps in the respective test case templates;
And the third determining submodule is used for determining a first target operation step with the target frequency being greater than or equal to a first preset threshold value from the plurality of first operation steps, and determining the first target operation step as a key operation step.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an optional solution, the first determining module further includes:
the first clustering sub-module is used for clustering the operation steps of each test case template by utilizing the business rule to obtain a plurality of clustering sets, wherein the clustering sets comprise at least one second operation step;
a third obtaining sub-module, configured to obtain a target distance between each second operation step and a cluster center of the respective cluster set;
and the fourth determining submodule is used for determining a second target operation step with the target distance being greater than or equal to a second preset threshold value from a plurality of second operation steps, and determining the second target operation step as a key operation step.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the first obtaining unit 2002 includes: and the third determining module is used for converting the business requirement text into structured requirement data under the condition that the business requirement text of the target application is acquired, and determining the structured requirement data as the business requirement data.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the apparatus further includes: :
the first display module is used for displaying a business requirement interface associated with the target application after converting the business requirement text into structured requirement data and determining the structured requirement data as the business requirement data;
the second display module is used for responding to the query request executed on the service demand interface after converting the service demand text into the structured demand data and determining the structured demand data as the service demand data, and displaying the queried service demand data; or, modifying the business requirement data in response to a modification request executed on the business requirement interface.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the second display module includes at least one of the following:
the first response sub-module is used for responding to the modification and supplement request executed on the service demand interface and determining the charge demand data corresponding to the modification and supplement request as service demand data;
the second response sub-module is used for responding to the modification and deletion request executed on the service requirement interface and deleting the requirement data corresponding to the modification and deletion request in the service requirement data;
and the third response sub-module is used for responding to the modification adjustment request executed on the service demand interface and adjusting the first demand data corresponding to the modification adjustment request in the service demand data into the second demand data.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the apparatus further includes:
the first conversion module is used for converting the business requirement text into characteristic requirement data under the condition that the business requirement text of the target application is acquired before the business requirement data of the target application is acquired;
the first classification module is used for classifying the characterized demand data to obtain target indication information before acquiring the service demand data of the target application, wherein the target indication information is used for indicating the type of each information in the service demand text;
The fourth obtaining module obtains N test case templates matched with the target application based on the service demand data, including: and acquiring N test case templates matched with the service demand data by utilizing the target indication information.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the apparatus further includes:
the first attribution unit is used for attributing the test case templates corresponding to the same test intents to the same test case group after determining the test intents corresponding to each test case template by utilizing the business rules to obtain P test case groups, wherein P is a natural number larger than 1;
the first dividing unit is used for dividing the priorities of the test cases in each test case group in the P test case groups after determining the test intention corresponding to each test case template by utilizing the business rule;
the third determining unit is used for determining a target test case template from the N test case templates based on priority under the condition that the test case construction request is acquired after determining the test intention corresponding to each test case template by utilizing the business rule;
And the second construction unit is used for constructing the target test case template after determining the test intention corresponding to each test case template by utilizing the business rule to obtain the target test case.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the first construction unit 2010 includes: the construction module is used for constructing P test case templates of N test cases based on the test intention under the condition that the target number corresponding to the case construction resources is obtained and is greater than or equal to M, so as to obtain P target test cases, wherein the case construction resources are resources required for constructing the target test cases of the target number, and the P target test cases comprise M target test cases.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
As an alternative, the apparatus further includes:
the third acquisition unit is used for acquiring a plurality of sample test cases before acquiring N test case templates matched with the target application based on the service demand data;
The analysis unit is used for analyzing the plurality of sample test cases to obtain a test case model before N test case templates matched with the target application are obtained based on the service demand data, wherein the test case model is used for outputting the test case templates;
the output unit is configured to obtain N test case templates matched with the target application based on the service requirement data before obtaining N test case templates matched with the target application based on the service requirement data, and includes: and inputting the business demand data into the test case model to obtain N test case templates output by the test case model.
Specific embodiments may refer to examples shown in the above-mentioned test case construction method, and in this example, details are not described herein.
According to a further aspect of the embodiments of the present application, there is also provided an electronic device for implementing the method of construction of a test case as described above, as shown in fig. 21, the electronic device comprising a memory 2102 and a processor 2104, the memory 2102 having stored therein a computer program, the processor 2104 being arranged to execute the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring service demand data of a target application;
s2, acquiring N test case templates matched with a target application based on service demand data, wherein N is a natural number greater than 1;
s3, under the condition that operation steps of each test case template in the N test case templates are obtained, determining a service rule hung on each operation step;
s4, determining the test intention corresponding to each test case template by utilizing the business rule;
s5, building test case templates corresponding to different test intentions in the N test cases to obtain M target test cases for testing target applications, wherein M is a natural number larger than 1.
Alternatively, it will be understood by those skilled in the art that the structure shown in fig. 21 is only schematic, and the electronic device may also be a terminal device such as a smart phone (e.g. an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 21 is not limited to the structure of the electronic device described above. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 21, or have a different configuration than shown in FIG. 21.
The memory 2102 may be configured to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for building a test case in the embodiment of the present application, and the processor 2104 executes the software programs and modules stored in the memory 2102, thereby executing various functional applications and data processing, that is, implementing the method for building a test case described above. Memory 2102 may include high speed random access memory, but may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 2102 may further include memory located remotely from the processor 2104, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 2102 may be used to store, but is not limited to, test case templates and test cases. As an example, as shown in fig. 21, the memory 2102 may include, but is not limited to, a first acquiring unit 2002, a second acquiring unit 2004, a first determining unit 2006, a second determining unit 2008, and a first constructing unit 2010 in a constructing apparatus including the test case. In addition, other module units in the construction device of the test case may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 2106 is used to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 2106 includes a network adapter (Network Interface Controller, NIC) that can be connected to other network equipment and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 2106 is a Radio Frequency (RF) module for communicating wirelessly with the internet.
In addition, the electronic device further includes: a display 2108 for displaying the information such as the test case template and the test case; and a connection bus 2110 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the plurality of nodes through a network communication. Among them, the nodes may form a Peer-To-Peer (P2P) network, and any type of computing device, such as a server, a terminal, etc., may become a node in the blockchain system by joining the Peer-To-Peer network.
According to one aspect of the present application, a computer program product is provided, comprising a computer program/instructions containing program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via a communication portion, and/or installed from a removable medium. When executed by a central processing unit, performs the various functions provided by the embodiments of the present application.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It should be noted that the computer system of the electronic device is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
The computer system includes a central processing unit (Central Processing Unit, CPU) which can execute various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) or a program loaded from a storage section into a random access Memory (Random Access Memory, RAM). In the random access memory, various programs and data required for the system operation are also stored. The CPU, the ROM and the RAM are connected to each other by bus. An Input/Output interface (i.e., I/O interface) is also connected to the bus.
The following components are connected to the input/output interface: an input section including a keyboard, a mouse, etc.; an output section including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, and a speaker, and the like; a storage section including a hard disk or the like; and a communication section including a network interface card such as a local area network card, a modem, and the like. The communication section performs communication processing via a network such as the internet. The drive is also connected to the input/output interface as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, and the like are mounted on the drive as needed so that a computer program read therefrom is mounted into the storage section as needed.
In particular, according to embodiments of the present application, the processes described in the various method flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such embodiments, the computer program may be downloaded and installed from a network via a communication portion, and/or installed from a removable medium. The computer program, when executed by a central processing unit, performs the various functions defined in the system of the present application.
According to one aspect of the present application, there is provided a computer-readable storage medium, from which a processor of a computer device reads the computer instructions, the processor executing the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring service demand data of a target application;
s2, acquiring N test case templates matched with a target application based on service demand data, wherein N is a natural number greater than 1;
s3, under the condition that operation steps of each test case template in the N test case templates are obtained, determining a service rule hung on each operation step;
s4, determining the test intention corresponding to each test case template by utilizing the business rule;
s5, building test case templates corresponding to different test intentions in the N test cases to obtain M target test cases for testing target applications, wherein M is a natural number larger than 1.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods of the various embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and are merely a logical functional division, and there may be other manners of dividing the apparatus in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (15)

1. A method of constructing a test case, comprising:
acquiring business demand data of a target application;
acquiring N test case templates matched with the target application based on the service demand data, wherein N is a natural number greater than 1;
Under the condition that the operation steps of each test case template in the N test case templates are obtained, determining the business rule hung on each operation step;
determining the test intention corresponding to each test case template by utilizing the business rule;
and constructing test case templates corresponding to different test intents in the N test cases to obtain M target test cases for testing the target application, wherein M is a natural number greater than 1.
2. The method of claim 1, wherein determining the test intent corresponding to each test case template using the business rules comprises:
determining key operation steps of each test case template from the operation steps of each test case template by utilizing the business rule;
and determining the testing intention corresponding to each testing case template based on the key operation steps.
3. The method of claim 2, wherein determining the test intent corresponding to each test case template based on the critical operation steps comprises:
acquiring operation types of key operation steps of each test case template;
And determining an operation intention corresponding to the operation type, and determining the operation intention as the test intention.
4. The method of claim 2, wherein the determining the key operation step of each test case template from the operation steps of each test case template using the business rule comprises:
determining a plurality of first operation steps hung with the same business rule from the operation steps of each test case template;
acquiring the target times of each first operation step in the plurality of first operation steps in the respective test case templates;
and determining a first target operation step of which the target frequency is greater than or equal to a first preset threshold value from the plurality of first operation steps, and determining the first target operation step as the key operation step.
5. The method of claim 2, wherein the determining the key operation step of each test case template from the operation steps of each test case template using the business rule comprises:
clustering the operation steps of each test case template by utilizing the business rule to obtain a plurality of clustering sets, wherein the clustering sets comprise at least one second operation step;
Obtaining a target distance between each second operation step and a cluster center of each cluster set;
and determining a second target operation step of which the target distance is greater than or equal to a second preset threshold value from the second operation steps, and determining the second target operation step as the key operation step.
6. The method of claim 1, wherein the obtaining business requirement data of the target application comprises:
and under the condition that the service demand text of the target application is acquired, converting the service demand text into structured demand data, and determining the structured demand data as the service demand data.
7. The method of claim 6, wherein after said converting said business need text into structured need data and determining said structured need data as said business need data, said method further comprises:
displaying a business requirement interface associated with the target application;
responding to the query request executed on the service demand interface, and displaying the queried service demand data; or, modifying the business requirement data in response to a modification request executed on the business requirement interface.
8. The method of claim 7, wherein modifying the business requirement data in response to a modification request performed on the business requirement interface comprises at least one of:
responding to a modification and supplement request executed on the service demand interface, and determining charging demand data corresponding to the modification and supplement request as the service demand data;
deleting the required data corresponding to the modification and deletion request in the service required data in response to the modification and deletion request executed on the service required interface;
and responding to the modification adjustment request executed on the business requirement interface, and adjusting the first requirement data corresponding to the modification adjustment request in the business requirement data into second requirement data.
9. The method of claim 6, wherein the step of providing the first layer comprises,
before the obtaining the service requirement data of the target application, the method further includes:
under the condition that the service demand text of the target application is obtained, converting the service demand text into characterized demand data;
classifying the characterized demand data to obtain target indication information, wherein the target indication information is used for indicating the type of each information in the service demand text;
The obtaining N test case templates matched with the target application based on the service demand data includes: and acquiring the N test case templates matched with the business requirement data by utilizing the target indication information.
10. The method of any one of claims 1 to 9, wherein after the determining the test intent corresponding to each test case template using the business rule, the method further comprises:
attributing the test case templates corresponding to the same test intention to the same test case group to obtain P test case groups, wherein P is a natural number greater than 1;
dividing the priorities of the test cases in each test case group in the P test case groups;
under the condition that a case construction request is acquired, determining a target test case template from the N test case templates based on the priority;
and constructing the target test case template to obtain the target test case.
11. The method according to any one of claims 1 to 9, wherein the constructing test case templates corresponding to different test intents in the N test cases to obtain M target test cases for testing the target application includes:
Under the condition that the target number corresponding to the case construction resources is obtained, and the target number is greater than or equal to M, building P test case templates of the N test cases based on the test intention to obtain P target test cases, wherein the case construction resources are resources required for building the target number of target test cases, and the P target test cases comprise the M target test cases.
12. The method according to any one of claims 1 to 9, wherein,
before the N test case templates matched by the target application are obtained based on the service requirement data, the method further includes:
acquiring a plurality of sample test cases;
analyzing the plurality of sample test cases to obtain a test case model, wherein the test case model is used for outputting the test case template;
the obtaining N test case templates matched with the target application based on the service demand data includes: and inputting the business demand data into the test case model to obtain the N test case templates output by the test case model.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program is executable by a terminal device or a computer to perform the method of any one of claims 1 to 12.
14. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 12.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 12 by means of the computer program.
CN202211110470.4A 2022-09-13 2022-09-13 Test case construction method, storage medium and electronic equipment Pending CN117743128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211110470.4A CN117743128A (en) 2022-09-13 2022-09-13 Test case construction method, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211110470.4A CN117743128A (en) 2022-09-13 2022-09-13 Test case construction method, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117743128A true CN117743128A (en) 2024-03-22

Family

ID=90276257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211110470.4A Pending CN117743128A (en) 2022-09-13 2022-09-13 Test case construction method, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117743128A (en)

Similar Documents

Publication Publication Date Title
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
US10135936B1 (en) Systems and methods for web analytics testing and web development
CN110275861B (en) Data storage method and device, storage medium and electronic device
US20230289828A1 (en) Data processing method, computer device, and readable storage medium
US10884826B2 (en) System and method for establishing common request processing
US20170109639A1 (en) General Model for Linking Between Nonconsecutively Performed Steps in Business Processes
CN107862425B (en) Wind control data acquisition method, device and system and readable storage medium
CN110362479B (en) System upgrade test method and system
CN110083526A (en) Applied program testing method, device, computer installation and storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN110659870A (en) Business audit test method, device, equipment and storage medium
CN112529100A (en) Training method and device for multi-classification model, electronic equipment and storage medium
US10956914B2 (en) System and method for mapping a customer journey to a category
US20170109640A1 (en) Generation of Candidate Sequences Using Crowd-Based Seeds of Commonly-Performed Steps of a Business Process
CN112131127B (en) Interface testing method, device and system and electronic equipment
US20170109670A1 (en) Crowd-Based Patterns for Identifying Executions of Business Processes
CN116955148A (en) Service system testing method, device, equipment, storage medium and product
CN117743128A (en) Test case construction method, storage medium and electronic equipment
CN116932360A (en) Page testing method and device, computer equipment and storage medium
CN114281549A (en) Data processing method and device
JP2019526129A (en) Apparatus and method for digital media measurement including a user panel
CN114003567A (en) Data acquisition method and related device
CN113485942A (en) Automatic testing method and device based on independent module
CN113297358A (en) Data processing method, device, server and computer readable storage medium

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