CN107678935B - Data generation method, terminal and computer readable storage medium - Google Patents

Data generation method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN107678935B
CN107678935B CN201710327747.1A CN201710327747A CN107678935B CN 107678935 B CN107678935 B CN 107678935B CN 201710327747 A CN201710327747 A CN 201710327747A CN 107678935 B CN107678935 B CN 107678935B
Authority
CN
China
Prior art keywords
test
data
software
generated
test data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710327747.1A
Other languages
Chinese (zh)
Other versions
CN107678935A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201710327747.1A priority Critical patent/CN107678935B/en
Priority to PCT/CN2017/111900 priority patent/WO2018205545A1/en
Publication of CN107678935A publication Critical patent/CN107678935A/en
Application granted granted Critical
Publication of CN107678935B publication Critical patent/CN107678935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention discloses a data generation method, which is applied to software testing and comprises the following steps: when a software test request is detected, determining and storing test information of the software to be tested according to the function of the software to be tested, generating test data according to the test information, verifying whether the generated test data meets the test requirement, inputting the test data meeting the test requirement into an Excel table, and applying the Excel table to software testing. The invention also correspondingly discloses a terminal for generating the data and a computer readable medium. According to the invention, the Excel is combined with the program language, the program language simulates and generates the software test data according to the data information in the template data, the manual input according to the preset format by a tester is not needed, and the software test efficiency is improved.

Description

