CN114385499A - Test case generation method and device, computer equipment and storage medium - Google Patents

Test case generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114385499A
CN114385499A CN202210030711.8A CN202210030711A CN114385499A CN 114385499 A CN114385499 A CN 114385499A CN 202210030711 A CN202210030711 A CN 202210030711A CN 114385499 A CN114385499 A CN 114385499A
Authority
CN
China
Prior art keywords
file package
test
target
file
test case
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
CN202210030711.8A
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.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service 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 Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202210030711.8A priority Critical patent/CN114385499A/en
Publication of CN114385499A publication Critical patent/CN114385499A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application is applicable to the technical field of automatic testing, and provides a method and a device for generating a test case, computer equipment and a storage medium, wherein the method comprises the following steps: downloading a file package matched with the file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users; the file package comprises executable codes used for generating test data according to set test requirements; selecting a target file package from the file package set based on a target test requirement file, and embedding output parameters of executable codes in the target file package into a test case generation template; and operating the target file package, and generating a test case based on the test case generation template embedded with the output parameters. The scheme can ensure normal development of test work and improve efficiency.

Description

Test case generation method and device, computer equipment and storage medium
Technical Field
The application belongs to the technical field of automated testing, and particularly relates to a test case generation method and device, computer equipment and a storage medium.
Background
Interface testing is an essential process in system development. The interface test is mainly used for detecting the usability test of the interactive interface between the external system and the system and between each subsystem in the system.
An automatic test platform is adopted to realize interface test in the prior art, and test configuration and test execution are carried out by testers. Traditional tool platform function development needs to do research to users, collect requirements, influence surface analysis and then schedule implementation.
Because the development personnel of the automation platform are few, the cooperation and support work is numerous, the individual requirements are not known, the function development needs to be developed after schedule, the realization time is longer, and the communication cost is higher. Therefore, the existing development scheme of the automation platform cannot meet the requirements of users in different functional systems, and often has rule agreement or access in interface definition, so that the test work is blocked, and the personalized function is often updated along with the updating of the function of the service system, if the personalized function is not followed up in time, tools maintained on the automation platform cannot be executed, the execution of the tools of the automation platform is influenced, and the function realization or the test work of the tools on the platform is blocked.
Disclosure of Invention
The embodiment of the application provides a test case generation method and device, computer equipment and a storage medium, and aims to solve the problems that in the prior art, the automation platform development often has rule agreement or access in interface definition, and personalized function updating is not timely, so that the function of a tool is realized or test work is blocked.
A first aspect of an embodiment of the present application provides a method for generating a test case, including:
downloading a file package matched with the file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users; the file package comprises executable codes used for generating test data according to set test requirements;
selecting a target file package from the file package set based on a target test requirement file, and embedding output parameters of executable codes in the target file package into a test case generation template;
and operating the target file package, and generating a test case based on the test case generation template embedded with the output parameters.
Optionally, the selecting a target package from the package set based on the target test requirement file includes:
analyzing the target test requirement file to obtain the target test requirement of the object to be tested;
providing a test case compiling page, wherein the test case compiling page displays the file packages in the file package set and the functional description of test data generated by each file package according to the set test requirements;
acquiring a candidate file package which is selected from the test case compiling page based on the object to be tested from the outside;
and based on the target test requirement, determining the candidate file package as the target file package when the set test requirement according to the function of generating test data by the candidate file package is judged to be consistent with the target test requirement.
Optionally, after obtaining the candidate file package selected from the test case writing page by the external part based on the object to be tested, the method further includes:
and based on the target test requirement, when the set test requirement according to the function of generating the test data by the candidate file package is judged to be inconsistent with the target test requirement, outputting file package reselection prompt information in the test case compiling page until the set test requirement according to the function of generating the test data by the candidate file package is consistent with the target test requirement.
Optionally, the downloading, from a data warehouse, the file package matched with the file package information to a platform local to form a file package set based on file package information entered by different platform users includes:
setting a test sample template for a platform user in a platform;
acquiring the file packet information input by different platform users, wherein the file packet information comprises storage addresses of file packets in a data warehouse or key characteristic information of the file packets;
downloading the file packages matched with the file package information from the data warehouse to a platform to form a file package set locally based on the file package information;
and the file package is uploaded to the data warehouse after the platform user generates the file package based on the test sample template.
Optionally, the running the target file package, and generating a test case based on the test case generation template embedded with the output parameter, include:
running the target file package, and generating target test data according to a set test requirement through an executable code in the target file package;
and assigning the target test data to the output parameters embedded in the test case generation template, and operating the test case generation template embedded with the output parameters to generate the test case.
Optionally, the running the target file package, generating a template based on the test case embedded with the output parameter, and after generating the test case, further includes:
executing the test case, and performing performance evaluation on the target file package based on an execution result of the test case to obtain a performance evaluation value;
based on the performance evaluation value, removing the target file package from the file package set when the evaluation performance of the target file package is determined not to reach a set standard.
Optionally, the executing the test case, performing performance evaluation on the target package based on an execution result of the test case, and after obtaining a performance evaluation value, further includes:
and combining the performance evaluation value and the historical performance evaluation value of the target file package, and solidifying the target file package to the local platform when determining that the evaluation performance of the target file package reaches the set standard.
A second aspect of the embodiments of the present application provides a device for generating a test case, including:
the acquisition module is used for downloading a file package matched with the file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users; the file package comprises executable codes used for generating test data according to set test requirements;
the parameter setting module is used for selecting a target file package from the file package set based on a target test requirement file and embedding the output parameters of the executable codes in the target file package into a test case generation template;
and the test case generation module is used for operating the target file package and generating a test case based on the test case generation template embedded with the output parameters.
A third aspect of embodiments of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, in which a computer program is stored, which, when executed by a processor, performs the steps of the method according to the first aspect.
A fifth aspect of the present application provides a computer program product, which, when run on a terminal, causes the terminal to perform the steps of the method of the first aspect described above.
From the above, in the embodiment of the present application, based on the information of the file package recorded by different platform users, the file package capable of generating test data according to the set test requirement is downloaded from the data warehouse to the platform to form the file package set locally, the output parameter of the executable code in the target file package is embedded into the test case generation template, and finally the test case is generated based on the file package and the test case generation template, in the process, the file package capable of generating test data developed by the user is obtained through the test platform, so that different file packages have the generation function of interface test data required by different functional systems, the entry and exit on the rule convention or interface definition are avoided, the sharing of the file package is realized, the automatic generation of the test case in the automatic platform tool is ensured, the richness of the function of the platform tool is ensured, and the normal development of the test work is ensured, the efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a first flowchart of a method for generating a test case according to an embodiment of the present application;
fig. 2 is a second flowchart of a method for generating a test case according to an embodiment of the present application;
fig. 3 is a structural diagram of a test case generation apparatus according to an embodiment of the present application;
fig. 4 is a block diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, the terminals described in embodiments of the present application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a terminal that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
It should be understood that, the sequence numbers of the steps in this embodiment do not mean the execution sequence, and the execution sequence of each process should be determined by the function and the inherent logic of the process, and should not constitute any limitation to the implementation process of the embodiment of the present application.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Referring to fig. 1, fig. 1 is a first flowchart of a method for generating a test case according to an embodiment of the present application.
As shown in fig. 1, a method for generating a test case includes the following steps:
step 101, downloading a file package matched with file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users.
The file packages in the data warehouse are specifically compiled and uploaded by different platform users. After the written file package is uploaded to the data warehouse by the platform user, the file package information can be input into the automation platform, and the automation platform can download from the data warehouse based on the file package information.
Wherein, the file packet information includes: the storage address of the file package in the data warehouse or the key characteristic information of the file package. The automation platform may use the storage address or key characteristic information of the file package to find the corresponding file package from the data repository to perform the downloading action.
The file package comprises executable codes used for generating test data according to set test requirements.
The set test requirement is, for example, a login interface test and a data access interface test, and the generated test data is, for example, a plurality of login accounts and passwords which are automatically and randomly generated, a plurality of virtual accounts and passwords which are randomly matched from a test database, or a plurality of virtual accounts and passwords which are randomly matched from the test database and are automatically and randomly generated data ID and access address.
By executing the executable codes in the file packet, the test data can be generated according to the set test requirements, the rule convention or the deviation in the interface definition is avoided, and the convenience and the accuracy of the test data generation are ensured.
Specifically, in implementation, a platform user can use a maven packaging mode to output an executable jar toolkit and upload a maven private server.
Wherein, one jar packet corresponds to one method class and the method which can be realized by the method class. After the platform user generates the jar packet with the corresponding test function, the jar packet is uploaded to a data warehouse, and the collection of jar packets with different test data generation functions is realized in the data warehouse so that the test platform can realize the calling of jar packets.
In the process, the automatic platform reserves an interactive window, and the toolkit can be uploaded to a maven warehouse after a platform user realizes the development of a corresponding test data generation function according to the service attribute of the personalized function module of the platform user. After jar information issued by maven of the toolkit is input on the automation platform or the designated position stored in the data warehouse by the jar package is input, the automation platform can download and import the toolkit.
As an optional implementation manner, the downloading, from the data warehouse, the file package matched with the file package information to the platform local to form the file package set based on the file package information entered by different platform users includes:
setting a test sample template for a platform user in the platform;
acquiring file package information input by different platform users, wherein the file package information comprises storage addresses of file packages in a data warehouse or key characteristic information of the file packages;
downloading the file packages matched with the file package information from the data warehouse to the platform to form a file package set locally based on the file package information;
and the file package is generated by the platform user based on the test sample template and then uploaded to a data warehouse.
The test sample template is used for explaining the unified compiling specification of the test data required in the current platform for a platform user.
Specifically, the test sample template includes the provided sample document, sample and source code. And providing the user with the standard guidance through the sample document, the sample and the source code.
Different platform users can write corresponding data generation codes of interface test requirements by combining the service attributes of the personalized function modules of the platform users based on the test sample template, and the data generation codes are used for generating data required by the interface test corresponding to the service attributes of the personalized function modules.
102, selecting a target file package from a file package set based on a target test requirement file, and embedding output parameters of executable codes in the target file package into a test case generation template;
specifically, the current test requirement is recorded in the target test requirement file, and the target file package can be selected based on the file, so that the corresponding test data can be automatically generated.
The target test requirement file is input into the test platform by a tester. Specifically, the target test requirement file is obtained by directly uploading a written document to the test platform by a tester, or is obtained by writing the document on the test platform by the tester based on the test requirement.
Or, a test requirement file library may be integrated in the test platform, and a test requirement file in the test requirement file library may be used by a user to select a file based on a current test requirement, and the selected file is edited and modified to generate a target test requirement file, so that the test efficiency and the intelligence of the test operation are improved.
As an optional implementation manner, selecting a target file package from the file package set based on the target test requirement file includes:
analyzing the target test requirement file to obtain the target test requirement of the object to be tested;
providing a test case compiling page, wherein the test case compiling page displays the file packages in the file package set and the function description of test data generated by each file package according to the set test requirement;
acquiring a candidate file package selected from a test case compiling page based on an external object to be tested;
and based on the target test requirement, determining the candidate file package as the target file package when the set test requirement according to which the function of generating the test data by the candidate file package is judged to be consistent with the target test requirement.
The target test requirement file is analyzed to obtain test requirement contents such as test preconditions, test parameters, test sequences and the like corresponding to different objects to be tested.
The target test requirements file may contain test tasks for different interfaces. For example, in order to perform interface test on smart homes in a room, the interface test is performed on the lighting control module first, and then the interface test can be performed on the sound control module, so that test parameters and test sequences corresponding to different interfaces to be tested can be obtained.
When the target file package is selected from the file package set based on the target test requirement file, the file can be analyzed and the file package can be automatically matched, and the target file package can be selected based on user selection operation.
Specifically, a test case compiling page is provided for a user, a file package and a file package function which can be selected by an external user are displayed, and when the external user selects a related file package in the test case compiling page, the platform provides auxiliary judgment of a selection result for the external user, so that professional business requirements on testers are reduced, and correct development of testing work of personalized functions is promoted.
Correspondingly, after acquiring the candidate file package selected from the test case writing page based on the object to be tested, the method further comprises the following steps:
and based on the target test requirement, when the set test requirement according to the function of generating the test data by the candidate file package is judged to be inconsistent with the target test requirement, outputting file package reselection prompt information in the test case compiling page until the set test requirement according to the function of generating the test data by the candidate file package is consistent with the target test requirement.
In the process, the test platform provides a function of selecting the file package by the user and provides an auxiliary judgment function of the user selection result so as to meet more practical test requirements of the client and ensure the correct generation of the test case.
Further, after the target file package is selected from the file package set based on the target test requirement file, the output parameters of the executable codes in the target file package need to be embedded into the test case generation template.
The test case generation template is a test case generation template matched with the target test requirement of the object to be tested.
The test case generation template can be uploaded from a user side, shared by a third-party platform or pre-trained.
The test case generation template may include a test case generation code, and a set position in the test case generation code is used for embedding data required by the test.
In the application process, the output parameters of the executable codes in the target file package are embedded into the corresponding positions in the test case generation template, the test data generated after the target file package is operated are embedded into the test case generation template in a parameter transmission mode, and the test data are directly processed through the test case generation template to generate the corresponding test cases.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
And 103, operating the target file package, and generating a test case based on the test case generation template embedded with the output parameters.
When the target file package is operated, the executable code in the target file package is specifically triggered and executed, so that corresponding test data can be generated according to the set test requirement, and the output of the data is realized through the output parameters of the target file package after the test data is generated.
After the target data is obtained, the assignment filling of the test data in the test case generation template is realized based on the test case generation template embedded with the output parameters, and the corresponding test case is generated.
That is, the running target file package generates a test case based on a test case generation template embedded with output parameters, and the method includes:
running the target file package, and generating target test data according to the set test requirements through executable codes in the target file package; and assigning the target test data to the output parameters embedded in the test case generation template, and operating the test case generation template embedded with the output parameters to generate the test case.
In the embodiment of the application, based on the information of the file package input by different platform users, the file package capable of generating test data according to the set test requirement is downloaded from a data warehouse to the platform to form a file package set locally, after a target file package is selected from the file package set based on a target test requirement file, the output parameter of the executable code in the target file package is embedded into a test case generation template, the test case generation template is combined, and the target file package is operated to generate a final test case, in the process, the file package capable of generating the test data and developed by the users is obtained through the test platform, so that different file packages have the generation function of interface test data required by different functional systems, the entry and exit on rule convention or interface definition are avoided, the sharing of the file package is realized, and the automatic generation of the test case in an automatic platform tool is ensured, the richness of the functions of the platform tool is ensured, the normal development of test work is ensured, and the efficiency is improved.
The embodiment of the application also provides different implementation modes of the test case generation method.
Referring to fig. 2, fig. 2 is a second flowchart of a method for generating a test case according to an embodiment of the present application. As shown in fig. 2, a method for generating a test case includes the following steps:
step 201, downloading the file package matched with the file package information from the data warehouse to the local platform to form a file package set based on the file package information input by different platform users.
The file package comprises executable codes used for generating test data according to set test requirements.
The implementation process of this step is the same as that of step 101 in the foregoing embodiment, and is not described here again.
Step 202, based on the target test requirement file, selecting a target file package from the file package set, and embedding the output parameters of the executable codes in the target file package into the test case generation template.
The implementation process of this step is the same as that of step 102 in the foregoing embodiment, and is not described here again.
And 203, operating the target file package, and generating a test case based on the test case generation template embedded with the output parameters.
The implementation process of this step is the same as the implementation process of step 103 in the foregoing embodiment, and is not described here again.
And 204, executing the test case, and performing performance evaluation on the target file package based on the execution result of the test case to obtain a performance evaluation value.
When the performance of the target file package is evaluated, the factors such as whether the execution result of the test case meets the expectation, whether the execution process of the test case has a test fault, the execution time consumption of the test case and the like can be referred as performance evaluation reference items. The reference items may be adjusted according to actual application scenarios and test requirements, but not limited thereto.
After the performance evaluation value is obtained, the management and the updating of the file package can be realized on the basis.
And step 205, based on the performance evaluation value, removing the target file package from the file package set when the evaluation performance of the target file package is determined not to reach the set standard.
And step 206, combining the performance evaluation value and the historical performance evaluation value of the target file package, and solidifying the target file package to the local platform when the evaluation performance of the target file package is determined to reach the set standard.
When the performance evaluation value of the file package is not ideal, the file package can be removed, and the usability and the use effect of the platform tool are improved.
When the current performance evaluation value of the file package is better and the historical performance evaluation results are better, the file package can be solidified into the test platform, the reuse rate and the use efficiency of the file package are realized, and the convenience and the intelligent degree of the platform are improved.
In this embodiment, the test platform obtains the file package capable of generating the test data developed by the user, so that different file packages have the generating function of the interface test data required by different functional systems, rule agreement or access in interface definition is avoided, sharing of the file package is realized, automatic generation of test cases in the automatic platform tool is ensured, management and effective multiplexing of the file packages generated by different platform users are realized, functional diversification and test automation performance of the test platform are improved, normal development of test work is ensured, and efficiency is improved.
Referring to fig. 3, fig. 3 is a block diagram of a test case generation apparatus according to an embodiment of the present application, and only a part related to the embodiment of the present application is shown for convenience of description.
The test case generation device 300 includes:
the acquisition module 301 is configured to download a file package matched with file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users; the file package comprises executable codes used for generating test data according to set test requirements;
a parameter setting module 302, configured to select a target file package from the file package set based on a target test requirement file, and embed an output parameter of an executable code in the target file package into a test case generation template;
and the test case generation module 303 is configured to run the target file package, and generate a test case based on the test case generation template in which the output parameters are embedded.
The parameter setting module 302 is specifically configured to:
analyzing the target test requirement file to obtain the target test requirement of the object to be tested;
providing a test case compiling page, wherein the test case compiling page displays the file packages in the file package set and the functional description of test data generated by each file package according to the set test requirements;
acquiring a candidate file package which is selected from the test case compiling page based on the object to be tested from the outside;
and based on the target test requirement, determining the candidate file package as the target file package when the set test requirement according to the function of generating test data by the candidate file package is judged to be consistent with the target test requirement.
The parameter setting module 302 is further specifically configured to:
and based on the target test requirement, when the set test requirement according to the function of generating the test data by the candidate file package is judged to be inconsistent with the target test requirement, outputting file package reselection prompt information in the test case compiling page until the set test requirement according to the function of generating the test data by the candidate file package is consistent with the target test requirement.
The obtaining module 301 is specifically configured to:
setting a test sample template for a platform user in a platform;
acquiring the file packet information input by different platform users, wherein the file packet information comprises storage addresses of file packets in a data warehouse or key characteristic information of the file packets;
downloading the file packages matched with the file package information from the data warehouse to a platform to form a file package set locally based on the file package information;
and the file package is uploaded to the data warehouse after the platform user generates the file package based on the test sample template.
The test case generation module 303 is specifically configured to:
running the target file package, and generating target test data according to a set test requirement through an executable code in the target file package;
and assigning the target test data to the output parameters embedded in the test case generation template, and operating the test case generation template embedded with the output parameters to generate the test case.
The device also includes: an evaluation module to:
executing the test case, and performing performance evaluation on the target file package based on an execution result of the test case to obtain a performance evaluation value; based on the performance evaluation value, removing the target file package from the file package set when the evaluation performance of the target file package is determined not to reach a set standard.
And the evaluation module is also used for combining the performance evaluation value and the historical performance evaluation value of the target file package, and solidifying the target file package to the local platform when the evaluation performance of the target file package is determined to reach the set standard.
The device for generating the test case provided by the embodiment of the application can realize each process of the embodiment of the method for generating the test case, can achieve the same technical effect, and is not repeated here to avoid repetition.
Fig. 4 is a block diagram of a computer device according to an embodiment of the present disclosure. As shown in the figure, the computer apparatus 4 of this embodiment includes: at least one processor 40 (only one shown in fig. 4), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, the steps of any of the various method embodiments described above being implemented when the computer program 42 is executed by the processor 40.
The computer device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The computer device 4 may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a computer device 4 and is not intended to limit computer device 4 and may include more or fewer components than those shown, or some of the components may be combined, or different components, e.g., the computer device may also include input output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. The memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the computer device 4. The memory 41 is used for storing the computer program and other programs and data required by the computer device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The present application realizes all or part of the processes in the method of the above embodiments, and may also be implemented by a computer program product, when the computer program product runs on a terminal, the steps in the above method embodiments may be implemented when the terminal executes the computer program product.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for generating a test case is characterized by comprising the following steps:
downloading a file package matched with the file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users; the file package comprises executable codes used for generating test data according to set test requirements;
selecting a target file package from the file package set based on a target test requirement file, and embedding output parameters of executable codes in the target file package into a test case generation template;
and operating the target file package, and generating a test case based on the test case generation template embedded with the output parameters.
2. The method of claim 1, wherein selecting a target portfolio from the set of portfolio based on a target test requirements file comprises:
analyzing the target test requirement file to obtain the target test requirement of the object to be tested;
providing a test case compiling page, wherein the test case compiling page displays the file packages in the file package set and the functional description of test data generated by each file package according to the set test requirements;
acquiring a candidate file package which is selected from the test case compiling page based on the object to be tested from the outside;
and based on the target test requirement, determining the candidate file package as the target file package when the set test requirement according to the function of generating test data by the candidate file package is judged to be consistent with the target test requirement.
3. The method according to claim 2, wherein after obtaining the candidate file package externally selected from the test case writing page based on the object to be tested, the method further comprises:
and based on the target test requirement, when the set test requirement according to the function of generating the test data by the candidate file package is judged to be inconsistent with the target test requirement, outputting file package reselection prompt information in the test case compiling page until the set test requirement according to the function of generating the test data by the candidate file package is consistent with the target test requirement.
4. The method of claim 1, wherein the downloading the documentary package matched with the documentary package information from a data warehouse to a platform local to form a documentary package set based on the documentary package information entered by different platform users comprises:
setting a test sample template for a platform user in a platform;
acquiring the file packet information input by different platform users, wherein the file packet information comprises storage addresses of file packets in a data warehouse or key characteristic information of the file packets;
downloading the file packages matched with the file package information from the data warehouse to a platform to form a file package set locally based on the file package information;
and the file package is uploaded to the data warehouse after the platform user generates the file package based on the test sample template.
5. The method of claim 1, wherein the running the target package of files, generating test cases based on a test case generation template embedded with the output parameters, comprises:
running the target file package, and generating target test data according to a set test requirement through an executable code in the target file package;
and assigning the target test data to the output parameters embedded in the test case generation template, and operating the test case generation template embedded with the output parameters to generate the test case.
6. The method according to claim 1, wherein the running the target package further comprises, after generating a test case based on a test case generation template embedded with the output parameters:
executing the test case, and performing performance evaluation on the target file package based on an execution result of the test case to obtain a performance evaluation value;
based on the performance evaluation value, removing the target file package from the file package set when the evaluation performance of the target file package is determined not to reach a set standard.
7. The method according to claim 6, wherein the executing the test case, and performing performance evaluation on the target package based on the execution result of the test case, further comprises:
and combining the performance evaluation value and the historical performance evaluation value of the target file package, and solidifying the target file package to the local platform when determining that the evaluation performance of the target file package reaches the set standard.
8. An apparatus for generating a test case, comprising:
the acquisition module is used for downloading a file package matched with the file package information from a data warehouse to a platform local to form a file package set based on the file package information input by different platform users; the file package comprises executable codes used for generating test data according to set test requirements;
the parameter setting module is used for selecting a target file package from the file package set based on a target test requirement file and embedding the output parameters of the executable codes in the target file package into a test case generation template;
and the test case generation module is used for operating the target file package and generating a test case based on the test case generation template embedded with the output parameters.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202210030711.8A 2022-01-12 2022-01-12 Test case generation method and device, computer equipment and storage medium Pending CN114385499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210030711.8A CN114385499A (en) 2022-01-12 2022-01-12 Test case generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210030711.8A CN114385499A (en) 2022-01-12 2022-01-12 Test case generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114385499A true CN114385499A (en) 2022-04-22

