CN114048144A - Method, device, computer equipment and medium for constructing program - Google Patents

Method, device, computer equipment and medium for constructing program Download PDF

Info

Publication number
CN114048144A
CN114048144A CN202111403322.7A CN202111403322A CN114048144A CN 114048144 A CN114048144 A CN 114048144A CN 202111403322 A CN202111403322 A CN 202111403322A CN 114048144 A CN114048144 A CN 114048144A
Authority
CN
China
Prior art keywords
program
case
use case
constructed
scene
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
CN202111403322.7A
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.)
Hanyun Technology Co Ltd
Original Assignee
Hanyun Technology 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 Hanyun Technology Co Ltd filed Critical Hanyun Technology Co Ltd
Priority to CN202111403322.7A priority Critical patent/CN114048144A/en
Publication of CN114048144A publication Critical patent/CN114048144A/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis
    • 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/3696Methods or tools to render software testable

Abstract

The application provides a method, a device, a computer device and a medium for constructing a program, wherein the method comprises the following steps: acquiring a test parameter set of a program to be constructed and construction scene information; determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; and calling the target program use case in the program to be constructed. According to the method and the device, based on the fact that the program to be constructed calls the target program case, the test parameters in the test parameter set are input into the sub-cases of the target program case to obtain the test result, and the work efficiency of test workers is improved by improving the reusability of the test script.

Description

