CN112395183A - Method, device and storage medium for creating test data integration file - Google Patents

Method, device and storage medium for creating test data integration file Download PDF

Info

Publication number
CN112395183A
CN112395183A CN201910765419.9A CN201910765419A CN112395183A CN 112395183 A CN112395183 A CN 112395183A CN 201910765419 A CN201910765419 A CN 201910765419A CN 112395183 A CN112395183 A CN 112395183A
Authority
CN
China
Prior art keywords
test data
data
file
writing
fields
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
CN201910765419.9A
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.)
Beijing Zhongguancun Kejin Technology Co Ltd
Original Assignee
Beijing Zhongguancun Kejin 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 Beijing Zhongguancun Kejin Technology Co Ltd filed Critical Beijing Zhongguancun Kejin Technology Co Ltd
Priority to CN201910765419.9A priority Critical patent/CN112395183A/en
Publication of CN112395183A publication Critical patent/CN112395183A/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/3676Test management for coverage 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/3672Test management
    • 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

Landscapes

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

Abstract

The application discloses a method and a device for creating a test data integration file and a storage medium. Wherein, the method comprises the following steps: receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data; determining fields needing to be assigned according to the types of the integrated files; assigning the fields needing to be assigned according to the cycle times and the data range to generate test data; and writing the generated test data into the integrated file.

Description