Data generation method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of software testing, and in particular, to a data generation method, a terminal, and a computer-readable storage medium.
Background
Different network topological structures are arranged in a local area network of an existing company or a public institution, a server in a topological structure center is connected with other node subsystems to receive and analyze data, a plurality of subsystems possibly upload the data to the server according to a set template, the server receives the data sent by the subsystems through the set template, verifies the data in the template and then inputs the data to a corresponding position, and finally, the processing and analysis of the data are realized.
However, in the early stage of system development, the middle stage of operation and the later stage of maintenance, no real data is uploaded to the server in the form of an accessory through the template, so that a large amount of data needs to be manually input by a tester for testing, the manual data input for system testing is large, tedious and boring, the problems of data input format errors, input omission and the like can occur, and the problems are difficult to find in the later-stage inspection, so that the system testing is caused.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a data generation method, a terminal and a computer readable storage medium, aiming at reducing manual operation and improving test efficiency.
In order to achieve the above object, the present invention provides a data generating method, which is applied to software testing and comprises the following steps:
when a software test request is detected, determining and storing test information of the software to be tested according to the function of the software to be tested;
generating test data according to the test information, and verifying whether the generated test data meets the test requirements;
and inputting the test data meeting the test requirements into an Excel table, and applying the Excel table to software test.
Optionally, when a software testing request is detected, the step of determining and storing the testing information of the software to be tested according to the function of the software to be tested includes:
when a software testing request is detected, establishing an association relationship between the software to be tested and an Excel table according to the function of the software to be tested;
and determining and storing test information of the software test according to the incidence relation between the software to be tested and the Excel table.
Optionally, the test information includes a data position, a data length, and a character set, and the step of generating the test data according to the test information includes:
taking the row-column coordinate value in the Excel table as a data position in the test information;
and determining the data length and the character set of the corresponding position according to the data position in the test information to generate test data.
Optionally, the step of determining the data length and the character set of the corresponding position according to the data position in the test information to generate the test data includes:
identifying the data length and the character set at the corresponding position according to the data position in the test information;
when a data generation instruction is detected, extracting characters in the character set and generating test data according to data length combination.
Optionally, the step of verifying whether the generated test data meets the test requirement includes:
and verifying the generated test data according to the software function of the software to be tested and preset verification conditions so as to judge whether the generated test data meets the test requirement.
Optionally, the step of determining whether the generated test data meets the test requirement includes:
if the generated test data meets the test requirement, testing by using the generated test data software;
if the generated test data do not accord with the test requirement, marking the test data which do not accord with the test requirement, and generating new test data.
Optionally, the step of inputting the test data meeting the test requirement into the Excel table and applying the test data to the software test includes:
and determining the software testing times according to the software testing requirements, and setting the generation times of the testing data so as to perform multiple software tests.
Optionally, the step of determining the number of software tests according to the software test requirement, and setting the number of test data generation times to perform multiple software tests includes:
and performing software test by using the generated test data, judging whether the test result obtained by the software test is correct, and stopping generating the test data if the test result obtained by the software test is correct.
In order to achieve the above object, the present invention further provides a data generating terminal, including: the data generating program is stored on the memory and can be operated on the processor, and when being executed by the processor, the data generating program realizes the steps of the data generating method.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a data generation program, which when executed by a processor, implements the steps of the above data generation method.
The invention provides a data generation method, which is applied to software testing, when a software testing request is detected, the testing information of software to be tested is determined and stored according to the function of the software to be tested, the testing data is generated according to the testing information, whether the generated testing data meets the testing requirement is verified, the testing data meeting the testing requirement is input into an Excel table and is applied to the software testing; specifically, data information uploaded to a server by a user terminal and processed by the user terminal needs to be stored in an attachment in an Excel format during the software running process, so that when software on the server is tested, a program language is developed on the Excel by utilizing the characteristic that the Excel supports the program language running, data input of the user terminal is simulated, software testers sort data needing to be processed by the server, all data position information and data length which can be input by the user are obtained, a character set serves as test information, and the program language is set to randomly generate corresponding test data for software testing, so that the software testers are prevented from manually inputting the data, the data input speed is increased, and the software testing efficiency is further improved.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a scenario illustration of various embodiments of a data generation method of the present invention;
FIG. 3 is a schematic view of a scenario of the data generation method of the present invention during a software test process;
FIG. 4 is a schematic flow chart diagram illustrating a data generating method according to an embodiment of the present invention;
FIG. 5 is a detailed flowchart of step S10 of the data generation method of FIG. 4;
FIG. 6 is a detailed flowchart of step S20 of the data generation method in FIG. 4;
FIG. 7 is a detailed flowchart of step S22 of the data generation method of FIG. 6;
fig. 8 is a flowchart illustrating a data generating method according to another embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The corresponding program in the data generating method of the present invention is implemented by a data generating terminal, the terminal of the embodiment may be a PC, or a tablet computer, a portable computer, or other mobile terminal device with a display function, and it should be noted that the terminal and the server mentioned in the present invention may be replaced.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and an input unit such as a Keyboard (Keyboard), in the present invention, the terminal (server) performs communication connection with the user terminal during the software running process, the tester may use the user interface to input data information during the software testing process, and the optional user interface 1003 may further include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The main solution of the embodiment of the invention is as follows: developing a program language on Excel to simulate and generate test data according to data processed by a server, applying and testing software, specifically, combining with figure 3, data input by a user end processed in the software running process is input in an Excel table, the invention simulates data input by the user end, adopts the program language to generate data in the Excel, and applies the generated data to the software testing, and it needs to be added to explain that digital information processed by the scheme software (system) described in the invention is in the Excel, therefore, based on the characteristic that the Excel can directly run a program, VB (or other program languages which can run on the Excel) is utilized to set a data generation statement in the Excel, an accessory uploaded by the user end is the Excel, if simple replacement is carried out on the basis of the invention, namely, other character information is generated, or other document modes are simply switched on the Excel, are intended to be within the scope of the present invention.
Because the prior art has no improved scheme aiming at manual test data input in the software test, the conventional software test has the defects that the data input is manually carried out regardless of the type of the data, so the test times are less, the test precision is lower, and the test efficiency of the software is lower.
The invention provides a solution for generating test data in a data processing format using a programming language.
As shown in fig. 1, the memory 1005, which is a kind of computer storage medium, may include an operating system, a network communication module, a user interface module, and a data generation application program, and the data generation application program performs data generation to obtain data for software testing.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke the software test stored in the memory 1005 and perform the following operations:
when a software test request is detected, determining and storing test information of the software to be tested according to the function of the software to be tested;
generating test data according to the test information, and verifying whether the generated test data meets the test requirements;
and inputting the test data meeting the test requirements into an Excel table, and applying the Excel table to software test.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
when a software test request is detected, the step of determining and storing test information of the software to be tested according to the function of the software to be tested comprises the following steps:
when a software testing request is detected, establishing an association relationship between the software to be tested and an Excel table according to the function of the software to be tested;
and determining and storing test information of the software test according to the incidence relation between the software to be tested and the Excel table.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
the test information comprises a data position, a data length and a character set, and the step of generating the test data according to the test information comprises the following steps:
taking the row-column coordinate value in the Excel table as a data position in the test information;
and determining the data length and the character set of the corresponding position according to the data position in the test information to generate test data.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
the step of determining the data length and the character set of the corresponding position according to the data position in the test information to generate the test data comprises the following steps:
identifying the data length and the character set at the corresponding position according to the data position in the test information;
when a data generation instruction is detected, extracting characters in the character set and generating test data according to data length combination.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
the step of verifying whether the generated test data meets the test requirements comprises:
and verifying the generated test data according to the software function of the software to be tested and preset verification conditions so as to judge whether the generated test data meets the test requirement.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
the step of judging whether the generated test data meets the test requirement comprises the following steps:
if the generated test data meets the test requirement, testing by using the generated test data software;
if the generated test data do not accord with the test requirement, marking the test data which do not accord with the test requirement, and generating new test data.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
inputting test data meeting the test requirements into an Excel table, and applying the Excel table to software test, wherein the step of inputting test data meeting the test requirements into the Excel table comprises the following steps:
and determining the software testing times according to the software testing requirements, and setting the generation times of the testing data so as to perform multiple software tests.
Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
the method comprises the following steps of determining the software testing times according to the software testing requirements, and setting the generation times of testing data so as to perform multiple software tests:
and performing software test by using the generated test data, judging whether the test result obtained by the software test is correct, and stopping generating the test data if the test result obtained by the software test is correct.
Referring to fig. 4, an embodiment of the data generating method of the present invention provides a data generating method including the following steps:
and step S10, when the software test request is detected, determining and storing the test information of the software to be tested according to the function of the software to be tested.
When software (the software can be understood as software or a data processing system) is tested on a server, information of data processed during the software running is used as test information and stored in a memory, so as to determine test data needing to be generated in a simulation mode in the software testing process according to the test information, for example, the software on the server is a financial payroll settlement system which is used for issuing wages for employees of other branch companies, the branch companies are used as user terminals to upload basic information (employee names, wage numbers, sexes and the like) of the employees of the company and data related to the wage issuing of the wages, so that in the system testing process of the financial payroll settlement system, a tester is required to input data such as the wage amount, bank card numbers and the like, but real payroll settlement data is not used for software testing in the software testing process, the invention firstly arranges the data related information of system operation processing as the test information of system test (the test information of financial payroll settlement system, payroll amount, bank card number, deduction amount and other information related to payroll calculation), and simulates the related test data according to the stored test information when the test data is generated to calculate payroll, thereby realizing the test of the financial payroll settlement system.
And step S20, generating test data according to the test information, and verifying whether the generated test data meets the test requirement.
Specifically, according to data processed during software running on the server, a program function is set to generate test data, namely, types of the data which may appear are stored in a memory of the server, a program language is developed on Excel, corresponding characters are selected to be combined into the test data for data testing, as shown in table 1, numbers, other letters and symbol information appearing in a bank card number are stored in the memory as test information:
Figure BDA0001291219000000081
TABLE 1
(Table 1 shows a template of Excel, which can intuitively understand payroll data as software test data), using a programming language, first determining the position of filling digital information in an Excel form: in the row and column, further setting program functions to generate data for testing, verifying the generated test data according to verification conditions, and determining whether the generated data meets the test requirements (the verification conditions include that the generated data can be verified for randomness according to the generation probability of the data, or whether the generated data meets a specific data boundary, a tail verification rule, and the like, and the generated test data is verified to meet the test requirements if the generated data meets the test requirements).
And step S30, inputting the test data meeting the test requirements into an Excel form, and applying the Excel form to software testing.
And correspondingly inputting the verified test data meeting the test requirements into the Excel table by the server, and performing software test by using the test data generated by the program language in the Excel table.
In the embodiment, when a software test request is detected, determining and storing test information of software to be tested according to functions of the software to be tested, generating test data according to the test information, verifying whether the generated test data meets test requirements, inputting the test data meeting the test requirements into an Excel form, and applying the Excel form to software testing; the method comprises the steps of storing data information uploaded to a server by a user terminal for processing in an accessory in an Excel format, developing a program language on the Excel by utilizing the characteristic that the Excel supports the operation of the program language when testing software on the server, simulating data input of the user terminal, specifically, sorting data to be processed by the server to obtain all data information possibly input by the user as test information, setting the program language to randomly generate corresponding test data for software testing, avoiding manual data input by software testing personnel, improving the speed of data input, and further improving the software testing efficiency.
Referring to fig. 5, step S10 in the present embodiment includes:
and step S11, when a software testing request is detected, establishing an association relationship between the software to be tested and the Excel table according to the functions of the software to be tested.
When testing the server software, firstly determining the data processed in the software running process, inputting all the data processed in the software running process into an Excel format as software testing information, establishing an association relationship between the software to be tested and an Excel form, for example, a financial payroll settlement system of headquarters, when carrying out payroll distribution, inputting related payroll distribution data into a template of a staff payroll detail Excel form shown in table 1, uploading the data in the Excel as accessory information to the financial payroll settlement system of the headquarters, establishing the association relationship between the financial payroll settlement system and the Excel form, and correspondingly processing the data information in the Excel by the financial payroll settlement system.
It should be added that in the method, data in Excel input by a user end is used as template data, and if data generation is performed by adopting other formats, the application and software testing method is uniformly considered in the protection scope of the scheme.
And step S12, determining and storing test information of the software test according to the incidence relation between the software to be tested and the Excel table.
According to the incidence relation between the software to be tested and the Excel table, all test data in the Excel required to be tested by the software to be tested are determined, the position information of the test data in the Excel, the length of the test data and the type of the test data are taken as the test information and stored in a memory, namely, numerical data, data dictionary data, text data and the like which may appear in the Excel are unified in a character set, so that the terminal is required to store all the test information (data position, data length and character set) which may appear in the memory of the terminal.
In the embodiment, when a software testing request is detected, an association relationship is established between the software to be tested and the Excel table according to the function of the software to be tested, and testing information of software testing is determined and stored according to the association relationship between the software to be tested and the Excel table; data information input by a user in Excel in the system operation process is used as test information, so that corresponding test data can be generated according to the test information for software test, the existing software test is performed by a tester through manual data input according to the data information processed by software, the test efficiency is low for software test of mass data input, and the efficiency of software test can be accelerated by using data possibly input by a user side as the test information to generate the test data for data test.
Referring to fig. 6, the data information includes a data location, a data type, and a data length in the present embodiment, and step S20 includes:
and step S21, taking the row and column coordinate values in the Excel table as data positions in the test information.
Specifically, in the data generation process, the data information input of a user terminal is directly simulated, the generated test data is input into the corresponding position in the Excel, as shown in table 1, the row and column values corresponding to the template data in the Excel are taken as the data position of the template data, and the position in the Excel during the software test is the position without the test data, the method utilizes the characteristic of supporting the running program language in the Excel to generate the test data in the Excel, namely, the data position of the test data in the Excel during the software test is firstly determined, and the software tool language: the locations in a particular excel can be found using the sheets (). select and cells () functions of the VBA language, upon which data is populated.
And step S22, determining the data length and the character set of the corresponding position according to the data position in the test information to generate test data.
Specifically, after the data position of the template data is determined, the data length and the data type of the corresponding position are further determined, namely, after the data position of the generated data in Excel is determined, the data length and the character set (character set: different data types, symbols, letters and the like) of the corresponding position are determined, and different program languages are set for different data positions to generate the test data.
In the embodiment, the row-column coordinate values in the Excel table are used as data positions in the test information, and the data length and the character set of the corresponding position are determined according to the data positions in the test information to generate test data; the test data corresponds to the row and column coordinate values in the Excel table and serves as the data positions of the test data, the data length and the characters of the corresponding positions are determined according to the data positions of the template data, the program language is set to generate the test data, the tedious work of manually inputting the test data is prevented, and the software test efficiency is improved by determining the test information and then presetting the program language to generate the test data.
Referring to fig. 7, step S22 in the present embodiment includes:
step S221, according to the data position in the test information, identifying the data length and the character set at the corresponding position.
Specifically, after the position of the test data is determined according to the position of the test data in Excel, the data length and the character set of the test data to be generated are identified.
Step S222, when a data generation instruction is detected, extracting characters in the character set and generating test data according to data length combination.
After determining the data position, the data length and the character set, setting a program language to randomly extract characters from the character set in test information prestored in a terminal, generating numerical values of various types in a certain range of the data position of template data aiming at numerical value type data, correspondingly filling the extracted data to corresponding positions, namely generating random numerical values according to round and format functions of VBA, maintaining a data dictionary in a sheet if filling data dictionary type data, reading values in the sheet through sequential circulation, filling data field type data into an Excel template, and combining to generate test data,
for example, in Excel form information filled by employees in the headquarter payroll settlement system, a bank card number to be filled in during software testing is determined, the position of the bank card number to be filled in is determined, the length of the bank card number is determined correspondingly, numbers are selected according to the length and combined to form the bank card number (all numbers and characters are stored in a memory in advance to form a character set, then data are extracted randomly by using a program language and combined to form test data), and similarly, other types of digital information are correspondingly generated if the other types of digital information are required to be filled in.
It should be noted that the data herein includes not only numbers, but also letters, or other types of character information.
In the embodiment, according to the data position in the test information, the data length and the character set at the corresponding position are identified; when a data generation instruction is detected, the characters in the character set are extracted, test data are generated according to the data length combination, and the character information combination is randomly extracted from the pre-stored test information character set to form the test data, so that the generation efficiency of the test data is accelerated.
With reference to fig. 6, step S20 in the data generating method of the present invention further includes:
and step S23, verifying the generated test data according to the software function of the software to be tested and preset verification conditions to judge whether the generated test data meets the test requirement.
Specifically, according to the software function of the software to be tested, the generated test data is verified under the preset verification condition to verify whether the generated test data meets the test requirement, that is, whether the generated data is subjected to randomness verification is simply verified, or the data verification condition is set for the data at a specific position, for example, whether the last bit of the generated bank card number meets the corresponding verification rule, that is, whether the generated test data meets different data verification rules such as randomness, uniqueness and the like.
And step S24, if the generated test data meets the test requirement, testing by using the generated test data software.
Specifically, software testing is performed on the generated test data by using preset verification conditions, if the generated test data meets the corresponding verification conditions, the test data is considered to meet the test requirements, test data generation of the next data position is performed, the generated data is used for performing software testing, and the software testing can be directly performed in Excel based on the supporting program language in the Excel.
Step S25, if the generated test data does not meet the test requirement, marking the test data that does not meet the test requirement, and generating new test data.
If the generated test data is verified, the test data does not meet randomness, the repetition rate is high or other verification conditions are not met, the generated test data is considered to be not in accordance with the test requirements, the test data which do not meet the test requirements are marked, and the data generation program of the corresponding position is operated again to generate new test data.
In this embodiment, according to the software function of the software to be tested, the generated test data is verified by presetting the verification condition to judge whether the generated test data meets the test requirement, different data verification conditions are preset for the generated data to verify the generated test data, so that the generated test data better meets the requirement of the software test, the accuracy of the software test is ensured, whether the generated test data meets the test requirement is judged, if the generated test data meets the test requirement, the generated test data is used for software test, if the generated test data does not meet the test requirement, the test data which does not meet the test requirement is marked, new test data is generated, so that the generated test data better meets the requirement of the software test, the accuracy of the software test is improved, the existing test data is mainly manually input by a tester, if the manual input of the test has errors, the query is difficult, and problems can also occur in the software system.
Referring to fig. 8, in another embodiment of the data generating method, after step S30, the method further includes:
and step S40, determining the software testing times according to the software testing requirements, and setting the generation times of the test data so as to perform multiple software tests.
Specifically, the generation times of data are set according to software testing requirements, a cycle statement is utilized, after one software test is finished, another data generation statement is set, a new round of test data is generated on an Excel template to cover the previous data, data verification is carried out on the newly generated test data, and multiple cycles of software testing are carried out.
And step S50, performing software test by using the generated test data, judging whether the test result obtained by the software test is correct, and stopping generating the test data if the test result obtained by the software test is correct.
Specifically, the software test is mainly performed around different factors such as the stability of the software, the generated test data is used for performing the software test, and whether the result of the software test is correct is judged, that is, when the software test is performed by using the generated test value, whether the result obtained by the test is the same as the value obtained by normal operation of the software or not is judged, if the result obtained by the software test for many times is correct, the generation of the software test data is stopped, the corresponding software test work is completed, otherwise, if the result obtained by the software test is incorrect, the test data are generated for many times, and the factor of software abnormality is searched.
In the embodiment, the data generation times are set according to the software test requirements, the test data are generated circularly by using the program language, and the generated test data are verified to perform the software test, so that a tester can be prevented from repeatedly inputting a large amount of data to realize the software test, and the software test efficiency is accelerated. The software test is carried out by utilizing the formed test data, whether the software test result is matched with the set value or not is judged, if the software test result is matched with the set value, the generation of the software test data is stopped, and the software test is completed; aiming at the large-scale accessory uploading function, the investment of testing labor is saved; the randomly generated data can more comprehensively cover the test scene, and the scene is not easy to be missed.
Further, the present invention also provides a data generation terminal, which includes the memory, the processor, and a data generation program stored on the memory and capable of running on the processor, and when the data generation program is executed by the processor, the data generation step of any one of the embodiments in the data generation method is implemented.
The method implemented when the data generating program is executed may refer to each embodiment of the data generating method of the present invention, and details are not described herein.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a data generation program is stored, and the data generation program, when executed by a processor, implements the steps of the data generation method.
The method implemented when the data generating program is executed may refer to each embodiment of the data generating method of the present invention, and details are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
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.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A data generation method is characterized in that the data generation method is applied to software testing, and the data generation method comprises the following steps:
when a software testing request is detected, establishing an association relationship between the software to be tested and an Excel table according to the function of the software to be tested;
determining and storing test information of the software test according to the incidence relation between the software to be tested and the Excel table;
taking the row-column coordinate value in the Excel table as a data position in the test information;
identifying the data length and the character set at the corresponding position according to the data position in the test information;
when a data generation instruction is detected, extracting characters in the character set, generating test data according to data length combination, and verifying whether the generated test data meets the test requirement;
and inputting the test data meeting the test requirements into an Excel table, and applying the Excel table to software test.
2. The data generation method of claim 1, wherein the step of verifying whether the generated test data meets test requirements comprises:
and verifying the generated test data according to the software function of the software to be tested and preset verification conditions so as to judge whether the generated test data meets the test requirement.
3. The data generating method of claim 2, wherein the step of determining whether the generated test data meets the test requirements comprises:
if the generated test data meets the test requirement, the generated test data is utilized to carry out software test;
if the generated test data do not accord with the test requirement, marking the test data which do not accord with the test requirement, and generating new test data.
4. The data generating method according to any one of claims 1 to 3, wherein the step of inputting test data meeting the test requirements into an Excel table and applying the test data to a software test comprises:
and determining the software testing times according to the software testing requirements, and setting the generation times of the testing data so as to perform multiple software tests.
5. The data generating method of claim 4, wherein the step of determining the number of software tests according to the software test requirements and setting the number of test data generation to perform a plurality of software tests is followed by:
and performing software test by using the generated test data, judging whether the test result obtained by the software test is correct, and stopping generating the test data if the test result obtained by the software test is correct.
6. A data generation terminal, characterized in that the data generation terminal comprises: memory, a processor and a data generating program stored on the memory and executable on the processor, the data generating program when executed by the processor implementing the steps of the data generating method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that a data generation program is stored thereon, which when executed by a processor implements the steps of the data generation method according to any one of claims 1 to 5.
CN201710327747.1A 2017-05-10 2017-05-10 Data generation method, terminal and computer readable storage medium Active CN107678935B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710327747.1A CN107678935B (en) 2017-05-10 2017-05-10 Data generation method, terminal and computer readable storage medium
PCT/CN2017/111900 WO2018205545A1 (en) 2017-05-10 2017-11-20 Data generation method, apparatus, terminal, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710327747.1A CN107678935B (en) 2017-05-10 2017-05-10 Data generation method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107678935A CN107678935A (en) 2018-02-09
CN107678935B true CN107678935B (en) 2020-07-14

