CN116737582A - Test data determining method and device, computer equipment and storage medium - Google Patents

Test data determining method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN116737582A
CN116737582A CN202310747488.3A CN202310747488A CN116737582A CN 116737582 A CN116737582 A CN 116737582A CN 202310747488 A CN202310747488 A CN 202310747488A CN 116737582 A CN116737582 A CN 116737582A
Authority
CN
China
Prior art keywords
parameter
test data
identifier
target
preset
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
CN202310747488.3A
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.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp 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 China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202310747488.3A priority Critical patent/CN116737582A/en
Publication of CN116737582A publication Critical patent/CN116737582A/en
Pending legal-status Critical Current

Links

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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure relates to the field of testing technologies, and in particular, to a method and apparatus for determining test data, a computer device, and a storage medium. The test data determining method comprises the steps of extracting parameter identifiers aiming at a received test case to be executed to obtain the parameter identifiers; under the condition that the parameter identification indicates the associated parameter, determining first target test data corresponding to the parameter identification from a preset parameter database; determining a function identifier and variable data from the parameter identifier under the condition that the parameter identifier indicates a parameter function; and processing the variable data by using the function corresponding to the function identifier to obtain second target test data. By utilizing the embodiment of the specification, the static test data and the dynamic test data are automatically determined, and the degree of automation in the process of determining the test data is improved, so that the degree of automation in the test process is improved.

Description