Method, device and storage medium for creating test data integration file
Technical Field
The present application relates to the field of computer testing, and in particular, to a method, an apparatus, and a storage medium for creating a test data integration file.
Background
With increasingly large software system scale, strong system relevance, complex business, fast requirement change and the like in the financial industry, software testing is a part which cannot be lost before the software of the financial system is released, and the purpose of the software testing is to avoid business risks brought by software defects and errors existing after the software is released by using minimum time and resources. In actual work, when test data needed by a test scene are too much, the data must be sufficiently random, and logical relations exist among the data, too much time is often spent in a manual mode, so that the tester needs to be assisted to create the test data in a tool mode, and the test efficiency is improved.
The existing test data integrated files are generated by pure manual operation of testers, and the problems are obvious: (1) when the test data amount is excessive, the association dependency of the integrated file is strong, the number of the positions needing to be modified is large, and omission or modification errors are easy to occur. (2) When the number of test data fields is large, the value ranges of each field are different, the randomness is large, and it is difficult to manually create data to cover all cross value scenes if the data needs to be created. (3) When a certain amount of data in batches is manually created, copying and pasting are adopted for modification, so that the efficiency is low and the error rate is high. (4) If partial data values need to be encrypted or calculated, the difficulty of manually creating the data is increased.
Aiming at the technical problems that in the prior art, the risk of influence on the test efficiency caused by the loss of content fields, crossed scene of the values of the content fields, mismatching of associated data, insufficient data magnitude and the like exists when testers manually process test data integration files, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the disclosure provides a method, a device and a storage medium for creating a test data integration file, so as to at least solve the technical problems that in the prior art, the test efficiency is affected due to risks of missing content fields, crossed content field value scenes, unmatched associated data, insufficient data magnitude and the like when testers manually process the test data integration file.
According to an aspect of the embodiments of the present disclosure, there is provided a method of creating a test data integration file, including: receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data; determining fields needing to be assigned according to the types of the integrated files; assigning the fields needing to be assigned according to the cycle times and the data range to generate test data; and writing the generated test data into the integrated file.
According to another aspect of the embodiments of the present disclosure, there is also provided a storage medium including a stored program, wherein the method of any one of the above is performed by a processor when the program is run.
According to another aspect of the embodiments of the present disclosure, there is also provided an apparatus for creating a test data integration file, including: the receiving module is used for receiving parameters which are input by a tester and are related to the operation of generating the test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data; the determining module is used for determining fields needing to be assigned according to the types of the integrated files; the generating module is used for assigning the fields needing to be assigned according to the cycle times and the data range and generating test data; and the writing module is used for writing the generated test data into the integrated file.
According to another aspect of the embodiments of the present disclosure, there is also provided an apparatus for creating a test data integration file, including: a processor; and a memory coupled to the processor for providing instructions to the processor for processing the following processing steps: receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data; determining fields needing to be assigned according to the types of the integrated files; assigning the fields needing to be assigned according to the cycle times and the data range to generate test data; and writing the generated test data into the integrated file.
In the embodiment of the disclosure, parameters related to generating test data input by a tester are received, wherein the parameters comprise cycle number, data range and integration file type. And then, determining fields needing to be assigned according to the types of the integrated files. And further, assigning the field to be assigned according to the cycle number and the data range to generate test data. And finally, writing the test data into the integrated file, thereby completing the creation process of the test data integrated file. Compared with the prior art, the method achieves the purpose of quickly and accurately constructing the test data integration file. Because parameters such as cycle number, data range and the like are introduced in the process of generating the test data, the technical effects of improving the data accuracy, relevance and scene coverage rate are achieved. And further, the technical problem that in the prior art, the test efficiency is influenced by risks of content field loss, content field value crossing scenes, mismatching of associated data, insufficient data magnitude and the like when testers manually process the test data integration files is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the disclosure and together with the description serve to explain the disclosure and not to limit the disclosure. In the drawings:
fig. 1 is a hardware configuration block diagram of a [ computer terminal (or mobile device) ] for implementing the method according to embodiment 1 of the present disclosure;
fig. 2 is a schematic flowchart of a method for creating a test data integration file according to a first aspect of embodiment 1 of the present disclosure;
FIG. 3 is a schematic diagram of an apparatus for creating a test data integration file according to embodiment 2 of the present disclosure; and
fig. 4 is a schematic diagram of an apparatus for creating a test data integration file according to embodiment 3 of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. It is to be understood that the described embodiments are merely exemplary of some, and not all, of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with the present embodiment, there is provided an embodiment of a method for creating a test data integration file, it being noted that the steps illustrated in the flowchart of the figure 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 flowchart, in some cases, the steps illustrated or described may be performed in an order different than that presented herein.
The method provided by the embodiment can be executed in a mobile terminal, a computer terminal or a similar operation device. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a method of creating a test data integration file. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the disclosed embodiments, the data processing circuit acts as a processor control (e.g., selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the method for creating a test data integration file in the embodiment of the present disclosure, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 104, that is, implementing the method for creating a test data integration file of the application program. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
It should be noted here that in some alternative embodiments, the computer device (or mobile device) shown in fig. 1 described above may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that fig. 1 is only one example of a particular specific example and is intended to illustrate the types of components that may be present in the computer device (or mobile device) described above.
Under the operating environment, according to a first aspect of the present embodiment, there is provided a method for creating a test data integration file, where fig. 2 shows a flowchart of the method, and with reference to fig. 2, the method includes:
s202: receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data;
s204: determining fields needing to be assigned according to the types of the integrated files;
s206: assigning the fields needing to be assigned according to the cycle times and the data range to generate test data; and
s208: and writing the generated test data into the integrated file.
As described in the background, the existing test data integration files are generated by a tester through a purely manual operation, and several problems are obvious: (1) when the test data amount is excessive, the association dependency of the integrated file is strong, the number of the positions needing to be modified is large, and omission or modification errors are easy to occur. (2) When the number of test data fields is large, the value ranges of each field are different, the randomness is large, and it is difficult to manually create data to cover all cross value scenes if the data needs to be created. (3) When a certain amount of data in batches is manually created, copying and pasting are adopted for modification, so that the efficiency is low and the error rate is high. (4) If partial data values need to be encrypted or calculated, the difficulty of manually creating the data is increased.
In view of the technical problems in the background art, the technical solution of the present embodiment provides a method for creating a test data integration file. Specifically, referring to FIG. 2, parameters input by a tester are first received, and the parameters are used to create test data. Wherein the parameters include: cycle number, data range, and type of integration file. The number of cycles is used to specify the number of rounds in which test data is generated, for example: the number of cycles is 5, then the test data is run for 5 cycles. The data range is used to specify the data range of the generated test data, for example: the data range of the age field in the test data is 20-30 years old. The kind of the integrated file is used for writing the generated test data, and the kind of the integrated file includes a plurality of kinds, for example: the customer information and the billing information are two different kinds of integrated files, which contain different fields. Taking the client information integration file as an example, the client information integration file may include: name, gender, age, user number, user account, etc. The tester can select various parameters through the interface of the client, such as: and checking the types of the integrated files on a client interface.
Further, according to the type of the integrated file input by the user, determining the fields needing to be assigned. For example: the type of the integrated file selected by the tester is a customer information integrated file, and fields needing value assignment are determined to be age, user number, user account number and the like.
Furthermore, the fields needing to be assigned are assigned according to the cycle times (for example, 5 cycles) and the data range (for example, the age range is 20-30, the user number range is 1-100, and the user account range is 1000-9999), and then the test data is generated. For example, one of the test data is: age is 20, user number is 1, user account is 1000. Finally, the generated test data is written into an integration file (i.e., a customer information integration file).
Thus, according to the present embodiment, parameters related to generating test data, which are input by a tester, are received, wherein the parameters include the number of cycles, the data range, and the kind of integration file. And then, determining fields needing to be assigned according to the types of the integrated files. And further, assigning the field to be assigned according to the cycle number and the data range to generate test data. And finally, writing the test data into the integrated file, thereby completing the creation process of the test data integrated file. Compared with the prior art, the method achieves the purpose of quickly and accurately constructing the test data integration file. Because parameters such as cycle number, data range and the like are introduced in the process of generating the test data, the technical effects of improving the data accuracy, relevance and scene coverage rate are achieved. And further, the technical problem that in the prior art, the test efficiency is influenced by risks of content field loss, content field value crossing scenes, mismatching of associated data, insufficient data magnitude and the like when testers manually process the test data integration files is solved.
Optionally, the operation of assigning the field to be assigned according to the cycle number and the data range and generating the test data includes: and circularly assigning the fields needing to be assigned according to the number of circulation times based on the data range to generate test data.
Specifically, in the operation of assigning the field to be assigned according to the cycle number and the data range and generating the test data, the field to be assigned is circularly assigned according to the cycle number based on the data range. Taking the age field as an example, for example, the data range of the age field is 20-30 years, the number of cycles is set to 5, so the assignment to the age field is 20, 21, 22, 23. Other field assignment methods are similar to those of the age field, and the cycle number is not changed, and only the data range is changed, which is not described herein again. It should be noted that the assignment of the fields is performed simultaneously. Therefore, in this way, data loss can be avoided, all scenes are covered, and the relevance among data is ensured.
Optionally, the data range is a data range of a designated field in the field to be assigned, and the field to be assigned is assigned according to the cycle number and the data range to generate the test data, further including: and circularly assigning the designated fields in the integrated file according to the number of circulation times based on the data range of the designated fields, and randomly assigning the non-designated fields in the fields needing to be assigned to generate test data.
Specifically, the data range is a data range of a specified field, for example: only the age field of the fields that need to be assigned a value is highly valued (i.e., the age field in the test data is important), so the tester specifies a numerical range for the age field only. In the operation of generating test data, based on the cycle number, a cycle assignment is performed according to the numerical range of the designated field (age field), and the process of the cycle assignment is similar to the above-mentioned cycle assignment process, which is not described herein again. And for the non-specified fields in the fields needing to be assigned, namely the fields (such as a user number field and a user account number field) left by the age field in the fields needing to be assigned. These non-specified fields are assigned randomly, i.e.: a random number assignment is generated for the non-designated field.
Therefore, by the mode, the individual fields can be sequentially assigned according to the specific requirements of the testers, so that the computing resources can be greatly saved, and the creation efficiency is improved.
Optionally, the operation of writing the generated test data into the integration file includes: judging whether the operation of assigning the fields needing to be assigned is completed by one cycle traversal or not; and after the cycle traversal is completed, writing the test data generated by the cycle traversal into the integrated file.
Specifically, in the operation of writing the generated test data into the integrated file, it is first determined whether the operation of assigning the field to be assigned completes one loop traversal, for example: and if the age is 20-30, if the cycle assignment is completed (other fields are similar to the age field and carry out the cycle assignment at the same time), generating a plurality of pieces of test data after the cycle assignment is completed, and writing the test data generated by the cycle into an integrated file. After each loop traversal is completed, the test data generated this time is written into the integrated file until all the loops (i.e., the loop times) are completed. After one integrated file is completed, the creation of the next integrated file is performed, and the creation process is the same as the above steps. Thus, the relevance of the same attribute data in each integrated file is satisfied.
Optionally, the operation of writing the generated test data into the integration file includes: judging whether the operation of assigning values to the specified fields completes one cycle traversal or not; and after the cycle traversal is completed, writing the test data generated by the cycle traversal into the integrated file. Specifically, whether the operation of assigning values to the specified fields (for example, the age fields) completes one loop traversal is judged, and the generated test data is written into the integrated file after the loop traversal is completed.
Further, referring to fig. 1, according to a second aspect of the present embodiment, a storage medium 104 is provided. The storage medium 104 comprises a stored program, wherein the method of any of the above is performed by a processor when the program is run.
Therefore, according to the embodiment, the purpose of quickly and accurately constructing the test data integration file is achieved by the method for creating the test data integration file. Because parameters such as cycle number, data range and the like are introduced in the process of generating the test data, the technical effects of improving the data accuracy, relevance and scene coverage rate are achieved. And further, the technical problem that in the prior art, the test efficiency is influenced by risks of content field loss, content field value crossing scenes, mismatching of associated data, insufficient data magnitude and the like when testers manually process the test data integration files is solved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
Fig. 3 shows an apparatus 300 for creating a test data integration file according to the present embodiment, which apparatus 300 corresponds to the method according to the first aspect of embodiment 1. Referring to fig. 3, the apparatus 300 includes: a receiving module 310, configured to receive parameters input by a tester and related to an operation of generating test data, where the parameters include: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data; a determining module 320, configured to determine, according to the type of the integrated file, a field to be assigned; the generating module 330 is configured to assign a value to a field to be assigned according to the cycle number and the data range, and generate test data; and a writing module 340 for writing the generated test data into the integrated file.
Optionally, the generating module 330 includes: and the first generation submodule is used for performing cyclic assignment on the field to be assigned according to the cycle number based on the data range to generate test data.
Optionally, the data range is a data range of a specified field in the field that needs to be assigned, and the generating module 330 further includes: and the second generation submodule is used for performing cyclic assignment on the specified fields in the integrated file according to the cycle times based on the data range of the specified fields, performing random assignment on the non-specified fields in the fields needing assignment, and generating the test data.
Optionally, the writing module 340 includes: the first judgment submodule is used for judging whether the operation of assigning the fields needing to be assigned is completed by one cycle traversal or not; and the first writing submodule is used for writing the test data generated by the cycle traversal into the integrated file after the cycle traversal is completed.
Optionally, the writing module 340 includes: the second judgment submodule is used for judging whether the operation of assigning the designated field completes one cycle traversal or not; and the second writing submodule is used for writing the test data generated by the cycle traversal into the integrated file after the cycle traversal is completed.
Therefore, according to the embodiment, the device 300 for creating the test data integration file achieves the purpose of quickly and accurately constructing the test data integration file. Because parameters such as cycle number, data range and the like are introduced in the process of generating the test data, the technical effects of improving the data accuracy, relevance and scene coverage rate are achieved. And further, the technical problem that in the prior art, the test efficiency is influenced by risks of content field loss, content field value crossing scenes, mismatching of associated data, insufficient data magnitude and the like when testers manually process the test data integration files is solved.
Example 3
Fig. 4 shows an apparatus 400 for creating a test data integration file according to the present embodiment, which apparatus 400 corresponds to the method according to the first aspect of embodiment 1. Referring to fig. 4, the apparatus 400 includes: a processor 410; and a memory 420 coupled to the processor 410 for providing instructions to the processor 410 to process the following process steps: receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a round number of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data; determining fields needing to be assigned according to the types of the integrated files; assigning the fields needing to be assigned according to the cycle times and the data range to generate test data; and writing the generated test data into the integrated file.
Optionally, the operation of assigning the field to be assigned according to the cycle number and the data range and generating the test data includes: and circularly assigning the fields needing to be assigned according to the number of circulation times based on the data range to generate test data.
Optionally, the data range is a data range of a designated field in the field to be assigned, and the field to be assigned is assigned according to the cycle number and the data range to generate the test data, further including: and circularly assigning the designated fields in the integrated file according to the number of circulation times based on the data range of the designated fields, and randomly assigning the non-designated fields in the fields needing to be assigned to generate test data.
Optionally, the operation of writing the generated test data into the integration file includes: judging whether the operation of assigning the fields needing to be assigned is completed by one cycle traversal or not; and after the cycle traversal is completed, writing the test data generated by the cycle traversal into the integrated file.
Optionally, the operation of writing the generated test data into the integration file includes: judging whether the operation of assigning values to the specified fields completes one cycle traversal or not; and after the cycle traversal is completed, writing the test data generated by the cycle traversal into the integrated file.
Therefore, according to the embodiment, the device 400 for creating the test data integration file achieves the purpose of quickly and accurately constructing the test data integration file. Because parameters such as cycle number, data range and the like are introduced in the process of generating the test data, the technical effects of improving the data accuracy, relevance and scene coverage rate are achieved. And further, the technical problem that in the prior art, the test efficiency is influenced by risks of content field loss, content field value crossing scenes, mismatching of associated data, insufficient data magnitude and the like when testers manually process the test data integration files is solved.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can 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 type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit 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 invention may be embodied in the form of a software product, which is stored in a storage medium and includes 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 invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of creating a test data integration file, comprising:
receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a number of rounds of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data;
determining fields needing to be assigned according to the types of the integrated files;
assigning the field needing to be assigned according to the cycle times and the data range to generate the test data; and
and writing the generated test data into the integrated file.
2. The method according to claim 1, wherein the operation of assigning the field to be assigned according to the cycle number and the data range and generating the test data comprises:
and circularly assigning the field needing to be assigned according to the cycle times based on the data range to generate the test data.
3. The method according to claim 1, wherein the data range is a data range of a specified field in the field to be assigned, and the operation of assigning the field to be assigned according to the cycle number and the data range and generating the test data further comprises:
and circularly assigning the assigned fields in the integrated file according to the cycle times based on the data range of the assigned fields, and randomly assigning the non-assigned fields in the fields needing to be assigned to generate the test data.
4. The method of claim 2, wherein the act of writing the generated test data to the integration file comprises:
judging whether the operation of assigning the fields needing to be assigned is completed by one cycle traversal; and
and after the circulation traversal is completed, writing the test data generated by the circulation traversal into the integrated file.
5. The method of claim 3, wherein the act of writing the generated test data to the integration file comprises:
judging whether the operation of assigning the designated field completes one cycle traversal or not; and
and after the circulation traversal is completed, writing the test data generated by the circulation traversal into the integrated file.
6. A storage medium comprising a stored program, wherein the method of any one of claims 1 to 5 is performed by a processor when the program is run.
7. An apparatus for creating a test data integration file, comprising:
the receiving module is used for receiving parameters which are input by a tester and are related to the operation of generating the test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a number of rounds of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data;
the determining module is used for determining fields needing to be assigned according to the types of the integrated files;
the generating module is used for assigning the field needing to be assigned according to the cycle number and the data range and generating the test data; and
and the writing module is used for writing the generated test data into the integrated file.
8. The apparatus of claim 7, wherein the generating module comprises: and the first generation submodule is used for performing cyclic assignment on the field needing to be assigned according to the cycle times based on the data range to generate the test data.
9. The apparatus of claim 8, wherein the data range is a data range of a specified field of the fields requiring value assignment, and the generating module further comprises: and the second generation submodule is used for performing cyclic assignment on the specified fields in the integrated file according to the cycle times based on the data range of the specified fields, performing random assignment on the non-specified fields in the fields needing to be assigned, and generating the test data.
10. An apparatus for creating a test data integration file, comprising:
a processor; and
a memory coupled to the processor for providing instructions to the processor for processing the following processing steps:
receiving parameters input by a tester and related to the operation of generating test data, wherein the parameters comprise: a cycle number, wherein the cycle number is used to specify a number of rounds of generating test data; a data range, wherein the data range is used to specify a data range of the generated test data; and a type of integration file, wherein the integration file is used for writing the generated test data;
determining fields needing to be assigned according to the types of the integrated files;
assigning the field needing to be assigned according to the cycle times and the data range to generate the test data; and
and writing the generated test data into the integrated file.
CN201910765419.9A 2019-08-19 2019-08-19 Method, device and storage medium for creating test data integration file Pending CN112395183A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910765419.9A CN112395183A (en) 2019-08-19 2019-08-19 Method, device and storage medium for creating test data integration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910765419.9A CN112395183A (en) 2019-08-19 2019-08-19 Method, device and storage medium for creating test data integration file

Publications (1)

Publication Number Publication Date
CN112395183A true CN112395183A (en) 2021-02-23

Family

ID=74603514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910765419.9A Pending CN112395183A (en) 2019-08-19 2019-08-19 Method, device and storage medium for creating test data integration file

Country Status (1)

Country Link
CN (1) CN112395183A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908015A (en) * 2009-06-04 2010-12-08 中国工商银行股份有限公司 Device and method for creating test case based on components
CN106897205A (en) * 2015-12-18 2017-06-27 阿里巴巴集团控股有限公司 A kind of test data generating method and device
CN107203462A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 A kind of data creation method and device
CN109189666A (en) * 2018-08-02 2019-01-11 腾讯科技(北京)有限公司 Interface test method, device and computer equipment
CN109657932A (en) * 2018-11-29 2019-04-19 平安科技(深圳)有限公司 Business risk analysis method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908015A (en) * 2009-06-04 2010-12-08 中国工商银行股份有限公司 Device and method for creating test case based on components
CN106897205A (en) * 2015-12-18 2017-06-27 阿里巴巴集团控股有限公司 A kind of test data generating method and device
CN107203462A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 A kind of data creation method and device
CN109189666A (en) * 2018-08-02 2019-01-11 腾讯科技(北京)有限公司 Interface test method, device and computer equipment
CN109657932A (en) * 2018-11-29 2019-04-19 平安科技(深圳)有限公司 Business risk analysis method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109582525B (en) Test code verification method, verification device, equipment and storage medium
CN106708719B (en) Service function testing method and device
CN111221726A (en) Test data generation method and device, storage medium and intelligent equipment
CN106681903B (en) Method and device for generating test case
CN107832062B (en) Program updating method and terminal equipment
CN113376514B (en) FPGA chip testing method, device, system and storage medium
CN107741904A (en) Test machine method of automatic configuration, device, equipment and storage medium
CN112433941A (en) Test analysis method, device, equipment and storage medium
CN114356787B (en) Automatic testing method and device for deep learning model compiler and storage medium
CN110647462A (en) Interface test method, device and storage medium
CN113407254B (en) Form generation method and device, electronic equipment and storage medium
CN110674029A (en) Method and device for automatically generating test data, electronic equipment and storage medium
CN112311624B (en) Cloud host testing method and device, storage medium and electronic equipment
CN111338964B (en) Ordered batch test method, system, terminal and storage medium
CN110597717A (en) Code testing method, device and storage medium
CN112416734A (en) Test method, device and storage medium
CN112395183A (en) Method, device and storage medium for creating test data integration file
CN114328181A (en) Test case generation and execution method, device and storage medium
CN112416488B (en) User portrait implementing method, device, computer equipment and computer readable storage medium
CN110609781A (en) Interface test method, device and storage medium
CN113110982A (en) Data access layer verification method and device, storage medium and electronic device
CN112306843A (en) Test method, test device and storage medium
CN117743295A (en) Batch processing method and device, nonvolatile storage medium and batch processing system
CN110751204A (en) Data fusion method and device, storage medium and electronic device
CN110674041A (en) Debugging method and device of risk control system 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