Family

ID=61134204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710327747.1A Active CN107678935B (en) 2017-05-10 2017-05-10 Data generation method, terminal and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN107678935B (en)
WO (1) WO2018205545A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108563584A (en) * 2018-05-09 2018-09-21 平安普惠企业管理有限公司 Test data generating method, device, computer equipment and storage medium
CN110825610A (en) * 2018-08-14 2020-02-21 北京京东尚科信息技术有限公司 Method and device for providing test data
CN110134928A (en) * 2019-03-08 2019-08-16 北京车和家信息技术有限公司 Form processing method and electronic equipment based on signal creation Signal Builder
CN110188030A (en) * 2019-04-08 2019-08-30 平安科技(深圳)有限公司 A kind of test data generating method, device and computer equipment, storage medium
CN110119353B (en) * 2019-04-18 2023-10-10 上海蔚来汽车有限公司 Test data generation method and device, controller and medium
CN110502425A (en) * 2019-06-28 2019-11-26 平安银行股份有限公司 Test data generating method, device, electronic equipment and storage medium
CN110489332B (en) * 2019-07-19 2023-09-08 珠海金山数字网络科技有限公司 Method and system for filling test numerical value
CN110377526A (en) * 2019-07-31 2019-10-25 赛汇检测(广州)有限公司 A kind of test method of AI intelligence software
CN110457224B (en) * 2019-08-15 2023-08-18 中国银行股份有限公司 Method and device for generating test data
CN110908891A (en) * 2019-09-18 2020-03-24 泰康保险集团股份有限公司 Test data generation method and device, electronic equipment and storage medium
CN110968514A (en) * 2019-12-02 2020-04-07 北京明略软件系统有限公司 Test method, test device, electronic equipment and storage medium
CN111177005B (en) * 2019-12-31 2024-04-16 中国银行股份有限公司 Service application testing method, device, server and storage medium
CN111679979B (en) * 2020-06-03 2023-09-19 中国银行股份有限公司 Destructive testing method and device
CN112199302A (en) * 2020-12-07 2021-01-08 望海康信(北京)科技股份公司 Test data generation method and system, corresponding equipment and storage medium
CN113094290B (en) * 2021-05-21 2024-02-23 珠海金山数字网络科技有限公司 Program testing system and method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622294A (en) * 2011-01-28 2012-08-01 国际商业机器公司 Method and method for generating test cases for different test types
CN104516814A (en) * 2013-09-29 2015-04-15 腾讯科技(深圳)有限公司 Automatic test method and device of terminal software

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008197897A (en) * 2007-02-13 2008-08-28 Hitachi Consulting Co Ltd Test pattern generation apparatus and generation method
CN102760096B (en) * 2011-04-27 2016-03-30 阿里巴巴集团控股有限公司 The generation method of test data, unit test method and unit test system
US9396094B2 (en) * 2011-07-21 2016-07-19 International Business Machines Corporation Software test automation systems and methods
CN104615667B (en) * 2015-01-13 2018-01-19 联动优势电子商务有限公司 A kind of basic data generation method, test data creation method and its device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622294A (en) * 2011-01-28 2012-08-01 国际商业机器公司 Method and method for generating test cases for different test types
CN104516814A (en) * 2013-09-29 2015-04-15 腾讯科技(深圳)有限公司 Automatic test method and device of terminal software

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
请教对输入的身份证号校验的代码;I沙漠中的绿洲f;《ExcelHome:http://club.excelhome.net/forum.php?mod=viewthread&tid=1326040》;20170131;第1-4页 *