Test data determining method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of testing technologies, and in particular, to a method and apparatus for determining test data, a computer device, and a storage medium.
Background
At present, when a software test is performed by using a test case, the test case needs to include test data, so that in the process of performing the software test, a tester firstly determines the test data, and then builds the test case for the test based on the determined test data. Therefore, the automation degree is lower in the process of determining the test data, each constructed test case can be used once, and resource waste exists.
How to improve the automation degree of the test process and reduce the resource waste is a problem to be solved in the prior art.
Disclosure of Invention
In order to solve the problems in the prior art, the embodiment of the specification provides a test data determining method, a device, computer equipment and a storage medium, and when a test case to be executed is received, corresponding test data is determined based on parameter identifiers included in the test case, so that automatic determination of static test data and dynamic test data is realized, the degree of automation in the process of determining the test data is improved, and the degree of automation in the test process is improved.
In order to solve the technical problems, the specific technical scheme in the specification is as follows:
In one aspect, embodiments of the present disclosure provide a test data determination method, including,
extracting parameter identifiers aiming at the received test cases to be executed to obtain the parameter identifiers;
under the condition that the parameter identification indicates the associated parameter, determining first target test data corresponding to the parameter identification from a preset parameter database;
determining a function identifier and variable data from the parameter identifier under the condition that the parameter identifier indicates a parameter function; and
and processing the variable data by using a function corresponding to the function identifier to obtain second target test data.
Further, the extracting the parameter identifier for the received test case to be executed, and obtaining the parameter identifier further includes:
extracting parameter identifiers aiming at the received test cases to be executed to obtain pre-parameter identifiers;
judging whether a pre-target parameter value associated with the pre-parameter identification exists or not, wherein the test case to be tested comprises the pre-target parameter value; and
and in the case that the pre-target parameter value is determined to be not present, determining the pre-parameter identification as the parameter identification.
Further, the method also comprises the steps of,
Judging whether the pre-parameter identification exists in the preset parameter database or not under the condition that the pre-target parameter value exists; and
and under the condition that the preset parameter identification exists, replacing the preset parameter value associated with the preset parameter identification in the preset parameter database by the preset target parameter value to obtain a first updated preset parameter database.
Further, the method further comprises the following steps:
adding the pre-parameter identification in the preset parameter database under the condition that the pre-parameter identification is determined to be not present; and
and storing the pre-target parameter value and the pre-parameter identification in an associated mode to obtain a second updated preset parameter database.
Further, in the case that the parameter identification indicates the associated parameter, determining the first target test data corresponding to the parameter identification from the preset parameter database further comprises,
judging whether the parameter identifier indicates a fixed association parameter; and
and under the condition that the fixed association parameter is determined to be indicated, the first target test data is indexed from the preset parameter database based on the parameter identification.
Further, the method also comprises the steps of,
Under the condition that the fixed association parameter is not indicated, determining a dynamic function identifier and dynamic variable data corresponding to the parameter identifier; and
and processing the dynamic variable data by using a function corresponding to the dynamic function identifier to obtain the first target test data.
Further, after determining the first target test data or/and the second target test data, further comprising,
updating preset data associated with the corresponding parameter identifier in the test case to be executed by using the first target test data or/and the second target test data to obtain an executable test case; and
and executing the executable test case to obtain a test result.
On the other hand, the embodiment of the specification also provides a test data determining device, which comprises,
the extracting unit is used for extracting the parameter identification aiming at the received test case to be executed to obtain the parameter identification;
the first determining unit is used for determining first target test data corresponding to the parameter identifier from a preset parameter database under the condition that the parameter identifier indicates the associated parameter;
a second determining unit configured to determine a function identifier and variable data from the parameter identifiers in a case where it is determined that the parameter identifiers indicate parameter functions; and
And the processing unit is used for processing the variable data by utilizing the function corresponding to the function identifier to obtain second target test data.
Further, the method also comprises the steps of,
the updating unit is used for updating preset data associated with the corresponding parameter identifier by utilizing the first target test data or/and the second target test data to obtain an executable test case; and
and the execution unit is used for executing the executable test case to obtain a test result.
In another aspect, embodiments of the present disclosure further provide a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method described above when executing the computer program.
In another aspect, embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, perform the above-described method.
In another aspect, embodiments of the present disclosure also provide a computer program product comprising a computer program/instruction which, when executed by a processor, implements the method described above.
By using the embodiment of the specification, when the test case to be executed is received, extracting the parameter identification aiming at the test case to be executed to obtain the parameter identification. Determining information indicated by the parameter identification, and determining first target test data corresponding to the parameter identification from a preset parameter database under the condition that the indicated information is determined to be an associated parameter; and under the condition of determining the indication parameter function, determining a function identifier and variable data from the parameter identifier, and further processing the variable data by using a function corresponding to the function identifier to obtain a second target test function. Therefore, static test data are determined, and dynamic test data are configured in real time. Therefore, the degree of automation in the process of determining the test data is improved, and the degree of automation in the test process is improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation system of a test data determining method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a test data determination method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a test method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of a method for determining parameter identifiers according to an embodiment of the present disclosure;
FIG. 5A is a flow chart of a testing method according to another embodiment of the present disclosure;
FIG. 5B is a flowchart of a method for determining first target test data according to an embodiment of the present disclosure;
FIG. 5C is a schematic diagram of one parameter according to an embodiment of the present disclosure;
fig. 6A is a schematic structural diagram of a test data determining apparatus according to an embodiment of the present disclosure;
fig. 6B is a schematic structural diagram of a test data determining apparatus according to another embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
[ reference numerals description ]
101. A user terminal;
102. a server;
610. an extraction unit;
620. a first determination unit;
630. a second determination unit;
640. a processing unit;
650. an updating unit;
660. an execution unit;
702. a computer device;
704. A processing device;
706. storing the resource;
708. a driving mechanism;
710. an input/output module;
712. an input device;
714. an output device;
716. a presentation device;
718. a graphical user interface;
720. a network interface;
722. a communication link;
724. a communication bus.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and the claims of the specification and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the present description described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Fig. 1 is a schematic diagram of an implementation system of a test data determining method according to an embodiment of the present disclosure, which may include: the user terminal 101 and the server 102 communicate with each other through a network, which may include a local area network (Local Area Network, abbreviated as LAN), a wide area network (Wide Area Network, abbreviated as WAN), the internet, or a combination thereof, and are connected to a website, user equipment (e.g., a computing device), and a backend system. A user can send a test case to be executed to the server 102 through the user terminal 101, and the server 102 extracts parameter identification aiming at the received test case to be executed to obtain the parameter identification; under the condition that the parameter identification indicates the associated parameter, determining first target test data corresponding to the parameter identification from a preset parameter database; determining a function identifier and variable data from the parameter identifier under the condition that the parameter identifier indicates a parameter function; and processing the variable data by using the function corresponding to the function identifier to obtain second target test data. Further, the server 102 may update preset data associated with the corresponding parameter identifier in the test case to be executed by using the first target test data or/and the second target test data to obtain an executable test case; and executing the executable test case to obtain a test result, and transmitting the test result to the user terminal 101. Alternatively, the servers 102 may be nodes of a cloud computing system (not shown), or each server 102 may be a separate cloud computing system, including multiple computers interconnected by a network and operating as a distributed processing system.
In an alternative embodiment, the user terminal 101 may include electronic devices not limited to smart phones, acquisition devices, desktop computers, tablet computers, notebook computers, smart speakers, digital assistants, augmented Reality (AR, augmented Reality)/Virtual Reality (VR) devices, smart wearable devices, and the like. Alternatively, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
In addition, it should be noted that, fig. 1 is only one application environment provided in the present specification, and in practical application, a plurality of user terminals 101 may also be included, which is not limited in the present specification.
Fig. 2 is a flowchart of a test data determining method according to an embodiment of the present disclosure. The determination of test data is described in this figure, but may include more or fewer operational steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When a system or apparatus product in practice is executed, it may be executed sequentially or in parallel according to the method shown in the embodiments or the drawings. As shown in fig. 2, the method may include:
S210, extracting parameter identifiers aiming at the received test cases to be executed to obtain the parameter identifiers;
s220, under the condition that the parameter identification indicates the associated parameter, determining first target test data corresponding to the parameter identification from a preset parameter database;
s230, determining function identification and variable data from the parameter identification under the condition that the parameter identification indicates a parameter function;
s240, processing the variable data by using the function corresponding to the function identifier to obtain second target test data.
By using the embodiment of the specification, when the test case to be executed is received, extracting the parameter identification aiming at the test case to be executed to obtain the parameter identification. Determining information indicated by the parameter identification, and determining first target test data corresponding to the parameter identification from a preset parameter database under the condition that the indicated information is determined to be an associated parameter; and under the condition of determining the indication parameter function, determining a function identifier and variable data from the parameter identifier, and further processing the variable data by using a function corresponding to the function identifier to obtain a second target test function. Therefore, static test data are determined, and dynamic test data are configured in real time. Therefore, the degree of automation in the process of determining the test data is improved, and the degree of automation in the test process is improved.
According to one embodiment of the present specification, a test case is a description of a test task performed on a specific software product, and specifically includes a test scheme, a method, a technology, a policy, and the like. The content of the test cases comprises a test target, a test environment, test data, test steps, expected results, test scripts and the like. Briefly, a test case is a set of parameter identifications, execution conditions, and expected results tailored for a particular goal to verify whether a particular software requirement is met. The parameter identification is a unique identification of the test data corresponding to the index. For example, when the test case to be executed includes the parameter identifier a, the corresponding S is determined based on the parameter identifier a.
The parameter identification includes parameter category information and an index identification. The parameter class information indicates a class of the parameter, such as a parameter identification corresponding to the associated parameter or a parameter identification corresponding to the parameter function. It should be noted that the parameter class information may be, for example, an identifier or identification text or any information that can identify the corresponding class. The parameter category information is used for distinguishing whether the parameter identifier is a parameter identifier corresponding to the associated parameter or a parameter identifier corresponding to the parameter function. For example, the parameter class information includes R and F, R indicating the associated parameter, and F indicating the parameter function. Further, the parameter class information may be included in an index identity, for example, where the first bit in the index identity is a symbol, the parameter identity indicates a parameter function, and where the index identity is not a symbol, the parameter identity indicates an associated parameter.
After the parameter identification is determined, information indicated by the parameter identification is determined based on the parameter category information included by the parameter identification. And under the condition that the parameter identification indicates the associated parameter, indexing corresponding first target test data based on the index identification included by the parameter identification.
A preset parameter database is pre-configured, and the preset parameter database comprises a plurality of configuration parameter identifiers and preset parameter values associated with each configuration parameter identifier. For example, the preset parameter database includes configuration parameter identifiers a, b and c, the preset parameter value associated with a is s, the preset parameter value associated with b is t, and the preset parameter value associated with c is u.
After the index identifier is determined, the index identifier is matched with each configuration parameter identifier included in the preset parameter database in a consistent manner, and a target configuration parameter identifier consistent with the index identifier is determined from the preset parameter database. And performing preset parameter values associated with the target configuration parameter identification as the first target test data.
In the case where it is determined that the parameter identification indicates a parameter function, a function identification and variable data are determined from the parameter identification. Specifically, the parameter identification indicating the parameter function further includes a function identification and variable data. The function identifier is a unique identifier of the function to which the index corresponds. The variable data is an argument of a function for generating test data in real time. For example, the parameter identification includes F1 and 1523, which 1523 is variable data of a function corresponding to F1 being input. It should be noted that the variable data may be a series of numbers or may be text information, which is not limited in this specification.
The method comprises the steps of pre-configuring a function library, wherein the function library comprises a plurality of configuration function identifications and configuration functions corresponding to each configuration function identification. After the function identification and the variable data are determined, the function identification is matched with each configuration function identification in the function library in a consistent mode, the function consistent with the function identification is determined, the variable data are input into the function corresponding to the function identification, and second target test data are obtained. For example, when the parameter identifier includes F1 and 1523, a function corresponding to the identifier F1 is determined, and the function is input to the 1523, so that corresponding second target test data can be obtained.
FIG. 3 is a flow chart of a test method according to an embodiment of the present disclosure. The process of one test method is depicted in this figure, but may include more or fewer operational steps based on conventional or non-inventive labor. As shown in fig. 3, the method may include:
s350, updating preset data associated with the corresponding parameter identifier in the test case to be executed by using the first target test data or/and the second target test data to obtain an executable test case;
s360, executing the executable test case to obtain a test result.
According to the embodiment of the specification, after the first target test data or/and the second target test data are automatically determined, the test cases to be executed are updated by using the determined first target test data or/and second target test data, so that the executable test cases (namely, the test cases which comprise the test data and can be executed in a floor mode) are obtained. And further executing the executable test case to obtain a corresponding test result, and completing the test process. Therefore, the static test data and the dynamic test data are automatically determined aiming at the test cases to be executed including the parameter identification, and an automatic test process is completed based on the static test data and the dynamic test data, so that the automation degree of the test process is further improved.
According to another embodiment of the present description, the preset data may be, for example, data after the parameter identification. It should be noted that the preset data may be, for example, null, i.e. no data is present after the parameter identification. The preset data may also be P, the P identification indicating that the location stores determined test data. The present specification does not limit the expression form of the preset data.
In addition, it should be noted that, when the first target test data or/and the second target test data are used to update the test case to be executed, only the first target test data or/and the second target test data may be used to replace the corresponding preset data, and the first target test data or/and the second target test data may also be used to replace the corresponding parameter identifier and the preset data corresponding to the parameter identifier. For example, the test case to be executed includes test data 1=id1p, and the first target test data corresponding to ID1 is n. The updated test case may be test data 1=iid1n or test data 1=n.
And updating the test case to be executed by using the first target test data or/and the second target test data determined based on the steps S210-S240 in FIG. 2, thereby obtaining the executable test case. The executable test case is a string of executable programs. And then executing the executable test case to obtain an execution result of the executable test case, and taking the execution result as a test result. After determining the test result, the test result may be sent to the user terminal for review by a tester, or the test result may be processed to determine index data that may characterize the performance index of the software under test, and the index data may be sent to the user terminal.
Fig. 4 is a flowchart of a parameter identification determining method according to an embodiment of the present disclosure. The determination method procedure for parameter identification is described in this figure, but may include more or fewer operational steps based on conventional or non-inventive labor. As shown in fig. 4, the method may include:
s411, extracting parameter identifiers aiming at the received test cases to be executed to obtain pre-parameter identifiers;
s412, judging whether a pre-target parameter value associated with the pre-parameter identification exists;
S413, determining the pre-parameter identification as the parameter identification under the condition that the pre-target parameter value is determined to be absent;
s414, judging whether a pre-parameter identification exists in a pre-parameter database under the condition that the pre-target parameter value exists;
s415, under the condition that the existence of the preset parameter identification is determined, replacing preset parameter values associated with the preset parameter identification in the preset parameter database by using preset target parameter values to obtain a first updated preset parameter database;
s416, adding the pre-parameter identification in a preset parameter database under the condition that the pre-parameter identification is determined to be not exist;
s417, storing the pre-target parameter value and the pre-parameter identification in a correlated manner to obtain a second updated pre-set parameter database.
By using the embodiment of the specification, in the process of testing, a plurality of test cases to be executed are included, and the plurality of test cases to be executed are executed sequentially. At present, when the test result data of the previous test case to be executed is needed when the next test case to be executed is executed, a tester is needed to manually determine the corresponding test result data when the previous test case to be executed is finished, and then manually determine the test data filled in the next test case to be executed. Thus, the tester needs to pay attention to the test process at any time, and resources are wasted. In addition, after the previous test case to be executed is executed, a tester is required to analyze and write the next test case to be executed, and the test case to be executed can be executed after the writing of the next test case to be executed is completed, so that the test process takes a long time. In the embodiment of the specification, the test data which is needed by the test case to be executed and is determined based on the test case to be executed after the previous test case to be executed is directly updated into the test case to be executed, so that the new test data is directly tested in the execution process of the test case to be executed, and the updated test data can be adopted when the test case to be executed, thereby further improving the automation degree of test data determination and reducing the time spent in the test process.
According to another embodiment of the present disclosure, when a test case to be executed is received, the test case to be executed is performed to perform parameter identification extraction, and a pre-parameter identification included in the test case to be executed is determined. It should be noted that, for example, when testing includes three test cases to be executed, in the first test case to be executed, the test data corresponding to the parameter identifier 1 is a (the a is the preset test data associated with the parameter identifier 1 in the preset parameter database). In the second and third test cases to be executed, the test data corresponding to the parameter identifier 1 needs to be determined based on the test result of the first test case to be executed. And after the execution of the first test case to be executed is finished, the second test case to be executed acquires the test result of the first test case to be executed, determines a pre-target parameter value corresponding to the parameter identifier 1 based on the test result, and associates the pre-target parameter value with the parameter identifier 1. Thus, the second test case to be executed has the test case and the pretarget parameter value.
After the pre-parameter identification is determined, it is determined whether there is a pre-target parameter value associated with the pre-parameter identification. And in the case that the pre-target parameter value is determined to be not present, the pre-target parameter is indicated to adopt the first target parameter data determined in the pre-set parameter database. And under the condition that the pre-target parameters exist, the fact that the pre-target parameters need to be used for updating a pre-set parameter database is indicated, namely, the test data corresponding to the pre-parameter identification, which are used from the test case to be executed, are the pre-target parameters.
And when the pre-target parameter value is determined to be absent, determining the pre-parameter identifier as a parameter identifier so as to determine corresponding first target test data from a preset parameter database.
And when the target parameter value is determined to exist, judging whether the preset parameter identification exists in the preset parameter database. Specifically, the preset parameter identification is matched with each configuration parameter identification in the preset parameter database in a consistent manner, the preset parameter identification is determined to exist in the preset parameter database under the condition that the corresponding configuration parameter identification is determined to be consistent with the preset parameter identification, otherwise, the preset parameter identification is determined to not exist in the preset parameter database.
Under the condition that the preset parameter identification exists in the preset parameter database, replacing the preset parameter value associated with the preset parameter identification in the preset parameter database with the preset target parameter value, so that the preset parameter database is updated, and a first updated preset parameter database is obtained. When the corresponding first target test data is acquired by the subsequent to-be-executed use case, the acquired preset target parameter value is not the preset parameter value. And in the process of determining the corresponding test data of the test case to be executed, the pre-target parameter value is directly used as the first target test data to be used for updating the test case to be executed.
Under the condition that the preset parameter database is determined to not have the preset parameter identifier, the preset parameter identifier is added into the preset parameter database, and the preset target parameter value and the preset parameter identifier are stored in a correlated mode, so that the preset parameter database is updated, and a second updated preset parameter database is obtained. When the first target test data corresponding to the subsequent to-be-executed case is obtained, the first target test case corresponding to the pre-parameter identification can be obtained. And in the process of determining the corresponding test data of the test case to be executed, the pre-target parameter value is directly used as the first target test data to be used for updating the test case to be executed.
FIG. 5A is a flow chart of a testing method according to another embodiment of the present disclosure; FIG. 5B is a flowchart of a method for determining first target test data according to an embodiment of the present disclosure; fig. 5C is a schematic diagram of one parameter according to an embodiment of the present disclosure.
As shown in FIG. 5A, in determining test data, three modules are involved in total, specifically, a test case set, a parameter dictionary and a dynamic construction module. The test case set comprises a plurality of test cases to be executed. Each test case to be executed comprises a parameter identifier. In the case that the parameter identifier has a corresponding pre-target parameter value, a process of assigning a value to the parameter dictionary needs to be executed, and if not, only the process of assigning a value needs to be executed. I.e. a process of determining the first target test data. The specific assignment process is shown in the update process of the preset parameter database in fig. 4. The parameter dictionary in fig. 5A is the same as the preset parameter database in the embodiment of the present disclosure, and includes configuration parameter identifiers and preset parameter values. And the configuration parameter identification and the preset parameter value are respectively stored in the corresponding dictionary. After the first target test data is determined, the process of updating the corresponding test case by using the first target test data is the value process shown in fig. 5A.
The dynamic construction module includes a plurality of construction functions, each of which is associated with a respective function identifier, to enable a corresponding function to be determined based on a parameter identifier determined from the parameter representation when the parameter identifier indicates the parameter function. And processing the variable data determined by the parameter identification based on the function to obtain corresponding second target test data. The process of updating the corresponding test case by using the second target test data is the dynamic value process shown in fig. 5A.
After the update of the test case to be executed is completed, the executable test case is obtained. And further, executing the executable test case to obtain a corresponding test result.
Specifically, the determination of the first target test data is depicted in FIG. 5B, but may include more or fewer operational steps based on conventional or non-inventive labor. As shown in fig. 5B, the method may include:
s510, extracting parameter identifiers aiming at the received test cases to be executed to obtain the parameter identifiers;
s521, judging whether the parameter identification indicates a fixed association parameter or not under the condition that the parameter identification indicates the association parameter;
s522, under the condition that the indication fixed association parameter is determined, indexing first target test data from a preset parameter database based on the parameter identification;
S523, determining dynamic function identification and dynamic variable data corresponding to the parameter identification under the condition that the fixed association parameter is not indicated;
and S524, processing the dynamic variable data by using the function corresponding to the dynamic function identifier to obtain first target test data.
According to another embodiment of the present disclosure, parameter identifier extraction is performed on a received test case to be executed, and an execution process for obtaining the parameter identifier may be the same as the execution process of S210.
After the parameter identification is determined, the content information indicated by the parameter identification is determined. In the case that the parameter identification indicates the associated parameter, it is judged whether the parameter identification indicates the fixed associated parameter. Specifically, a preset parameter value associated with the parameter identifier is determined from a preset parameter database, and whether the parameter identifier indicates a fixed associated parameter is determined based on the preset parameter value. Specifically, when the first bit of the preset parameter value is a symbol, the parameter identifier indicates a fixed association parameter, otherwise, the parameter identifier does not indicate the fixed association parameter. When the first bit of the preset parameter value is a sign, the preset parameter value comprises a dynamic function identifier and dynamic variable data.
And under the condition that the parameter identification indicates the fixed association parameter, the first target test data is indexed from a preset parameter database based on the parameter identification, namely corresponding first target test data is determined from a data dictionary, namely the preset parameter value is used as the first target test data.
And if the parameter identification does not indicate the fixed association parameter, namely, the parameter identification indicates the parameter function, determining the dynamic function identification and the dynamic variable data corresponding to the parameter identification. Specifically, dynamic function identification and dynamic variable data are determined from the preset parameter values. It should be noted that the dynamic function identification and dynamic variable data are similar to the characterization of the function identification and variable data, except for the differences in the content of the references. And further processing the dynamic variable data by using the function corresponding to the dynamic function identifier determined by the dynamic construction module to obtain first target test data.
Specifically, the parameter dictionary includes configuration parameter identifiers and corresponding preset parameter values as shown in fig. 5C. Specifically, the parameter name 1 is a configuration parameter identifier, and the parameter value 1 is a preset parameter value. The preset parameter value may be a constant, i.e. be used as the first target test data, and may be other parameter identifiers (parameter keys), so that other parameter identifiers may be called, and may further include a dynamic function identifier, so as to guide the dynamic construction module to determine a corresponding function, and obtain dynamic test data.
Fig. 6A is a schematic structural diagram of a test data determining apparatus according to an embodiment of the present disclosure. As shown in fig. 6A, including,
the extracting unit 610 is configured to extract a parameter identifier for a received test case to be executed, so as to obtain the parameter identifier;
a first determining unit 620, configured to determine, in a case where it is determined that the parameter identifier indicates the associated parameter, first target test data corresponding to the parameter identifier from a preset parameter database;
a second determining unit 630, configured to determine a function identifier and variable data from the parameter identifiers in a case where the parameter identifiers are determined to indicate the parameter functions; and
and the processing unit 640 is configured to process the variable data by using a function corresponding to the function identifier, so as to obtain second target test data.
Since the principle of the device for solving the problem is similar to that of the method, the implementation of the device can be referred to the implementation of the method, and the repetition is omitted.
Fig. 6B is a schematic structural diagram of a test data determining apparatus according to an embodiment of the present disclosure. As shown in fig. 6B, including,
the updating unit 650 is configured to update preset data associated with the corresponding parameter identifier by using the first target test data or/and the second target test data, so as to obtain an executable test case; and
And the execution unit 660 is used for executing the executable test case to obtain a test result.
Since the principle of the device for solving the problem is similar to that of the method, the implementation of the device can be referred to the implementation of the method, and the repetition is omitted.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure, where an apparatus in the present disclosure may be the computer device in the present embodiment, and perform the method of the present disclosure. The computer device 702 may include one or more processing devices 704, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 702 may also include any storage resources 706 for storing any kind of information, such as code, settings, data, etc. For example, and without limitation, storage resources 706 may include any one or more of the following combinations: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any storage resource may store information using any technology. Further, any storage resource may provide volatile or non-volatile retention of information. Further, any storage resources may represent fixed or removable components of computer device 702. In one case, the computer device 702 can perform any of the operations of the associated instructions when the processing device 704 executes the associated instructions stored in any storage resource or combination of storage resources. The computer device 702 also includes one or more drive mechanisms 708, such as a hard disk drive mechanism, an optical disk drive mechanism, and the like, for interacting with any storage resources.
The computer device 702 may also include an input/output module 710 (I/O) for receiving various inputs (via an input device 712) and for providing various outputs (via an output device 714). One particular output mechanism may include a presentation device 716 and an associated Graphical User Interface (GUI) 718. In other embodiments, input/output module 710 (I/O), input device 712, and output device 714 may not be included as just one computer device in a network. The computer device 702 can also include one or more network interfaces 720 for exchanging data with other devices via one or more communication links 722. One or more communication buses 724 couple the above-described components together.
Communication link 722 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the internet), a point-to-point connection, etc., or any combination thereof. Communication link 722 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
The embodiments of the present specification also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the above method.
The present description also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing detailed description of the embodiments has been presented for purposes of illustration and description, and it should be understood that the foregoing is by way of example only, and is not intended to limit the scope of the invention.