Family

ID=81202206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210030711.8A Pending CN114385499A (en) 2022-01-12 2022-01-12 Test case generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114385499A (en)

Similar Documents

Publication Publication Date Title
US10481875B2 (en) Generation of an application from template
US10466971B2 (en) Generation of an application from data
US8312417B2 (en) Using dynamic call graphs for creating state machines
CN103518393A (en) Systems and methods for testing content of mobile communication devices
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
US11763201B1 (en) System and methods for model management
CN114297700B (en) Dynamic and static combined mobile application privacy protocol extraction method and related equipment
EP4085336A1 (en) Computer resource leak detection
CN113869789A (en) Risk monitoring method and device, computer equipment and storage medium
CN112650673A (en) Method and device for creating test case in transaction tracking system and electronic equipment
CN110489563B (en) Method, device, equipment and computer readable storage medium for representing graph structure
CN109992614B (en) Data acquisition method, device and server
CN111435348A (en) Method for creating runtime executable program for data analysis function
CN114385499A (en) Test case generation method and device, computer equipment and storage medium
US20220122038A1 (en) Process Version Control for Business Process Management
CN112905931B (en) Page information display method and device, electronic equipment and storage medium
CN113656044A (en) Android installation package compression method and device, computer equipment and storage medium
CN114385155A (en) vue project visualization tool generation method, device, equipment and storage medium
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN110262856B (en) Application program data acquisition method, device, terminal and storage medium
CN113849785B (en) Mobile terminal information asset use behavior identification method for application program
CN111581915A (en) Project task management method, platform, electronic equipment and storage medium
CN115546356A (en) Animation generation method and device, computer equipment and storage medium
CN113392014A (en) Test case generation method and device, electronic equipment and medium
CN115292194A (en) Process debugging method, electronic device 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