Also Published As

Publication number Publication date
CN107678935A (en) 2018-02-09
WO2018205545A1 (en) 2018-11-15

Similar Documents

Publication Publication Date Title
CN107678935B (en) Data generation method, terminal and computer readable storage medium
CN103518393B (en) The system and method for detecting mobile communication equipment content
CN107783898B (en) Test method and test equipment for mobile application
CN111078539B (en) Test method, device, system and computer readable storage medium
CN107545181A (en) Program operating method, terminal and computer-readable recording medium
CN111611797B (en) Method, device and equipment for marking prediction data based on Albert model
JP6525043B2 (en) DATA GENERATION DEVICE, DATA GENERATION METHOD, AND PROGRAM
CN116245074A (en) Chip verification method, device and storage medium
CN104156305A (en) Application program testing method and device
CN115576828A (en) Test case generation method, device, equipment and storage medium
CN109840212B (en) Function test method, device and equipment of application program and readable storage medium
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN112036843A (en) Flow element positioning method, device, equipment and medium based on RPA and AI
CN110717315A (en) System data batch modification method and device, storage medium and electronic equipment
CN111046669A (en) Interest point matching method and device and computer system
CN111179907A (en) Voice recognition test method, device, equipment and computer readable storage medium
CN106599312B (en) Knowledge base inspection method and device and terminal
CN115062571A (en) Dynamic selection method, system, equipment and computer readable storage medium for data area of integrated circuit device
CN110704252A (en) Automatic testing device and testing method based on cloud dynamic management
US9824175B1 (en) Method and system of evaluation of validity of a refinement rule for a hardware emulation
CN106294433B (en) Equipment information processing method and device
CN110457705B (en) Method, device, equipment and storage medium for processing point of interest data
CN112966671A (en) Contract detection method and device, electronic equipment and storage medium
CN107766228A (en) It is a kind of based on multilingual automated testing method and device
Chu et al. Automated GUI testing for android news applications

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
GR01 Patent grant
GR01 Patent grant