Claims (12)

1. A method of determining test data, comprising:
extracting parameter identifiers aiming at the received test cases to be executed to obtain the parameter identifiers;
under the condition that the parameter identification indicates the associated parameter, determining first target test data corresponding to the parameter identification from a preset parameter database;
determining a function identifier and variable data from the parameter identifier under the condition that the parameter identifier indicates a parameter function; and
and processing the variable data by using a function corresponding to the function identifier to obtain second target test data.
2. The method of claim 1, wherein the extracting the parameter identifier for the received test case to be executed, to obtain the parameter identifier includes:
extracting parameter identifiers aiming at the received test cases to be executed to obtain pre-parameter identifiers;
judging whether a pre-target parameter value associated with the pre-parameter identification exists or not, wherein the test case to be tested comprises the pre-target parameter value; and
and in the case that the pre-target parameter value is determined to be not present, determining the pre-parameter identification as the parameter identification.
3. The method as recited in claim 2, further comprising:
judging whether the pre-parameter identification exists in the preset parameter database or not under the condition that the pre-target parameter value exists; and
and under the condition that the preset parameter identification exists, replacing the preset parameter value associated with the preset parameter identification in the preset parameter database by the preset target parameter value to obtain a first updated preset parameter database.
4. A method according to claim 3, further comprising:
adding the pre-parameter identification in the preset parameter database under the condition that the pre-parameter identification is determined to be not present; and
and storing the pre-target parameter value and the pre-parameter identification in an associated mode to obtain a second updated preset parameter database.
5. The method according to claim 1, wherein in the case that the parameter identifier indicates an associated parameter, determining, from a preset parameter database, first target test data corresponding to the parameter identifier includes:
judging whether the parameter identifier indicates a fixed association parameter; and
and under the condition that the fixed association parameter is determined to be indicated, the first target test data is indexed from the preset parameter database based on the parameter identification.
6. The method as recited in claim 5, further comprising:
under the condition that the fixed association parameter is not indicated, determining a dynamic function identifier and dynamic variable data corresponding to the parameter identifier; and
and processing the dynamic variable data by using a function corresponding to the dynamic function identifier to obtain the first target test data.
7. The method of claim 1, further comprising, after said determining the first target test data or/and second target test data:
updating preset data associated with the corresponding parameter identifier in the test case to be executed by using the first target test data or/and the second target test data to obtain an executable test case; and
and executing the executable test case to obtain a test result.
8. A test data determination apparatus, comprising:
the extracting unit is used for extracting the parameter identification aiming at the received test case to be executed to obtain the parameter identification;
the first determining unit is used for determining first target test data corresponding to the parameter identifier from a preset parameter database under the condition that the parameter identifier indicates the associated parameter;
A second determining unit configured to determine a function identifier and variable data from the parameter identifiers in a case where it is determined that the parameter identifiers indicate parameter functions; and
and the processing unit is used for processing the variable data by utilizing the function corresponding to the function identifier to obtain second target test data.
9. The apparatus as recited in claim 8, further comprising:
the updating unit is used for updating preset data associated with the corresponding parameter identifier by utilizing the first target test data or/and the second target test data to obtain an executable test case; and
and the execution unit is used for executing the executable test case to obtain a test result.
10. 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 processor implements the method of any of the preceding claims 1-7 when executing the computer program.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the method of any of the preceding claims 1-7.
12. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method according to any of claims 1-7.
CN202310747488.3A 2023-06-21 2023-06-21 Test data determining method and device, computer equipment and storage medium Pending CN116737582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310747488.3A CN116737582A (en) 2023-06-21 2023-06-21 Test data determining method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310747488.3A CN116737582A (en) 2023-06-21 2023-06-21 Test data determining method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116737582A true CN116737582A (en) 2023-09-12