Method, device, computer equipment and medium for constructing program
Technical Field
The present application relates to the field of application software testing, and in particular, to a method, an apparatus, a computer device, and a medium for constructing a program.
Background
In the prior art, automatic test workers usually use different cases to complete the test of various functions in the process of compiling automatic scripts, because of different test scenes, the operation steps may have a plurality of same parts, the repeated operation steps are packaged into keywords in the conventional mode at present, and the keywords are quoted in the cases, although the test scripts of part repeated operation steps can be reduced for the workers, the whole cases are repeated in the test scenes, and the whole cases can not be reused based on the conventional mode of packaging the repeated operation steps into the keywords, so that the problem of poor reusability of the test scripts exists, and the work efficiency of the test workers is further influenced.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a computer device, and a medium for constructing a program, so as to solve the problem in the prior art that a test script is poor in reusability, and improve the work efficiency of test workers by improving the reuse rate of the test script.
In a first aspect, an embodiment of the present application provides a method for building a program, where the method includes:
acquiring a test parameter set of a program to be constructed and construction scene information;
determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case;
calling the target program use case in the program to be constructed;
in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result;
and if the test result meets the preset requirement, completing the construction of the program to be constructed.
Optionally, the constructing scenario information includes at least one second scenario keyword, and the determining, according to the constructing scenario information and the scenario keyword corresponding to each candidate program use case, a target program use case in a plurality of candidate program use cases includes:
and aiming at each second scene keyword, screening out a target program use case matched with the second scene keyword from a plurality of candidate program use cases according to the constructed scene information and the first scene keyword corresponding to each candidate program use case.
Optionally, the invoking the target program use case in the program to be constructed includes:
and for each second scene keyword, calling the target program use case matched with the second scene keyword to a program position of the second scene keyword corresponding to the program to be constructed.
Optionally, the test parameter set includes a parameter identifier and parameter data; each sub-case in the target program use case carries a use case identifier; the inputting the test parameters into the sub-cases of the target program use case in the process of calling the target program use case in the program to be constructed comprises the following steps:
for each sub-case in the target program use case, determining a test parameter corresponding to the sub-case according to the parameter identifier of each test parameter in the test parameter set in the process of calling the target program use case in the program to be constructed, and inputting the parameter data of the test parameter to the sub-case; and the parameter identification of the test parameter corresponding to the sub-case is the same as the case identification of the sub-case.
Optionally, the calling method further includes:
and when the test result does not meet the preset requirement, correcting the target program use case in the program to be constructed.
In a second aspect, the present application provides an apparatus for constructing a program, comprising:
the acquisition module is used for acquiring a test parameter set of a program to be constructed and construction scene information;
the determining module is used for determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the scene first keyword corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case;
the calling module is used for calling the target program use case in the program to be constructed;
the result generation module is used for inputting the test parameters in the test parameter set to the sub-cases of the target program case to obtain a test result in the process of calling the target program case in the program to be constructed;
and the building module is used for finishing building the program to be built if the test result meets the preset requirement.
Optionally, the constructed scene information includes at least one second scene keyword, and the determining module includes:
and the matching unit is used for screening out target program use cases matched with the second scene keywords from the plurality of candidate program use cases according to the constructed scene information and the first scene keywords corresponding to each candidate program use case aiming at each second scene keyword.
Optionally, the invoking module includes:
and the first calling unit is used for calling the target program case matched with the second scene keyword to a program position of the second scene keyword corresponding to the program to be constructed aiming at each second scene keyword.
Optionally, the test parameter set includes a parameter identifier and parameter data; each sub-case in the target program use case carries a use case identifier; the result generation module comprises:
the first input unit is used for determining a test parameter corresponding to each sub-case in the target program use case according to the parameter identification of each test parameter in the test parameter set in the process of calling the target program use case in the program to be constructed and inputting the parameter data of the test parameter to the sub-case; and the parameter identification of the test parameter corresponding to the sub-case is the same as the case identification of the sub-case.
Optionally, the invoking module further includes:
and the first correcting module is used for correcting the target program case in the program to be constructed when the test result does not meet the preset requirement.
In a third aspect, the present application provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above-described method.
The application provides a method for constructing a program, which comprises the steps of firstly obtaining a test parameter set and construction scene information of a program to be constructed; then determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; calling the target program use case in the program to be constructed; in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result; and finally, if the test result meets the preset requirement, finishing the construction of the program to be constructed.
Determining a target program use case in a plurality of candidate program use cases based on a scene second keyword in a constructed scene and a first scene keyword corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; and in the process of calling the target program case by the program to be constructed, the test parameters in the test parameter set are input into the sub-case of the target program case to obtain a test result, and the work efficiency of test workers is improved by improving the reuse rate of the test script.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 shows a flowchart of a method for building a program according to an embodiment of the present application.
Fig. 2 shows a schematic structural diagram of an apparatus for building a program according to an embodiment of the present application.
Fig. 3 shows a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, automatic test workers usually use different cases to complete the test of various functions in the process of compiling automatic scripts, because of different test scenes, the operation steps may have a plurality of same parts, the repeated operation steps are packaged into keywords in the conventional mode at present, and the keywords are quoted in the cases, although the test scripts of part repeated operation steps can be reduced for the workers, the whole cases are repeated in the test scenes, and the whole cases can not be reused based on the conventional mode of packaging the repeated operation steps into the keywords, so that the problem of poor reusability of the test scripts exists, and the work efficiency of the test workers is further influenced.
Based on this, the embodiment of the present application provides a method for constructing a program, as shown in fig. 1, including the following steps:
step S101, acquiring a test parameter set and construction scene information of a program to be constructed;
step S102, determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case;
step S103, calling the target program use case in the program to be constructed;
step S104, in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result;
and S105, if the test result meets the preset requirement, finishing the construction of the program to be constructed.
In the step S101, the program to be constructed is a framework encapsulating a control logic automation script of a process flow in a certain field; the test parameter set comprises test parameters of a plurality of test cases and is used for testing different to-be-tested cases; the construction scenario information includes at least one second scenario keyword, where the second scenario keyword is used to characterize functions of use cases that are lacking in the program to be constructed, for example, the use cases that are lacking in the program to be constructed and are used for placing orders are lacking in the program to be constructed, and the second scenario keyword includes "placing orders".
In step S102, the candidate program use case is a code that is integrated with at least one sub-use case, can perform program reuse, and can implement a specific function, where the sub-use case is a code corresponding to a sub-function constituting the specific function. For example, the first scenario keyword is used to characterize the function of each candidate program use case, for example, if the function corresponding to the candidate program use case is used for searching, the first scenario keyword corresponding to the candidate program use case is "search".
Specifically, according to at least one second scene keyword included in the constructed scene information and a first scene keyword corresponding to each candidate program use case, a first scene keyword similar to or identical to each second scene keyword is found, and the candidate program use case corresponding to the first scene keyword similar to or identical to each second scene keyword is determined as a target program use case in the multiple candidate program use cases.
Each second scene keyword corresponds to one target program use case, the scheme provides a detailed step for determining each target program use case, and in the execution step S102, the target program use case is determined in a plurality of candidate program use cases according to the constructed scene information and the first scene keyword corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; the method comprises the following steps:
and 1021, aiming at each second scene keyword, screening out a target program case matched with the second scene keyword from the multiple candidate program cases according to the first scene keyword corresponding to each candidate program case.
Specifically, for each second scene keyword, when a target use case corresponding to the second scene keyword is found, according to the first scene keyword corresponding to each candidate program use case, the first scene keyword having the highest similarity or completely the same similarity as the second scene keyword is found in the first scene keywords, and then the found candidate program use case corresponding to the first scene keyword is determined as the target program use case.
For example: when the second scene keyword is "search", according to the first scene keyword corresponding to each candidate program use case, for example, the first scene keyword corresponding to the candidate program use case a is "order placement", the first scene keyword corresponding to the candidate program use case B is "search", and the first scene keyword corresponding to the candidate program use case C is "retrieve" … …, where the first scene keyword identical to the second scene keyword "search" is the first scene keyword "search", and then the found candidate program use case B corresponding to the first scene keyword "search" is determined as the target program use case.
Building a program to be built, namely supplementing the content of a program frame of the program to be built, adding a use case at a proper position in the frame, and calling the target program use case in the program to be built in the step S103; the method comprises the following steps:
step 1031, for each second scene keyword, calling the target program use case matched with the second scene keyword to a program position of the second scene keyword corresponding to the program to be constructed.
Specifically, according to each second scene keyword, the target program use case corresponding to the first scene keyword which is the same as each second scene keyword is called to the program position of the second scene keyword corresponding to the program to be constructed by connecting the target program use case corresponding to the first scene keyword with the interface of the program to be constructed.
For example: calling a target program use case with the first scene keyword being the order according to the order-placing second scene keyword and the position of the order-placing second scene keyword in the program to be constructed, wherein the first scene keyword is the order-placing target program use case, to the corresponding position 1 of the order-placing second scene keyword in the program to be constructed; and calling the target program case with the first scene keyword being the 'receiving' to the corresponding position 2 in the program to be constructed where the 'receiving' second scene keyword is located according to the 'receiving' second scene keyword and the position in the program to be constructed where the 'receiving' second scene keyword is located.
After adding a target program case to a program frame of a program to be constructed, the program construction is not finished, a target program case calling error may be caused by misoperation of a user in the program construction process, or an original program code is modified by the misoperation of the user, so that problems exist in the constructed program, in order to reduce the influence of the problems on subsequent work, the constructed program needs to be checked, namely, test parameters prepared in advance are input to the constructed program to test the constructed program, and in the execution step S104, a test parameter set comprises parameter identification and parameter data; each sub-case in the target program use case carries a use case identifier; in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result, and the method comprises the following steps:
step 1041, determining, for each sub-case in the target program use case, a test parameter corresponding to the sub-case according to a parameter identifier of each test parameter in the test parameter set in the process of calling the target program use case in the program to be built, and inputting parameter data of the test parameter to the sub-case; and the parameter identification of the test parameter corresponding to the sub-case is the same as the case identification of the sub-case.
In the above step 1041, the use case identifier is used to distinguish the sub-use cases in the target program use case, and the use case identifier may be represented by letters, numbers, or special symbols. The parameter identifier is used for distinguishing each test parameter in the test parameter set, and the parameter identifier can be represented by letters, numbers and special symbols.
Specifically, for each sub-case, according to the same identifier, a test parameter corresponding to the sub-case is found in the test parameter set, and the test parameter is input to the corresponding sub-case.
For example, when the sub-case identifiers of the target program case are respectively 'article' and 'quantity', two parameter identifiers are respectively 'article' parameter identifier and 'quantity' parameter identifier in the test parameter set, and the parameter data corresponding to the 'article' parameter identifier in the test set, such as article a, is input into the sub-case with the same sub-case identifier of 'article', so as to obtain a test result; similarly, the parameter data corresponding to the "number" parameter identifier in the test set, for example, the number 10, is input into the sub-case with the same "number" as the sub-case identifier, so as to obtain the test result.
In the step S105, the preset requirement is preset by a test worker to determine whether the test result meets the requirement, where each sub-case in each target program case meets the preset requirement of the sub-case, and the preset requirement is used to determine whether each sub-case with the input test parameter meets the preset requirement of the sub-case.
Specifically, if all the preset results meet the preset requirements, the program to be constructed is constructed.
Based on the above situation, in the step S105, the calling method further includes the following steps:
and when the test result does not meet the preset requirement, correcting the target program use case in the program to be constructed.
When the target program use case is modified, the following two cases are specifically included:
in the first case: specifically, as for each second scene keyword, according to each second scene keyword and the first scene keyword corresponding to each candidate program use case, a target program use case matched with each second scene keyword is screened out from a plurality of candidate program use cases, when the target program use case matched with each second scene keyword is screened, the first scene keyword corresponding to the target program use case and the first scene keyword may only accord with the preset similarity and are not necessarily identical, so that in the sub-case of inputting the test parameter to the target program use case corresponding to the first scene keyword, a test result has an error, and based on such a situation, according to the scene keyword and the first scene keyword corresponding to each candidate program use case, for the second scene keyword again, and re-screening the target program case matched with the second scene keyword from the plurality of candidate program cases, and inputting the test parameter data again to obtain a test result until the test result meets the preset requirement.
In the second case: and when the test result does not meet the preset requirement, the test worker directly modifies the sub-cases in the target program cases in the program to be constructed according to the test result until the test result meets the preset requirement.
The application provides a method for constructing a program, which comprises the steps of firstly obtaining a test parameter set and construction scene information of a program to be constructed; then determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; calling the target program use case in the program to be constructed; in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result; and finally, if the test result meets the preset requirement, finishing the construction of the program to be constructed.
Determining a target program use case in a plurality of candidate program use cases based on a scene second keyword in a constructed scene and a first scene keyword corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; and in the process of calling the target program case by the program to be constructed, the test parameters in the test parameter set are input into the sub-case of the target program case to obtain a test result, and the work efficiency of test workers is improved by improving the reuse rate of the test script.
Fig. 2 is a schematic structural diagram of an apparatus for building a program according to an embodiment of the present application, where the apparatus includes: an obtaining module 201, a determining module 202, a calling module 203, a result generating module 204, and a constructing module 205, specifically:
an obtaining module 201, configured to obtain a test parameter set of a program to be constructed and construction scenario information;
a determining module 202, configured to determine, according to the constructed scene information and a scene first keyword corresponding to each candidate program use case, a target program use case among multiple candidate program use cases; each candidate program use case comprises at least one sub-use case;
the calling module 203 is used for calling the target program use case in the program to be constructed;
a result generating module 204, configured to input the test parameters in the test parameter set to the sub-cases of the target program case to obtain a test result in the process of calling the target program case in the program to be built;
the building module 205 is configured to complete building of the program to be built if the test result meets a preset requirement.
Optionally, the constructed scene information includes at least one second scene keyword, and the determining module includes:
and the first screening module is used for screening out target program use cases matched with the second scene key words from the plurality of candidate program use cases according to the constructed scene information and the first scene key words corresponding to the candidate program use cases aiming at the second scene key words.
Optionally, the invoking module includes:
and the first calling unit is used for calling the target program case matched with the second scene keyword to a program position of the second scene keyword corresponding to the program to be constructed aiming at each second scene keyword.
Optionally, the test parameter set includes a parameter identifier and parameter data; each sub-case in the target program use case carries a use case identifier; the result generation module comprises:
the first input unit is used for determining a test parameter corresponding to each sub-case in the target program use case according to the parameter identification of each test parameter in the test parameter set in the process of calling the target program use case in the program to be constructed and inputting the parameter data of the test parameter to the sub-case; and the parameter identification of the test parameter corresponding to the sub-case is the same as the case identification of the sub-case.
Optionally, the invoking module further includes:
and the first correcting module is used for correcting the target program case in the program to be constructed when the test result does not meet the preset requirement.
Corresponding to the method for calling a use case of a calling program in fig. 1, an embodiment of the present application further provides a computer device 300, as shown in fig. 3, the device includes a memory 301, a processor 302, and a computer program stored in the memory 301 and executable on the processor 302, wherein the processor 302 implements the steps of the method for constructing a program when executing the computer program.
Corresponding to the building program building method in fig. 1, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program executes the steps of the method for calling the use case. Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, and the like, and when a computer program on the storage medium is executed, the method for calling the calling program case can be executed, so that the problem of poor reusability of the test script in the prior art is solved: firstly, acquiring a test parameter set of a program to be constructed and construction scene information; then determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case; calling the target program use case in the program to be constructed; in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result; and finally, if the test result meets the preset requirement, finishing the construction of the program to be constructed. The work efficiency of test workers is improved by improving the reuse rate of the test scripts.
The apparatus for constructing the program provided by the embodiment of the present application may be specific hardware on the device, or software or firmware installed on the device, etc. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or 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 of devices or units through some communication interfaces, 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 provided in 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 functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of building a program, comprising:
acquiring a test parameter set of a program to be constructed and construction scene information;
determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the first scene key word corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case;
calling the target program use case in the program to be constructed;
in the process of calling the target program case in the program to be constructed, inputting the test parameters in the test parameter set into the sub-cases of the target program case to obtain a test result;
and if the test result meets the preset requirement, completing the construction of the program to be constructed.
2. The method according to claim 1, wherein the construction scenario information includes at least one second scenario keyword, and the determining a target program use case among a plurality of candidate program use cases according to the construction scenario information and the scenario keyword corresponding to each candidate program use case includes:
and aiming at each second scene keyword, screening out a target program use case matched with the second scene keyword from a plurality of candidate program use cases according to the first scene keyword corresponding to each candidate program use case.
3. The method according to claim 2, wherein the calling the target program use case in the program to be built includes:
and for each second scene keyword, calling the target program use case matched with the second scene keyword to a program position of the second scene keyword corresponding to the program to be constructed.
4. The method of claim 1, wherein the test parameter set comprises parameter identification and parameter data; each sub-case in the target program use case carries a use case identifier; in the process of calling the target program case in the program to be built, the test parameters are input into the sub-cases of the target program case to obtain a test result, and the method comprises the following steps:
for each sub-case in the target program use case, determining a test parameter corresponding to the sub-case according to the parameter identifier of each test parameter in the test parameter set in the process of calling the target program use case in the program to be constructed, and inputting the parameter data of the test parameter to the sub-case; and the parameter identification of the test parameter corresponding to the sub-case is the same as the case identification of the sub-case.
5. The method of claim 1, further comprising:
and when the test result does not meet the preset requirement, correcting the target program use case in the program to be constructed.
6. An apparatus for building a program, comprising:
the acquisition module is used for acquiring a test parameter set of a program to be constructed and construction scene information;
the determining module is used for determining a target program use case in a plurality of candidate program use cases according to the constructed scene information and the scene first keyword corresponding to each candidate program use case; each candidate program use case comprises at least one sub-use case;
the calling module is used for calling the target program use case in the program to be constructed;
the result generation module is used for inputting the test parameters in the test parameter set to the sub-cases of the target program case to obtain a test result in the process of calling the target program case in the program to be constructed;
and the building module is used for finishing building the program to be built if the test result meets the preset requirement.
7. The apparatus of claim 6, wherein the constructed scene information comprises at least one second scene keyword, and wherein the determining module comprises:
and the matching unit is used for screening out target program use cases matched with the second scene keywords from the plurality of candidate program use cases according to the constructed scene information and the first scene keywords corresponding to each candidate program use case aiming at each second scene keyword.
8. The apparatus of claim 6, wherein the invoking module comprises:
and the first calling unit is used for calling the target program case matched with the second scene keyword to a program position of the second scene keyword corresponding to the program to be constructed aiming at each second scene keyword.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of the preceding claims 1-5 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on 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 the claims 1-5.
CN202111403322.7A 2021-11-24 2021-11-24 Method, device, computer equipment and medium for constructing program Pending CN114048144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111403322.7A CN114048144A (en) 2021-11-24 2021-11-24 Method, device, computer equipment and medium for constructing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111403322.7A CN114048144A (en) 2021-11-24 2021-11-24 Method, device, computer equipment and medium for constructing program

Publications (1)

Publication Number Publication Date
CN114048144A true CN114048144A (en) 2022-02-15

Family

ID=80210662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111403322.7A Pending CN114048144A (en) 2021-11-24 2021-11-24 Method, device, computer equipment and medium for constructing program

Country Status (1)

Country Link
CN (1) CN114048144A (en)

Similar Documents

Publication Publication Date Title
CN108614770B (en) Automatic test assertion method, device, storage medium and equipment
JP2019500680A (en) Data processing method and apparatus
CN110134576B (en) Batch log query method, terminal and computer readable storage medium
CN111615688A (en) Assertion verification code binding method and device
CN111679852A (en) Detection method and device for conflict dependency library
CN111124480A (en) Application package generation method and device, electronic equipment and storage medium
CN111258985A (en) Data cluster migration method and device
CN114661423A (en) Cluster configuration detection method and device, computer equipment and storage medium
CN113468212A (en) Event execution method and device and electronic equipment
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN111159028B (en) Webpage testing method and device
CN114048144A (en) Method, device, computer equipment and medium for constructing program
CN115757172A (en) Test execution method and device, storage medium and computer equipment
CN115469833A (en) Method and device for implementing dynamic rule engine, electronic equipment and storage medium
CN110221952B (en) Service data processing method and device and service data processing system
CN109359042B (en) Automatic testing method based on path search algorithm
CN114020640A (en) Automatic testing method and device
CN114063982A (en) Method for automatically constructing functional components based on multi-scenario application
CN111309598A (en) Test case execution environment recovery method, system, terminal and storage medium
CN110008073B (en) Hardware platform differential shielding method, device, equipment and readable storage medium
CN115826928B (en) Program generating method, system, electronic device and computer readable storage medium
CN111158746B (en) Method and device for acquiring call relationship
KR102030544B1 (en) Program analyzing apparatus capable of generating function call information on features supported by a program and operating method thereof
CN108446122B (en) Parameter consistency verification method and device
CN114185555A (en) Server deployment method and device and electronic equipment

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