Family

ID=87911237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310747488.3A Pending CN116737582A (en) 2023-06-21 2023-06-21 Test data determining method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116737582A (en)

Similar Documents

Publication Publication Date Title
EP3563243B1 (en) Determining application test results using screenshot metadata
US10235275B2 (en) Extraction of problem diagnostic knowledge from test cases
CN106980571B (en) Method and equipment for constructing test case suite
US20160098390A1 (en) Command history analysis apparatus and command history analysis method
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
WO2015039793A1 (en) Derivation of generalized test cases
CN114546738A (en) Server general test method, system, terminal and storage medium
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN109062820A (en) A kind of software performance testing method and device
CN116166525A (en) Method and device for generating test script
CN111047434A (en) Operation record generation method and device, computer equipment and storage medium
WO2021151314A1 (en) Dns automatic performance test method, apparatus, device, and readable storage medium
KR101794016B1 (en) Method of analyzing application objects based on distributed computing, method of providing item executable by computer, server performing the same and storage media storing the same
CN109358813B (en) Capacity expansion method and device for distributed storage system
CN116737582A (en) Test data determining method and device, computer equipment and storage medium
CN114003784A (en) Request recording method, device, equipment and storage medium
CN110716778B (en) Application compatibility testing method, device and system
CN114003457A (en) Data acquisition method and device, storage medium and electronic equipment
CN112015633B (en) Test excitation multi-platform multiplexing method, device, equipment and storage medium
CN109948251B (en) CAD-based data processing method, device, equipment and storage medium
CN113127369A (en) Processing method and device for execution script
CN113157554A (en) Software automation question making test method and related equipment
CN111985188A (en) Data conversion method, device, terminal and 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