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

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

Info

Publication number
WO2018205545A1
WO2018205545A1 PCT/CN2017/111900 CN2017111900W WO2018205545A1 WO 2018205545 A1 WO2018205545 A1 WO 2018205545A1 CN 2017111900 W CN2017111900 W CN 2017111900W WO 2018205545 A1 WO2018205545 A1 WO 2018205545A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
data
software
generated
tested
Prior art date
Application number
PCT/CN2017/111900
Other languages
French (fr)
Chinese (zh)
Inventor
王梦霞
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2018205545A1 publication Critical patent/WO2018205545A1/en

Links

Classifications

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

Definitions

  • the present invention relates to the field of software testing, and in particular, to a data generation method, apparatus, terminal, and computer readable storage medium.
  • Servers in the center of the topology structure connect to other node subsystems to receive and analyze data. Multiple subsystems may upload data according to the set template. To the server, the server receives the data sent by the subsystem through the setting template, and verifies the data in the template and then inputs the corresponding location, and finally realizes the processing and analysis of the data.
  • the main object of the present invention is to provide a data generation method, apparatus, terminal and computer readable storage medium, which aim to improve test efficiency by automatically generating test data and inputting test data into a corresponding test position test.
  • the present invention provides a data generation method, and a data generation method is applied to a software test, including the following steps:
  • the test information of the software to be tested is determined according to the function of the software to be tested and stored;
  • Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
  • determining the test information of the software to be tested according to the function of the software to be tested and storing the steps includes:
  • the software to be tested is associated with the Excel table according to the function of the software to be tested;
  • the test information of the software test is determined and stored.
  • test information includes a data location and a data length, a character set, and the step of generating test data according to the test information includes:
  • the row and column coordinate values in the Excel table are used as the data locations in the test information
  • the data length and character set of the corresponding location are determined to generate test data.
  • the step of determining the data length and the character set of the corresponding location according to the data location in the test information to generate the test data includes:
  • the steps of verifying that the generated test data meets the test requirements include:
  • the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
  • the step of determining whether the generated test data meets the test requirements includes:
  • the generated test data software is used to test
  • test data does not meet the test requirements, mark the test data that does not meet the test requirements and generate new test data.
  • inputting test data that meets the test requirements into an Excel spreadsheet and applying the steps for the software test includes:
  • the number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
  • determining the number of software tests according to the software testing requirements, and setting the number of times the test data is generated, after performing the multiple software testing steps includes:
  • the generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
  • the present invention also provides a data generating apparatus, where the data generating apparatus includes:
  • a detection determining module configured to determine, according to a function of the software to be tested, test information of the software to be tested and store the software test request;
  • a data input module for inputting test data that meets the test requirements into an Excel spreadsheet and for use in software testing.
  • the present invention further provides a data generating terminal, the data generating terminal comprising: a memory, a processor, and a data generating program stored on the memory and operable on the processor, the data generating program
  • the steps of the data generation method described above are implemented when executed by the processor.
  • the present invention also provides a computer readable storage medium having a data generation program stored thereon, the data generation program being executed by a processor to implement the steps of the data generation method described above.
  • the present invention provides a data generation method.
  • the data generation method is applied to a software test.
  • the test information of the software to be tested is determined according to the function of the software to be tested and stored, and test data is generated according to the test information, and Verify that the generated test data meets the test requirements, input the test data that meets the test requirements into an Excel spreadsheet, and apply it to the software test; specifically, the data information that needs to be uploaded to the server by the client is stored in the software running process.
  • the attachment of the Excel format when testing the software on the server, using the features of the supported program language running on Excel, the programming language is developed in Excel, the data input of the client is simulated, the software tester, and the server needs to be processed.
  • the data is sorted, and all the data position information, data length, character set, and character set that the user may input are obtained as test information, and the program language is randomly generated to generate corresponding test data for software testing, thereby avoiding the software tester manually inputting data and improving the speed of data input. Further improve the efficiency of software testing.
  • FIG. 1 is a schematic structural diagram of a terminal in a hardware operating environment according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a scenario of various embodiments of a data generating method of the present invention.
  • FIG. 3 is a schematic diagram of a scenario of a data generating method of the present invention in a software testing process
  • FIG. 4 is a schematic flowchart of an embodiment of a data generating method according to the present invention.
  • FIG. 5 is a schematic flowchart of the refinement of step S10 of the data generating method in FIG. 4;
  • FIG. 6 is a schematic flowchart of the refinement of step S20 of the data generating method in FIG. 4;
  • FIG. 7 is a schematic flowchart of the refinement of step S22 of the data generating method in FIG. 6;
  • FIG. 8 is a schematic flowchart diagram of another embodiment of a data generating method according to the present invention.
  • FIG. 9 is a schematic diagram of functional modules of an embodiment of a data generating apparatus according to the present invention.
  • FIG. 1 is a schematic structural diagram of a terminal in 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 (also called a terminal), and the terminal of the embodiment may be a PC, or a portable terminal device having a display function, such as a tablet computer or a portable computer, which needs supplementary explanation. It is the terminal and server mentioned in the present invention that can be replaced.
  • the terminal may include a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement connection communication between these components.
  • the user interface 1003 may include a display, an input unit such as a keyboard.
  • the terminal (server) communicates with the user end during the running of the software, and the tester can use the software during the test.
  • the user interface performs input of data information, and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
  • the memory 1005 can also optionally be a storage device independent of the aforementioned processor 1001.
  • the terminal may further include a camera, RF (Radio) Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more.
  • sensors such as light sensors, motion sensors, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display according to the brightness of the ambient light, and the proximity sensor may turn off the display and/or when the mobile terminal moves to the ear. Backlighting.
  • the gravity acceleration sensor can detect the magnitude of acceleration in each direction (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. No longer.
  • terminal structure shown in FIG. 1 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements.
  • the main solution of the embodiment of the present invention is: developing a programming language in Excel according to data processed by the server, simulating generating test data, applying and software testing, specifically, in conjunction with FIG. 3, the user input processed in the software running process is in Excel.
  • the data in the table, the present invention simulates the data input by the client, generates data in Excel using the programming language, and applies the generated data to the software test. It is necessary to additionally explain that the solution software (system) processing described in the present invention
  • the digital information is in Excel. Therefore, based on the characteristics of Excel that can directly run the program, the data generation statement is set in Excel by using VB (or other programming language that can be run on Excel) in Excel. For Excel, if simple replacement is performed on the basis of the present invention, that is, generating other text information, or simply switching other document modes in Excel, it should be considered within the scope of the present invention.
  • the present invention provides a solution for generating test data in the form of data processing using a programming language.
  • the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server;
  • the user interface 1003 is mainly used to connect the client (user end), and perform data communication with the client;
  • the processor 1001 can be used to invoke a software test stored in memory 1005 and perform the following operations:
  • the test information of the software to be tested is determined according to the function of the software to be tested and stored;
  • Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • the step of determining the test information of the software to be tested according to the function of the software to be tested and storing the steps includes:
  • the software to be tested is associated with the Excel table according to the function of the software to be tested;
  • the test information of the software test is determined and stored.
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • the test information includes a data location and a data length, a character set, and the step of generating test data according to the test information includes:
  • the row and column coordinate values in the Excel table are used as the data locations in the test information
  • the data length and character set of the corresponding location are determined to generate test data.
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • the steps of determining the data length and character set of the corresponding location to generate test data include:
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • the steps to verify that the generated test data meets the test requirements include:
  • the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • the steps to determine whether the generated test data meets the test requirements include:
  • the generated test data software is used to test
  • test data does not meet the test requirements, mark the test data that does not meet the test requirements and generate new test data.
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • Entering test data that meets the test requirements into an Excel spreadsheet and applying the software test steps includes:
  • the number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
  • processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
  • the number of software tests is determined according to the software testing requirements, and the number of times the test data is generated is set to perform multiple software testing steps including:
  • the generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
  • an embodiment of the data generating method of the present invention provides a data generating method including the following steps:
  • Step S10 when the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored.
  • the software When testing software on the server (the software here can be understood as software or data processing system), the information of the data processed by the software runtime is used as test information and stored in the memory to determine the software testing process according to the test information. Simulate the generated test data.
  • the software on the server is a financial salary settlement system
  • the financial salary settlement system is used to pay wages to employees of other branches
  • the branch office serves as the basic information for uploading employees of the company (employee name, job number) , gender, etc.
  • the basic information of wages (salary amount, bank card number, deductible amount, etc.) and salary distribution data
  • the test personnel need to input the salary amount, bank card number Data, but there is no real salary settlement data for software testing during the software testing process.
  • the existing technology mainly relies on the manual input of the tester.
  • the present invention firstly organizes the data related information processed by the system as System test test information
  • the salary settlement system test information the salary amount, the bank card number, the deduction amount and other information related to the salary calculation), and the test data is generated according to the stored test information, and the relevant test data is simulated to calculate the salary, thereby realizing the financial salary settlement system. Test.
  • Step S20 generating test data according to the test information, and verifying whether the generated test data meets the test requirement.
  • test data that is, the type of data that may appear is saved in the memory of the server, the programming language is developed in Excel, and the corresponding characters are combined into a test.
  • the data is tested for data.
  • Table 1 the numbers, other letters, and symbol information appearing in the bank card number are stored in the memory as test information:
  • Table 1 shown as an Excel template, can intuitively understand the salary calculation data as software test data
  • using the programming language first determine the location of the digital information in the Excel table: the first few rows, the first few columns Further, the program function is used to generate the test data, and the generated test data is verified according to the verification condition, and it is judged whether the generated data meets the test requirement (verification condition: the verification condition according to the specific situation of the generated data, and the data can be Generate probabilistic verification randomness, or whether it conforms to a specific data boundary, the end of the verification rules, etc., to verify the generated test data, to meet the test requirements to meet the test requirements).
  • verification condition the verification condition according to the specific situation of the generated data, and the data can be Generate probabilistic verification randomness, or whether it conforms to a specific data boundary, the end of the verification rules, etc., to verify the generated test data, to meet the test requirements to meet the test requirements.
  • step S30 the test data meeting the test requirements is input into an Excel spreadsheet and used for software testing.
  • the server inputs the verified test data conforming to the test requirements into an Excel spreadsheet, and performs software testing using the test data generated by the programming language in the Excel table.
  • the test information of the software to be tested is determined according to the function of the software to be tested and stored, the test data is generated according to the test information, and the generated test data is verified to meet the test requirements, and the The test data of the test requirement is input into the Excel spreadsheet and used for software testing; the data information processed by the client to the server is stored in an attachment in Excel format, and the software in the support language of Excel is used when testing the software on the server.
  • the characteristics of the operation develop the programming language in Excel, simulate the data input of the client, specifically, sort the data that the server needs to process, obtain all the data information that the user may input as the test information, and set the programming language to randomly generate the corresponding test data.
  • Software testing is performed to prevent software testers from manually inputting data, which increases the speed of data input and further improves the efficiency of software testing.
  • step S10 includes:
  • step S11 when the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested.
  • the server software test first determine the data processed during the software running process, input all the data processed in the software running process into the Excel format as the software test information, and associate the software to be tested with the Excel table, for example, the headquarters
  • the financial salary settlement system when the salary is paid, enter the salary distribution related data in the template of the employee salary list Excel table shown in Table 1, and then upload the data in Excel as the attachment information to the financial salary settlement system of the headquarters.
  • the relationship between the financial salary settlement system and the Excel spreadsheet is established, and the financial salary settlement system processes the data information in Excel.
  • the data in the Excel input by the user terminal is used as the template data. If other formats are used for data generation, the application and software testing methods are evenly considered within the scope of protection of the solution.
  • Step S12 Determine test information of the software test according to the relationship between the software to be tested and the Excel table, and store the test information.
  • the software to be tested needs to test all the test data in Excel, and wants to test the position information of the data in Excel, the length of the test data, the type of the test data as test information, and stored in
  • the memory that is, in Excel, numeric data, data dictionary data, text data, and the like may be unified in the character set, so the terminal needs to store all possible test information (data position and data length, character set) in the memory.
  • test information data position and data length, character set
  • the software to be tested is associated with the Excel table according to the function of the software to be tested, and the test information of the software test is determined and stored according to the relationship between the software to be tested and the Excel table;
  • the user inputs the data information in Excel as test information, so as to generate corresponding test data according to the test information for software testing.
  • the existing software test is data input processed by the tester according to the software, and manual manual data input.
  • Software testing such a method for software testing of a large number of data input, will lead to low test efficiency, the data that the user may input as test information, generate test data for data testing can speed up the efficiency of software testing.
  • the embodiment is further provided on the basis of the first embodiment.
  • the data information includes a data location, a data type, and a data length
  • step S20 includes:
  • step S21 the row and column coordinate values in the Excel table are used as the data locations in the test information.
  • the present invention directly simulates data input of the user end, and inputs the generated test data into a corresponding position in Excel, as shown in Table 1, and uses the corresponding row and column values of the template data in Excel as a template.
  • the data location of the data, in the software test, the location in Excel is no test data, this method uses the features of Excel to support the running program language, generate test data in Excel, that is, first determine the test data in the software test in Excel Data location, software tool language: You can use the VBA language sheets().select and cells() functions to find the location in the specific excel, and populate the data on this basis.
  • Step S22 Determine a data length and a character set of the corresponding location according to the data location in the test information to generate test data.
  • the data length and the data type of the corresponding location are further determined, that is, after determining the data location of the generated data in Excel, determining the data length and character set (character set) of the corresponding location : Different data types, symbols, letters, etc., set different program languages for different data locations to generate test data.
  • the row and column coordinate values in the Excel table are used as the data position in the test information, and the data length and character set of the corresponding position are determined according to the data position in the test information to generate test data; the test data is in Excel.
  • the corresponding row and column coordinate values in the table as the data position of the test data, determine the data length and characters of the corresponding position according to the data position of the template data, and set the programming language to generate test data to prevent the cumbersome work of manually inputting the test data, and determine the test by determining the test.
  • Information, and then preset programming language to generate test data speeds up software testing efficiency.
  • step S22 includes:
  • Step S221 identifying the data length and the character set at the corresponding location according to the data location in the test information.
  • the data length and character set of the test data that should be generated are identified.
  • Step S222 when the data generation instruction is detected, the characters in the character set are extracted and the test data is generated according to the data length combination.
  • the programming language randomly extracts characters from the character set stored in the test information pre-stored in the terminal, and generates numerical values of various types within a certain range of the data position of the template data for the numerical data. And correspondingly filling the extracted data to the corresponding position, that is, the random value can be generated according to the round and format functions of the VBA, and if the data dictionary class data is filled, the data dictionary is maintained in a sheet, and the sheet is read in a sequential cycle.
  • the value of the data field class data is filled into the Excel template, combined to generate test data,
  • the bank card number to be filled in during the software test first determine the location where the bank card number needs to be filled, and then determine the length of the bank card number, and then select the number corresponding to the length, and combine
  • the bank card number is formed (all numbers and characters are pre-stored in the memory to form a character set, and then the data is randomly extracted by the programming language to form test data), and the same type of digital information is required to be generated correspondingly.
  • the data length and the character set at the corresponding location are identified; when the data generation instruction is detected, the characters in the character set are extracted and the test data is generated according to the data length combination, from the pre-stored
  • the test information character set randomly extracts the character information combination to form test data, which accelerates the generation efficiency of the test data.
  • step S20 in the data generating method of the present invention further includes:
  • step S23 according to the software function of the software to be tested, the generated verification data is verified by the preset verification condition to determine whether the generated test data meets the test requirement.
  • the preset verification condition verifies the generated test data to verify whether the generated test data is a test requirement, that is, simply verifying randomness verification for the generated data, or
  • the data setting condition of the location data verification condition for example, whether the generated bank card number corresponds to the corresponding verification rule, that is, whether the generated test data conforms to different data verification rules such as randomness and uniqueness.
  • step S24 if the generated test data meets the test requirements, the generated test data software is used for testing.
  • the generated test data is tested by using the preset verification condition. If the generated test data satisfies the corresponding verification condition, the test data is considered to meet the test requirement, the test data of the next data location is generated, and the generated data is utilized.
  • Software testing based on the support of the programming language in Excel, you can directly test the software in Excel.
  • step S25 if the generated test data does not meet the test requirements, the test data that does not meet the test requirements is marked, and new test data is generated.
  • test data If the test data is verified, the test data does not satisfy the randomness, the repetition rate is high, or other verification conditions are not met. It is considered that the generated test data does not meet the test requirements, and the test data that does not meet the test requirements is marked and again. Run the data generator of the corresponding location to generate new test data.
  • the verification condition is used to verify the generated test data to determine whether the generated test data meets the test requirement, and different data verification conditions are preset for the generated data to generate
  • the test data is verified to make the generated test data more in line with the requirements of the software test, so that the accuracy of the software test is guaranteed, and whether the generated test data meets the test requirements, and if the generated test data meets the test requirements, the generated test data is utilized.
  • Test data software test if the generated test data does not meet the test requirements, mark the test data that does not meet the test requirements, and generate new test data, so that the generated test data is more in line with the requirements of the software test, and the accuracy of the software test is improved.
  • sexuality the existing test data mainly depends on the manual input by the tester. If the manual input of the test has errors, the query is difficult, and the software system may also have problems.
  • step S30 in another embodiment of the data generating method the method further includes:
  • step S40 the number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
  • step S50 the generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
  • the software test is mainly carried out around different factors such as the stability of the softness, using the generated test data for software testing, and judging whether the result of the software test is correct, that is, when using the generated test value for software testing, The result of the test is the same as the value of the software running normally. If the software test result is correct multiple times, stop generating the software test data and complete the corresponding software test work. Otherwise, if the test result obtained by the software test is incorrect, then Generate test data multiple times and look for software anomalies.
  • the data generation times are set according to the software testing requirements, and the test data is generated by using the programming language to cycle and verify the generated test data for software testing, which can prevent the tester from repeating a large amount of data input to implement the software test, and speed up the software test. effectiveness.
  • the test data to perform software testing determine whether the software test result matches the set value. If the software test result matches the set value, stop generating the software test data and complete the software test. In this embodiment, the test data is stopped.
  • the generated conditions using the generated test data to quickly perform software testing, slow down the tedious manual test; save the investment of test manpower for large-scale attachment upload function; the randomly generated data can cover the test scenario more comprehensively. It is not easy to miss the scene.
  • the present invention further provides a data generating apparatus, where the data generating apparatus includes:
  • the detection determining module 10 is configured to determine, according to a function of the software to be tested, test information of the software to be tested and store the software test request;
  • the data input module 30 is configured to input test data meeting the test requirements into an Excel spreadsheet and apply the software test.
  • the data generating device can refer to various embodiments of the data generating method of the present invention, and details are not described herein again.
  • an embodiment of the present invention further provides a computer readable storage medium having a data generation program stored thereon, and the data generation program is implemented by a processor to implement steps such as a data generation method.
  • portions of the technical solution of the present invention that contribute substantially or to the prior art may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a terminal device which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.

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

Disclosed is a method for generating data, used for software testing; the method for generating data comprises the following steps: when a software testing request is detected, determining test information of a to-be-tested software according to the function of the to-be-tested software, and storing said information; generating test data according to the test information, and verifying whether the generated test data satisfies test requirements; inputting to an Excel table the test data that satisfies test requirements, and using same for software testing. Also correspondingly disclosed are a data generation apparatus and terminal and a computer-readable medium. In the present invention, Excel is combined with a program language, and the program, according to data information in template data, simulates the generation of software test data; it is unnecessary for test personnel to manually perform input according to a preset format, improving the efficiency of software testing.

Description

数据生成方法、装置、终端及计算机可读存储介质  Data generation method, device, terminal and computer readable storage medium
本申请要求于2017年5月10日提交中国专利局、申请号为201710327747.1、发明名称为“数据生成方法、终端及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。The present application claims priority to Chinese Patent Application No. 201010327747.1, entitled "Data Generation Method, Terminal and Computer Readable Storage Media", filed on May 10, 2017, the entire contents of which are incorporated by reference. In the application.
技术领域Technical field
本发明涉及软件测试领域,尤其涉及数据生成方法、装置、终端及计算机可读存储介质。The present invention relates to the field of software testing, and in particular, to a data generation method, apparatus, terminal, and computer readable storage medium.
背景技术Background technique
现有的公司或事业单位的局域网中设有不同网络拓扑结构,处于拓扑结构中心的服务器连接其他节点子系统,进行数据的接收和分析处理,可能出现多个子系统将数据按照设定的模板上传至服务器,服务器接收子系统通过设定模板发送的数据,并将模板的中的数据进行验证后输入对应位置,最终实现数据的处理分析。Existing companies or institutions have different network topologies in the local area network. Servers in the center of the topology structure connect to other node subsystems to receive and analyze data. Multiple subsystems may upload data according to the set template. To the server, the server receives the data sent by the subsystem through the setting template, and verifies the data in the template and then inputs the corresponding location, and finally realizes the processing and analysis of the data.
然而在系统开发前期、运营中期、维护后期并没有真实的数据通过对于模板,以附件的形式上传至服务器,因而需要测试人员手动输入大量的数据进行测试,在人工输入数据进行系统测试,人工的数据输入工作量大、繁琐、枯燥,还可能会出现数据输入格式错误,输入遗漏等问题,在后期的检查中难以发现,而导致系统测试出现问题。However, in the early stage of system development, mid-operation, and post-maintenance, no real data is uploaded to the server in the form of attachments for templates. Therefore, testers need to manually input a large amount of data for testing, and manually input data for system testing, manual The data input workload is large, cumbersome, and boring. It may also cause data input format errors, input omissions, etc., which are difficult to find in later inspections, and cause system testing problems.
上述内容仅用于辅助理解本发明的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist in understanding the technical solutions of the present invention, and does not constitute an admission that the above is prior art.
发明内容Summary of the invention
本发明的主要目的在于提供一种数据生成方法、装置、终端及计算机可读存储介质,旨在通过自动生成测试数据,并将测试数据输入对应测试位置测试,减少人工操作提高测试效率。The main object of the present invention is to provide a data generation method, apparatus, terminal and computer readable storage medium, which aim to improve test efficiency by automatically generating test data and inputting test data into a corresponding test position test.
为实现上述目的,本发明提供数据生成方法,数据生成的方法应用于软件测试,包括以下步骤:To achieve the above object, the present invention provides a data generation method, and a data generation method is applied to a software test, including the following steps:
当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;When the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored;
根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generate test data based on the test information and verify that the generated test data meets the test requirements;
将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
可选地,当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储的步骤包括:Optionally, when the software test request is detected, determining the test information of the software to be tested according to the function of the software to be tested and storing the steps includes:
当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系;When the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested;
根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储。According to the relationship between the software to be tested and the Excel table, the test information of the software test is determined and stored.
可选地,测试信息包括数据位置和数据长度、字符集合,所述根据测试信息生成测试数据的步骤包括:Optionally, the test information includes a data location and a data length, a character set, and the step of generating test data according to the test information includes:
将Excel表格中的行列坐标数值,作为测试信息中的数据位置;The row and column coordinate values in the Excel table are used as the data locations in the test information;
根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据。Based on the data location in the test information, the data length and character set of the corresponding location are determined to generate test data.
可选地,根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据的步骤包括:Optionally, the step of determining the data length and the character set of the corresponding location according to the data location in the test information to generate the test data includes:
根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合;Identifying the data length and character set at the corresponding location according to the data location in the test information;
当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据。When a data generation instruction is detected, characters in the character set are extracted and test data is generated based on the data length combination.
可选地,验证生成的测试数据是否符合测试需求的步骤包括:Optionally, the steps of verifying that the generated test data meets the test requirements include:
根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求。According to the software function of the software to be tested, the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
可选地,判断生成的测试数据是否符合测试需求的步骤包括:Optionally, the step of determining whether the generated test data meets the test requirements includes:
若生成的测试数据符合测试需求,则利用生成的测试数据软件测试;If the generated test data meets the test requirements, the generated test data software is used to test;
若生成的测试数据不符合测试需求,则标记不符合测试需求的测试数据,并生成新的测试数据。If the generated test data does not meet the test requirements, mark the test data that does not meet the test requirements and generate new test data.
可选地,将符合测试需求的测试数据输入Excel表格中,并运用于软件测试的步骤之后包括:Optionally, inputting test data that meets the test requirements into an Excel spreadsheet and applying the steps for the software test includes:
根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试。The number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
可选地,根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试的步骤之后包括:Optionally, determining the number of software tests according to the software testing requirements, and setting the number of times the test data is generated, after performing the multiple software testing steps, includes:
利用生成的测试数据进行软件测试,判断软件测试得到的测试结果是否正确,若软件测试得到的测试结果正确,则停止生成测试数据。The generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
为实现上述目的,本发明还提供一种数据生成装置,所述数据生成装置包括:In order to achieve the above object, the present invention also provides a data generating apparatus, where the data generating apparatus includes:
检测确定模块,用于当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;a detection determining module, configured to determine, according to a function of the software to be tested, test information of the software to be tested and store the software test request;
生成验证模块,用于根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generating a verification module for generating test data based on the test information and verifying whether the generated test data meets the test requirements;
数据输入模块,用于将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。A data input module for inputting test data that meets the test requirements into an Excel spreadsheet and for use in software testing.
为实现上述目的,本发明还提供一种数据生成终端,数据生成终端包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的数据生成程序,所述数据生成程序被所述处理器执行时实现上述的数据生成方法的步骤。To achieve the above object, the present invention further provides a data generating terminal, the data generating terminal comprising: a memory, a processor, and a data generating program stored on the memory and operable on the processor, the data generating program The steps of the data generation method described above are implemented when executed by the processor.
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,计算机可读存储介质上存储有数据生成程序,所述数据生成程序被处理器执行时实现上述的数据生成方法的步骤。Furthermore, in order to achieve the above object, the present invention also provides a computer readable storage medium having a data generation program stored thereon, the data generation program being executed by a processor to implement the steps of the data generation method described above.
本发明提供一种数据生成方法,数据生成的方法应用于软件测试,当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储,根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求,将符合测试需求的测试数据输入Excel表格中,并运用于软件测试;具体地,在软件运行过程中时需要将用户端上传至服务器处理的数据信息存储在Excel格式的附件中,因此在对服务器上的软件进行测试时,利用Excel上支持程序语言运行的特点,在Excel上开发出程序语言,模拟用户端的数据输入,软件测试人员,将服务器需要处理的数据进行整理,得到用户可能输入的所有数据位置信息、数据长度,字符集合作为测试信息,设置程序语言随机生成对应测试数据进行软件测试,避免了软件测试人员手工输入数据,提高了数据输入的速度,进一步地提高了软件测试效率。The present invention provides a data generation method. The data generation method is applied to a software test. When a software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored, and test data is generated according to the test information, and Verify that the generated test data meets the test requirements, input the test data that meets the test requirements into an Excel spreadsheet, and apply it to the software test; specifically, the data information that needs to be uploaded to the server by the client is stored in the software running process. In the attachment of the Excel format, when testing the software on the server, using the features of the supported program language running on Excel, the programming language is developed in Excel, the data input of the client is simulated, the software tester, and the server needs to be processed. The data is sorted, and all the data position information, data length, character set, and character set that the user may input are obtained as test information, and the program language is randomly generated to generate corresponding test data for software testing, thereby avoiding the software tester manually inputting data and improving the speed of data input. Further improve the efficiency of software testing.
附图说明DRAWINGS
图1是本发明实施例方案涉及的硬件运行环境的终端结构示意图;1 is a schematic structural diagram of a terminal in a hardware operating environment according to an embodiment of the present invention;
图2是本发明数据生成方法的各个实施例的场景示意;2 is a schematic diagram of a scenario of various embodiments of a data generating method of the present invention;
图3是本发明数据生成方法在软件测试过程中的场景示意图;3 is a schematic diagram of a scenario of a data generating method of the present invention in a software testing process;
图4为本发明数据生成方法一实施例的流程示意图;4 is a schematic flowchart of an embodiment of a data generating method according to the present invention;
图5为图4中数据生成方法的步骤S10的细化流程示意图;FIG. 5 is a schematic flowchart of the refinement of step S10 of the data generating method in FIG. 4;
图6为图4中数据生成方法的步骤S20的细化流程示意图;6 is a schematic flowchart of the refinement of step S20 of the data generating method in FIG. 4;
图7为图6中数据生成方法的步骤S22的细化流程示意图;FIG. 7 is a schematic flowchart of the refinement of step S22 of the data generating method in FIG. 6;
图8为本发明数据生成方法另一实施例的流程示意图;FIG. 8 is a schematic flowchart diagram of another embodiment of a data generating method according to the present invention; FIG.
图9为本发明数据生成装置一实施例的功能模块示意图。FIG. 9 is a schematic diagram of functional modules of an embodiment of a data generating apparatus according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
如图1所示,图1是本发明实施例方案涉及的硬件运行环境的终端结构示意图。As shown in FIG. 1, FIG. 1 is a schematic structural diagram of a terminal in a hardware operating environment according to an embodiment of the present invention.
本发明数据生成方法中的对应程序由数据生成终端(又叫终端)实现,实施例终端可以是PC,也可以是平板电脑、便携计算机等具有显示功能的可移动式终端设备,需要补充说明的是本发明中提到的终端和服务器可以进行替换。The corresponding program in the data generating method of the present invention is implemented by a data generating terminal (also called a terminal), and the terminal of the embodiment may be a PC, or a portable terminal device having a display function, such as a tablet computer or a portable computer, which needs supplementary explanation. It is the terminal and server mentioned in the present invention that can be replaced.
如图1所示,该终端可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),在本发明中终端(服务器)在软件运行的过程中与用户端进行通信连接,在软件测试的过程中测试人员可利用用户接口进行数据信息的输入,可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。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, and a communication bus 1002. Among them, the communication bus 1002 is used to implement connection communication between these components. The user interface 1003 may include a display, an input unit such as a keyboard. In the present invention, the terminal (server) communicates with the user end during the running of the software, and the tester can use the software during the test. The user interface performs input of data information, and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage. The memory 1005 can also optionally be a storage device independent of the aforementioned processor 1001.
可选地,终端还可以包括摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。其中,传感器比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示屏的亮度,接近传感器可在移动终端移动到耳边时,关闭显示屏和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;当然,移动终端还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。Optionally, the terminal may further include a camera, RF (Radio) Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more. Among them, sensors such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display according to the brightness of the ambient light, and the proximity sensor may turn off the display and/or when the mobile terminal moves to the ear. Backlighting. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. No longer.
本领域技术人员可以理解,图1中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It will be understood by those skilled in the art that the terminal structure shown in FIG. 1 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements.
本发明实施例的主要解决方案是:在Excel上开发程序语言根据服务器处理的数据,模拟生成测试数据,应用与软件测试,具体地,结合图3,软件运行过程中处理的用户端输入在Excel表格中的数据,本发明模拟用户端输入的数据,采用程序语言在Excel中生成数据,并将生成的数据应用于软件测试,需要补充说明的是,本发明中描述的方案软件(系统)处理的数字信息在Excel中,因此,基于Excel可直接运行程序的特点,在Excel中利用VB(或者python等其他可以在Excel上运行的程序语言)设置数据生成语句,本发明中用户端上传的附件为Excel,若在本发明的基础上进行简单的替换,即,生成其他文字信息,或者在Excel上简单的进行其他文档模式的切换,均应算在本发明保护的范围内。The main solution of the embodiment of the present invention is: developing a programming language in Excel according to data processed by the server, simulating generating test data, applying and software testing, specifically, in conjunction with FIG. 3, the user input processed in the software running process is in Excel. The data in the table, the present invention simulates the data input by the client, generates data in Excel using the programming language, and applies the generated data to the software test. It is necessary to additionally explain that the solution software (system) processing described in the present invention The digital information is in Excel. Therefore, based on the characteristics of Excel that can directly run the program, the data generation statement is set in Excel by using VB (or other programming language that can be run on Excel) in Excel. For Excel, if simple replacement is performed on the basis of the present invention, that is, generating other text information, or simply switching other document modes in Excel, it should be considered within the scope of the present invention.
由于现有技术并没有针对软件测试中人工输入测试数据有改进的方案,现有的软件测试,不管数据的类型都是由人工进行数据输入,因而测试的次数较少,测试精度较低,同时软件的测试效率较低。Since the prior art does not have an improved scheme for manually inputting test data in software testing, existing software tests, regardless of the type of data, are manually input data, so the number of tests is small, the test accuracy is low, and at the same time Software testing is less efficient.
本发明提供一种解决方案,使用程序语言,按照数据处理的形式生成测试数据。The present invention provides a solution for generating test data in the form of data processing using a programming language.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及数据生成应用程序,数据生成应用程序进行数据生成得到的数据用于软件测试。As shown in FIG. 1, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a data generation application, and the data generated by the data generation application for data generation is used for software testing.
在图1所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的软件测试,并执行以下操作:In the terminal shown in FIG. 1, the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect the client (user end), and perform data communication with the client; and the processor 1001 can be used to invoke a software test stored in memory 1005 and perform the following operations:
当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;When the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored;
根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generate test data based on the test information and verify that the generated test data meets the test requirements;
将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储的步骤包括:When the software test request is detected, the step of determining the test information of the software to be tested according to the function of the software to be tested and storing the steps includes:
当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系;When the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested;
根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储。According to the relationship between the software to be tested and the Excel table, the test information of the software test is determined and stored.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
测试信息包括数据位置和数据长度、字符集合,所述根据测试信息生成测试数据的步骤包括:The test information includes a data location and a data length, a character set, and the step of generating test data according to the test information includes:
将Excel表格中的行列坐标数值,作为测试信息中的数据位置;The row and column coordinate values in the Excel table are used as the data locations in the test information;
根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据。Based on the data location in the test information, the data length and character set of the corresponding location are determined to generate test data.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据的步骤包括:According to the data location in the test information, the steps of determining the data length and character set of the corresponding location to generate test data include:
根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合;Identifying the data length and character set at the corresponding location according to the data location in the test information;
当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据。When a data generation instruction is detected, characters in the character set are extracted and test data is generated based on the data length combination.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
验证生成的测试数据是否符合测试需求的步骤包括:The steps to verify that the generated test data meets the test requirements include:
根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求。According to the software function of the software to be tested, the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
判断生成的测试数据是否符合测试需求的步骤包括:The steps to determine whether the generated test data meets the test requirements include:
若生成的测试数据符合测试需求,则利用生成的测试数据软件测试;If the generated test data meets the test requirements, the generated test data software is used to test;
若生成的测试数据不符合测试需求,则标记不符合测试需求的测试数据,并生成新的测试数据。If the generated test data does not meet the test requirements, mark the test data that does not meet the test requirements and generate new test data.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
将符合测试需求的测试数据输入Excel表格中,并运用于软件测试的步骤之后包括:Entering test data that meets the test requirements into an Excel spreadsheet and applying the software test steps includes:
根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试。The number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
进一步地,处理器1001可以调用存储器1005中存储的数据生成应用程序,还执行以下操作:Further, the processor 1001 may call the data generation application stored in the memory 1005, and also perform the following operations:
根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试的步骤之后包括:The number of software tests is determined according to the software testing requirements, and the number of times the test data is generated is set to perform multiple software testing steps including:
利用生成的测试数据进行软件测试,判断软件测试得到的测试结果是否正确,若软件测试得到的测试结果正确,则停止生成测试数据。The generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
参照图4,本发明数据生成方法的一实施例提供数据生成方法包括以下步骤:Referring to FIG. 4, an embodiment of the data generating method of the present invention provides a data generating method including the following steps:
步骤S10,当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储。Step S10, when the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored.
在服务器上进行软件(这里的软件可理解为软件或者数据处理系统)测试时,将软件运行时处理的数据的信息作为测试信息并存储在存储器中,以根据测试信息,确定软件测试过程中需要模拟生成的测试数据,如,服务器上的软件为财务工资结算系统,财务工资结算系统用于为其他分公司的员工发放工资,分公司作为用户端上传公司员工的基本信息(员工姓名、工号、性别等),和工资基本信息(工资金额、银行卡号、需扣除金额等)与工资发放相关的数据,以此在财务工资结算系统的系统测试过程中,需要测试人员输入工资金额、银行卡号等数据,但是在软件测试的过程中并没有真实的工资结算数据用于进行软件测试,现有的技术主要依赖于测试人员的手动输入,本发明首先将系统运行处理的数据相关信息进行整理作为系统测试的测试信息(财务工资结算系统测试信息:工资金额、银行卡号、需扣除金额等与工资计算相关的信息),在测试数据生成时根据存储的测试信息,模拟相关的测试数据以计算工资,从而实现财务工资结算系统的测试。When testing software on the server (the software here can be understood as software or data processing system), the information of the data processed by the software runtime is used as test information and stored in the memory to determine the software testing process according to the test information. Simulate the generated test data. For example, the software on the server is a financial salary settlement system, the financial salary settlement system is used to pay wages to employees of other branches, and the branch office serves as the basic information for uploading employees of the company (employee name, job number) , gender, etc., and the basic information of wages (salary amount, bank card number, deductible amount, etc.) and salary distribution data, in the system test process of the financial salary settlement system, the test personnel need to input the salary amount, bank card number Data, but there is no real salary settlement data for software testing during the software testing process. The existing technology mainly relies on the manual input of the tester. The present invention firstly organizes the data related information processed by the system as System test test information The salary settlement system test information: the salary amount, the bank card number, the deduction amount and other information related to the salary calculation), and the test data is generated according to the stored test information, and the relevant test data is simulated to calculate the salary, thereby realizing the financial salary settlement system. Test.
步骤S20,根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求。Step S20, generating test data according to the test information, and verifying whether the generated test data meets the test requirement.
具体地,根据服务器上软件运行时处理的数据,设置程序函数生成测试数据,即,将数据可能出现的类型,保存在服务器的存储器中,在Excel上开发程序语言,选择对应的字符组合成测试数据进行数据测试,如表1所示,,将银行卡号中出现的数字、其他字母,符号信息作为测试信息保存在存储器中:Specifically, according to the data processed by the software runtime on the server, the program function is generated to generate test data, that is, the type of data that may appear is saved in the memory of the server, the programming language is developed in Excel, and the corresponding characters are combined into a test. The data is tested for data. As shown in Table 1, the numbers, other letters, and symbol information appearing in the bank card number are stored in the memory as test information:
员工工资明细表 Employee salary schedule
姓名Name 性别gender
工号Job number 职位position
日期date 银行卡号Bank card number
工资明细统计Payroll statistics
出勤天数Attendance days
奖金bonus
提成Commission
绩效Performance
总金额total amount
应扣除Deductible
实际金额The actual amount
(表1所示,为一个Excel的模板,可直观地将工资的运算数据理解为软件测试数据),利用程序语言,首先确定在Excel表格中填写数字信息的位置:第几行,第几列,再进一步用程序函数设置生成测试用的数据,将生成的测试数据按照验证条件进行验证,判断生成的数据是否符合测试需求(验证条件:按照生成的数据的具体情况验证条件,可针对数据的生成概率验证随机性、或者是否符合特定的数据边界,末尾的验证规则等,对生成的测试数据进行验证,满足验证条件的为符合测试需求)。(Table 1, shown as an Excel template, can intuitively understand the salary calculation data as software test data), using the programming language, first determine the location of the digital information in the Excel table: the first few rows, the first few columns Further, the program function is used to generate the test data, and the generated test data is verified according to the verification condition, and it is judged whether the generated data meets the test requirement (verification condition: the verification condition according to the specific situation of the generated data, and the data can be Generate probabilistic verification randomness, or whether it conforms to a specific data boundary, the end of the verification rules, etc., to verify the generated test data, to meet the test requirements to meet the test requirements).
步骤S30,将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。In step S30, the test data meeting the test requirements is input into an Excel spreadsheet and used for software testing.
服务器将验证后的符合测试需求的测试数据对应输入Excel表格中,利用Excel表格中的由程序语言生成的测试数据进行软件测试。The server inputs the verified test data conforming to the test requirements into an Excel spreadsheet, and performs software testing using the test data generated by the programming language in the Excel table.
本实施例中,在当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储,根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求,将符合测试需求的测试数据输入Excel表格中,并运用于软件测试;将用户端上传至服务器处理的数据信息存储在Excel格式的附件中,在对服务器上的软件进行测试时,利用Excel上支持程序语言运行的特点,在Excel上开发出程序语言,模拟用户端的数据输入,具体地,将服务器需要处理的数据进行整理,得到用户可能输入的所有数据信息作为测试信息,设置程序语言随机生成对应测试数据进行软件测试,避免了软件测试人员手工输入数据,提高了数据输入的速度,进一步地提高了软件测试效率。In this embodiment, when the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored, the test data is generated according to the test information, and the generated test data is verified to meet the test requirements, and the The test data of the test requirement is input into the Excel spreadsheet and used for software testing; the data information processed by the client to the server is stored in an attachment in Excel format, and the software in the support language of Excel is used when testing the software on the server. The characteristics of the operation, develop the programming language in Excel, simulate the data input of the client, specifically, sort the data that the server needs to process, obtain all the data information that the user may input as the test information, and set the programming language to randomly generate the corresponding test data. Software testing is performed to prevent software testers from manually inputting data, which increases the speed of data input and further improves the efficiency of software testing.
参照图5,在第一实施例的基础上进一步地提出了本实施例,在本实施例中步骤S10包括:Referring to FIG. 5, the embodiment is further proposed based on the first embodiment. In this embodiment, step S10 includes:
步骤S11,当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系。In step S11, when the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested.
在服务器软件测试时,首先确定软件运行过程中处理的数据,将软件运行过程中处理的全部数据,输入Excel格式中的作为软件测试信息,将待测试软件与Excel表格建立关联关系,如,总部的财务工资结算系统,在进行工资发放的时,如表1所示的员工工资明细Excel表的模板中输入工资发放相关数据,再将Excel中的数据作为附件信息上传至总部的财务工资结算系统中,建立财务工资结算系统与Excel表格之间的关联关系,财务工资结算系统对应处理Excel中的数据信息。In the server software test, first determine the data processed during the software running process, input all the data processed in the software running process into the Excel format as the software test information, and associate the software to be tested with the Excel table, for example, the headquarters The financial salary settlement system, when the salary is paid, enter the salary distribution related data in the template of the employee salary list Excel table shown in Table 1, and then upload the data in Excel as the attachment information to the financial salary settlement system of the headquarters. In the middle, the relationship between the financial salary settlement system and the Excel spreadsheet is established, and the financial salary settlement system processes the data information in Excel.
需要补充说明的是本方法中是将用户端输入的Excel中的数据作为模板数据,若采用其他格式进行数据生成,应用与软件测试的方法均匀考虑在本方案保护的范围内。It should be added that in the method, the data in the Excel input by the user terminal is used as the template data. If other formats are used for data generation, the application and software testing methods are evenly considered within the scope of protection of the solution.
步骤S12,根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储。Step S12: Determine test information of the software test according to the relationship between the software to be tested and the Excel table, and store the test information.
根据待测试软件与Excel表格的关联关系,确定待测试软件需要测试Excel中的全部测试数据,并想测试数据在Excel中位置信息,测试数据的长度,测试数据的类型作为测试信息,并存储在存储器中,即,在Excel可能出现数值型数据、数据字典类数据、文本型数据等统一在字符集合中,因此需要终端将可能出现的测试信息(数据位置和数据长度、字符集合)全部保存在终端的存储器中。According to the relationship between the software to be tested and the Excel table, it is determined that the software to be tested needs to test all the test data in Excel, and wants to test the position information of the data in Excel, the length of the test data, the type of the test data as test information, and stored in In the memory, that is, in Excel, numeric data, data dictionary data, text data, and the like may be unified in the character set, so the terminal needs to store all possible test information (data position and data length, character set) in the memory. In the memory of the terminal.
本实施例中当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系,根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储;将系统运行过程中用户输入在Excel中的数据信息作为测试信息,以便根据测试信息生成对应的测试数据进行软件测试,现有的软件测试是由测试人员根据软件处理的数据信息,人工手动的数据输入进行软件测试,这样的方法对大量数据输入的软件检测来说,会导致测试效率较低,将用户端可能输入的数据作为测试信息,生成测试数据进行数据测试可加快软件测试是的效率。In the embodiment, when the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested, and the test information of the software test is determined and stored according to the relationship between the software to be tested and the Excel table; During the running of the system, the user inputs the data information in Excel as test information, so as to generate corresponding test data according to the test information for software testing. The existing software test is data input processed by the tester according to the software, and manual manual data input. Software testing, such a method for software testing of a large number of data input, will lead to low test efficiency, the data that the user may input as test information, generate test data for data testing can speed up the efficiency of software testing.
参照图6,在第一实施例的基础上进一步提出了本实施例,在本实施例中数据信息包括数据位置、数据类型和数据长度,步骤S20包括:Referring to FIG. 6, the embodiment is further provided on the basis of the first embodiment. In this embodiment, the data information includes a data location, a data type, and a data length, and step S20 includes:
步骤S21,将Excel表格中的行列坐标数值,作为测试信息中的数据位置。In step S21, the row and column coordinate values in the Excel table are used as the data locations in the test information.
具体地,本发明在数据生成过程中,直接模拟用户端的数据信息输入,将生成的测试数据输入Excel中的相应的位置,如表1所示,将模板数据在Excel中对应的行列值作为模板数据的数据位置,在软件测试时Excel中的位置为没有测试数据,本方法利用Excel中支持运行程序语言的特点,在Excel中上生成测试数据,即,先确定软件测试时测试数据在Excel的数据位置,软件工具语言:可使用VBA语言的sheets().select和cells()函数找到具体的excel中的位置,在此基础上填充数据。Specifically, in the data generation process, the present invention directly simulates data input of the user end, and inputs the generated test data into a corresponding position in Excel, as shown in Table 1, and uses the corresponding row and column values of the template data in Excel as a template. The data location of the data, in the software test, the location in Excel is no test data, this method uses the features of Excel to support the running program language, generate test data in Excel, that is, first determine the test data in the software test in Excel Data location, software tool language: You can use the VBA language sheets().select and cells() functions to find the location in the specific excel, and populate the data on this basis.
步骤S22,根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据。Step S22: Determine a data length and a character set of the corresponding location according to the data location in the test information to generate test data.
具体地,在确定模板数据的数据位置之后,进一步确定对应位置的数据长度和数据类型,即,确定在Excel中的生成数据的数据位置后,在确定对应位置的数据长度和字符集合(字符集合:不同的数据类型、符号、字母等),针对不同的数据位置设置不同的程序语言生成测试数据。Specifically, after determining the data location of the template data, the data length and the data type of the corresponding location are further determined, that is, after determining the data location of the generated data in Excel, determining the data length and character set (character set) of the corresponding location : Different data types, symbols, letters, etc., set different program languages for different data locations to generate test data.
在本实施例中将Excel表格中的行列坐标数值,作为测试信息中的数据位置,根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据;将测试数据在Excel表格中对应行列坐标数值,作为测试数据的数据位置,根据模板数据的数据位置确定对应位置的数据长度和字符,并设置程序语言生成测试数据,防止人工输入测试数据的繁琐的工作,通过确定测试信息,再预设程序语言生成测试数据加快了软件测试效率。In this embodiment, the row and column coordinate values in the Excel table are used as the data position in the test information, and the data length and character set of the corresponding position are determined according to the data position in the test information to generate test data; the test data is in Excel. The corresponding row and column coordinate values in the table, as the data position of the test data, determine the data length and characters of the corresponding position according to the data position of the template data, and set the programming language to generate test data to prevent the cumbersome work of manually inputting the test data, and determine the test by determining the test. Information, and then preset programming language to generate test data speeds up software testing efficiency.
参照图7,在本实施例中步骤S22包括:Referring to FIG. 7, in the embodiment, step S22 includes:
步骤S221,根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合。Step S221, identifying the data length and the character set at the corresponding location according to the data location in the test information.
具体地,根据测试数据在Excel中的位置确定测试数据的位置后,识别应该生成的测试数据的数据长度和字符集合。Specifically, after determining the location of the test data based on the location of the test data in Excel, the data length and character set of the test data that should be generated are identified.
步骤S222,当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据。Step S222, when the data generation instruction is detected, the characters in the character set are extracted and the test data is generated according to the data length combination.
在确定数据位置、数据长度、字符集合后,设置程序语言从终端中预存的测试信息中字符集合中随机抽取字符,针对数值型的数据,在模板数据的数据位置一定范围内生成各个类型的数值,并对应填充抽取的数据至对应位置,即,可根据VBA的round、format函数生成随机数值,若填充数据字典类数据时,将数据字典维护在一个sheet中,通过顺序循环读取该sheet中的值,将数据字段类数据填充到Excel模板中,组合生成测试数据,After determining the data location, the data length, and the character set, the programming language randomly extracts characters from the character set stored in the test information pre-stored in the terminal, and generates numerical values of various types within a certain range of the data position of the template data for the numerical data. And correspondingly filling the extracted data to the corresponding position, that is, the random value can be generated according to the round and format functions of the VBA, and if the data dictionary class data is filled, the data dictionary is maintained in a sheet, and the sheet is read in a sequential cycle. The value of the data field class data is filled into the Excel template, combined to generate test data,
如,总部工资结算系统中员工填写的Excel表格信息中,软件测试时需要填写的银行卡号,则首先确定需要填写银行卡号的位置,再对应确定银行卡号的长度,并再对应长度选取数字,组合形成银行卡号(将所有数字、字符预先保存在存储器中形成字符集合,然后利用程序语言随机抽取数据,组合形成测试数据),同样的若需要填写其他类型的数字信息也对应生成。For example, in the Excel form information filled in by the employee in the salary settlement system of the headquarters, the bank card number to be filled in during the software test, first determine the location where the bank card number needs to be filled, and then determine the length of the bank card number, and then select the number corresponding to the length, and combine The bank card number is formed (all numbers and characters are pre-stored in the memory to form a character set, and then the data is randomly extracted by the programming language to form test data), and the same type of digital information is required to be generated correspondingly.
需要补充说明的是这里的数据是不仅包括数字,也包括字母,或者其他了类型的字符信息。It should be added that the data here includes not only numbers, but also letters, or other types of character information.
本实施例中根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合;当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据,从预先存储的测试信息字符集合中随机抽取字符信息组合形成测试数据,加快了测试数据的生成效率。In this embodiment, according to the data location in the test information, the data length and the character set at the corresponding location are identified; when the data generation instruction is detected, the characters in the character set are extracted and the test data is generated according to the data length combination, from the pre-stored The test information character set randomly extracts the character information combination to form test data, which accelerates the generation efficiency of the test data.
结合图6,在本发明数据生成方法中步骤S20还包括:With reference to FIG. 6, step S20 in the data generating method of the present invention further includes:
步骤S23,根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求。In step S23, according to the software function of the software to be tested, the generated verification data is verified by the preset verification condition to determine whether the generated test data meets the test requirement.
具体地,根据待测试软件的软件功能,预设验证条件将生成的测试数据进行验证,以验证生成的测试数据是否测试需求,即,简单地验证针对生成的数据做随机性验证,或者对特定位置的数据设置数据验证条件如,生成的银行卡号是否最后一位符合对应的校验规则,即,生成的测试数据是否符合随机性、唯一性等不同的数据验证规则。Specifically, according to the software function of the software to be tested, the preset verification condition verifies the generated test data to verify whether the generated test data is a test requirement, that is, simply verifying randomness verification for the generated data, or The data setting condition of the location data verification condition, for example, whether the generated bank card number corresponds to the corresponding verification rule, that is, whether the generated test data conforms to different data verification rules such as randomness and uniqueness.
步骤S24,若生成的测试数据符合测试需求,则利用生成的测试数据软件测试。In step S24, if the generated test data meets the test requirements, the generated test data software is used for testing.
具体地,用预设验证条件对生成的测试数据进行软件测试,若生成的测试数据满足对应的验证条件,认为测试数据符合测试需求,进行下一数据位置的测试数据生成,并利用生成的数据进行软件测试,基于Excel中支持程序语言,即可直接在Excel中进行软件测试。Specifically, the generated test data is tested by using the preset verification condition. If the generated test data satisfies the corresponding verification condition, the test data is considered to meet the test requirement, the test data of the next data location is generated, and the generated data is utilized. Software testing, based on the support of the programming language in Excel, you can directly test the software in Excel.
步骤S25,若生成的测试数据不符合测试需求,则标记不符合测试需求的测试数据,并生成新的测试数据。In step S25, if the generated test data does not meet the test requirements, the test data that does not meet the test requirements is marked, and new test data is generated.
若针对生成的测试数据进行验证,测试数据不满足随机性,重复率较高或者不满足其他验证条件,认为生成的测试数据不符合测试需求,将不满足测试需求的测试数据进行标记,并再次运行对应位置的数据生成程序,以生成新的测试数据。If the test data is verified, the test data does not satisfy the randomness, the repetition rate is high, or other verification conditions are not met. It is considered that the generated test data does not meet the test requirements, and the test data that does not meet the test requirements is marked and again. Run the data generator of the corresponding location to generate new test data.
本实施例中根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求,对生成的数据预设不同的数据验证条件,以对生成的测试数据进行验证,使生成的测试数据更加符合软件测试的要求,使软件测试的准确性得到保障,判断生成的测试数据是否符合测试需求,若生成的测试数据符合测试需求,则利用生成的测试数据软件测试,若生成的测试数据不符合测试需求,则标记不符合测试需求的测试数据,并生成新的测试数据,使生成的测试数据更加符合软件测试的要求,提高了软件测试的准确性,现有的测试数据主要依靠测试人员手工输入,若测试的手工输入出现误差,查询困难,还可能导致软件系统出现问题。In this embodiment, according to the software function of the software to be tested, the verification condition is used to verify the generated test data to determine whether the generated test data meets the test requirement, and different data verification conditions are preset for the generated data to generate The test data is verified to make the generated test data more in line with the requirements of the software test, so that the accuracy of the software test is guaranteed, and whether the generated test data meets the test requirements, and if the generated test data meets the test requirements, the generated test data is utilized. Test data software test, if the generated test data does not meet the test requirements, mark the test data that does not meet the test requirements, and generate new test data, so that the generated test data is more in line with the requirements of the software test, and the accuracy of the software test is improved. Sexuality, the existing test data mainly depends on the manual input by the tester. If the manual input of the test has errors, the query is difficult, and the software system may also have problems.
参照图8,在本数据生成方法的另一实施例中步骤S30之后,还包括:Referring to FIG. 8, after step S30 in another embodiment of the data generating method, the method further includes:
步骤S40,根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试。In step S40, the number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
具体地,根据软件测试需求设置数据的生成次数,利用循环语句,在一次软件测试结束后,设置再一次的数据生成语句,在Excel模板上生成新一轮的测试数据覆盖上一次的数据,并针对新生成的测试数据进行数据验证,进行多次循环的软件测试。Specifically, according to the software test requirement setting data generation times, using a loop statement, after a software test is finished, setting a data generation statement again, generating a new round of test data over the Excel template to overwrite the previous data, and Data verification for newly generated test data and software testing for multiple cycles.
步骤S50,利用生成的测试数据进行软件测试,判断软件测试得到的测试结果是否正确,若软件测试得到的测试结果正确,则停止生成测试数据。In step S50, the generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
具体地,软件测试主要是围绕软性的稳定性等不同的因素展开的,利用生成的测试数据进行软件测试,并判断软件测试的结果是否正确,即,利用生成的测试值进行软件测试时,测试得到的结果与软件正常运行的到的值是否相同,若多次软件测试结果正确,则停止生成软件测试数据,完成对应的软件测试工作,反之,若软件测试得到的测试结果不正确,则多次的生成测试数据,并寻找软件异常的因素。Specifically, the software test is mainly carried out around different factors such as the stability of the softness, using the generated test data for software testing, and judging whether the result of the software test is correct, that is, when using the generated test value for software testing, The result of the test is the same as the value of the software running normally. If the software test result is correct multiple times, stop generating the software test data and complete the corresponding software test work. Otherwise, if the test result obtained by the software test is incorrect, then Generate test data multiple times and look for software anomalies.
本实施例中根据软件测试需求设置数据生成次数,利用程序语言循环生成测试数据并验证生成的测试数据以进行软件测试,可以避免测试人员进行重复大量的数据输入实现软件测试,加快了软件测试的效率。利用成的测试数据进行软件测试,判断软件测试结果与设定值是否匹配,若软件测试结果与设定值匹配,则停止生成软件测试数据,完成软件测试,本实施例中指出了测试数据停止生成的条件,利用生成的测试数据快速的进行软件测试,减缓了纯手工测试的枯燥;针对大规模的附件上传功能,节省了测试人力的投入;随机生成的数据可以更全面的覆盖测试场景,不易遗漏场景。In this embodiment, the data generation times are set according to the software testing requirements, and the test data is generated by using the programming language to cycle and verify the generated test data for software testing, which can prevent the tester from repeating a large amount of data input to implement the software test, and speed up the software test. effectiveness. Using the test data to perform software testing, determine whether the software test result matches the set value. If the software test result matches the set value, stop generating the software test data and complete the software test. In this embodiment, the test data is stopped. The generated conditions, using the generated test data to quickly perform software testing, slow down the tedious manual test; save the investment of test manpower for large-scale attachment upload function; the randomly generated data can cover the test scenario more comprehensively. It is not easy to miss the scene.
进一步的,结合图9,本发明还提供一种数据生成装置,数据生成装置包括:Further, with reference to FIG. 9, the present invention further provides a data generating apparatus, where the data generating apparatus includes:
检测确定模块10,用于当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;The detection determining module 10 is configured to determine, according to a function of the software to be tested, test information of the software to be tested and store the software test request;
生成验证模块20,用于根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generating a verification module 20 for generating test data according to the test information and verifying whether the generated test data meets the test requirements;
数据输入模块30,用于将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。The data input module 30 is configured to input test data meeting the test requirements into an Excel spreadsheet and apply the software test.
其中,数据生成装置各个功能模块实现的步骤可参照本发明数据生成方法的各个实施例,此处不再赘述。For the steps of the data generating device, the data generating device can refer to various embodiments of the data generating method of the present invention, and details are not described herein again.
此外,本发明实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有数据生成程序,所述数据生成程序被处理器执行时实现如数据生成方法的步骤。In addition, an embodiment of the present invention further provides a computer readable storage medium having a data generation program stored thereon, and the data generation program is implemented by a processor to implement steps such as a data generation method.
其中,数据生成程序被执行时所实现的方法可参照本发明数据生成方法的各个实施例,此处不再赘述。For the method implemented when the data generating program is executed, reference may be made to various embodiments of the data generating method of the present invention, and details are not described herein again.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or It also includes other elements that are not explicitly listed, or elements that are inherent to such a process, method, item, or system. An element defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in a process, method, article, or system that includes the element, without further limitation.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, portions of the technical solution of the present invention that contribute substantially or to the prior art may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (20)

  1. 一种数据生成方法,其特征在于,所述数据生成的方法应用于软件测试,所述数据生成方法包括以下步骤: A data generating method, wherein the data generating method is applied to a software test, and the data generating method comprises the following steps:
    当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;When the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored;
    根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generate test data based on the test information and verify that the generated test data meets the test requirements;
    将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
  2. 如权利要求1所述的数据生成方法,其特征在于,所述当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储的步骤包括:The data generating method according to claim 1, wherein when the software test request is detected, determining the test information of the software to be tested according to the function of the software to be tested and storing the steps includes:
    当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系;When the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested;
    根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储。According to the relationship between the software to be tested and the Excel table, the test information of the software test is determined and stored.
  3. 如权利要求2所述的数据生成方法,其特征在于,所述测试信息包括数据位置和数据长度、字符集合;The data generating method according to claim 2, wherein the test information comprises a data location and a data length, and a character set;
    所述根据测试信息生成测试数据的步骤包括:The step of generating test data according to the test information includes:
    将Excel表格中的行列坐标数值,作为测试信息中的数据位置;The row and column coordinate values in the Excel table are used as the data locations in the test information;
    根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据。Based on the data location in the test information, the data length and character set of the corresponding location are determined to generate test data.
  4. 如权利要求3所述的数据生成方法,其特征在于,所述根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据的步骤包括:The data generating method according to claim 3, wherein the step of determining a data length and a character set of the corresponding location according to the data location in the test information to generate test data comprises:
    根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合;Identifying the data length and character set at the corresponding location according to the data location in the test information;
    当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据。When a data generation instruction is detected, characters in the character set are extracted and test data is generated based on the data length combination.
  5. 如权利要求1所述的数据生成方法,其特征在于,所述验证生成的测试数据是否符合测试需求的步骤包括:The data generating method according to claim 1, wherein the step of verifying whether the generated test data meets the test requirement comprises:
    根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求。According to the software function of the software to be tested, the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
  6. 如权利要求5所述的数据生成方法,其特征在于,所述判断生成的测试数据是否符合测试需求的步骤包括:The data generating method according to claim 5, wherein the step of determining whether the generated test data meets the test requirement comprises:
    若生成的测试数据符合测试需求,则利用生成的测试数据软件测试;If the generated test data meets the test requirements, the generated test data software is used to test;
    若生成的测试数据不符合测试需求,则标记不符合测试需求的测试数据,并生成新的测试数据。If the generated test data does not meet the test requirements, mark the test data that does not meet the test requirements and generate new test data.
  7. 如权利要求1所述的数据生成方法,其特征在于,所述将符合测试需求的测试数据输入Excel表格中,并运用于软件测试的步骤之后包括:The data generating method according to claim 1, wherein the inputting the test data conforming to the test requirement into the Excel table and applying the software test step comprises:
    根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试。The number of software tests is determined according to the software test requirements, and the number of times the test data is generated is set to perform multiple software tests.
  8. 如权利要求7所述的数据生成方法,其特征在于,所述根据软件测试需求确定软件测试次数,并设置测试数据的生成次数,以进行多次的软件测试的步骤之后包括:The data generating method according to claim 7, wherein the determining the number of software tests according to the software testing requirement and setting the number of times the test data is generated to perform the plurality of software testing steps comprises:
    利用生成的测试数据进行软件测试,判断软件测试得到的测试结果是否正确,若软件测试得到的测试结果正确,则停止生成测试数据。The generated test data is used for software testing to determine whether the test result obtained by the software test is correct. If the test result obtained by the software test is correct, the test data is stopped.
  9. 一种数据生成装置,其特征在于,所述数据生成装置包括:A data generating device, wherein the data generating device comprises:
    检测确定模块,用于当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;a detection determining module, configured to determine, according to a function of the software to be tested, test information of the software to be tested and store the software test request;
    生成验证模块,用于根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generating a verification module for generating test data based on the test information and verifying whether the generated test data meets the test requirements;
    数据输入模块,用于将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。A data input module for inputting test data that meets the test requirements into an Excel spreadsheet and for use in software testing.
  10. 一种数据生成终端,其特征在于,所述数据生成终端包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的数据生成程序,其中,A data generating terminal, comprising: a memory, a processor, and a data generating program stored on the memory and operable on the processor, wherein
    所述数据生成程序被所述处理器执行时实现以下步骤:The data generation program is executed by the processor to implement the following steps:
    当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;When the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored;
    根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generate test data based on the test information and verify that the generated test data meets the test requirements;
    将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
  11. 如权利要求10所述的数据生成终端,其特征在于,所述数据生成程序被所述处理器执行时实现,所述当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储的步骤包括:The data generating terminal according to claim 10, wherein the data generating program is implemented by the processor, and when the software testing request is detected, determining the software to be tested according to the function of the software to be tested The steps to test the information and store it include:
    当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系;When the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested;
    根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储。According to the relationship between the software to be tested and the Excel table, the test information of the software test is determined and stored.
  12. 如权利要求11所述的数据生成终端,其特征在于,所述数据生成程序被所述处理器执行时实现,所述测试信息包括数据位置和数据长度、字符集合;The data generating terminal according to claim 11, wherein the data generating program is implemented by the processor, and the test information comprises a data location and a data length, and a character set;
    所述根据测试信息生成测试数据的步骤包括:The step of generating test data according to the test information includes:
    将Excel表格中的行列坐标数值,作为测试信息中的数据位置;The row and column coordinate values in the Excel table are used as the data locations in the test information;
    根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据。Based on the data location in the test information, the data length and character set of the corresponding location are determined to generate test data.
  13. 如权利要求12所述的数据生成终端,其特征在于,所述数据生成程序被所述处理器执行时实现,所述根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据的步骤包括:The data generating terminal according to claim 12, wherein said data generating program is implemented by said processor, said determining a data length and a character set of the corresponding position based on the data position in the test information, The steps to generate test data include:
    根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合;Identifying the data length and character set at the corresponding location according to the data location in the test information;
    当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据。When a data generation instruction is detected, characters in the character set are extracted and test data is generated based on the data length combination.
  14. 如权利要求10所述的数据生成终端,其特征在于,所述数据生成程序被所述处理器执行时实现所述验证生成的测试数据是否符合测试需求的步骤包括:The data generating terminal according to claim 10, wherein the step of realizing whether the test data generated by the verification conforms to the test requirement when the data generating program is executed by the processor comprises:
    根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求。According to the software function of the software to be tested, the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
  15. 如权利要求14所述的数据生成终端,其特征在于,所述数据生成程序被所述处理器执行时实现,所述判断生成的测试数据是否符合测试需求的步骤包括:The data generating terminal according to claim 14, wherein the data generating program is implemented by the processor, and the step of determining whether the generated test data meets a test requirement comprises:
    若生成的测试数据符合测试需求,则利用生成的测试数据软件测试;If the generated test data meets the test requirements, the generated test data software is used to test;
    若生成的测试数据不符合测试需求,则标记不符合测试需求的测试数据,并生成新的测试数据。If the generated test data does not meet the test requirements, mark the test data that does not meet the test requirements and generate new test data.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有数据生成程序,所述数据生成程序被处理器执行时实现以下的步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores a data generation program, and when the data generation program is executed by the processor, the following steps are implemented:
    当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储;When the software test request is detected, the test information of the software to be tested is determined according to the function of the software to be tested and stored;
    根据测试信息生成测试数据,并验证生成的测试数据是否符合测试需求;Generate test data based on the test information and verify that the generated test data meets the test requirements;
    将符合测试需求的测试数据输入Excel表格中,并运用于软件测试。Test data that meets the test requirements is entered into an Excel spreadsheet and applied to software testing.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述数据生成程序被处理器执行时实现所述当检测到软件测试请求时,根据待测试软件的功能确定待测试软件的测试信息并存储的步骤包括:The computer readable storage medium according to claim 16, wherein the data generation program is executed by the processor to implement the test of the software to be tested according to the function of the software to be tested when the software test request is detected. The steps for information and storage include:
    当检测到软件测试请求时,根据待测试软件的功能将待测试软件与Excel表格建立关联关系;When the software test request is detected, the software to be tested is associated with the Excel table according to the function of the software to be tested;
    根据待测试软件与Excel表格的关联关系,确定软件测试的测试信息并存储。According to the relationship between the software to be tested and the Excel table, the test information of the software test is determined and stored.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述数据生成程序被处理器执行时实现,所述测试信息包括数据位置和数据长度、字符集合;The computer readable storage medium of claim 17, wherein the data generation program is implemented by a processor, the test information comprising a data location and a data length, a set of characters;
    所述根据测试信息生成测试数据的步骤包括:The step of generating test data according to the test information includes:
    将Excel表格中的行列坐标数值,作为测试信息中的数据位置;The row and column coordinate values in the Excel table are used as the data locations in the test information;
    根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据。Based on the data location in the test information, the data length and character set of the corresponding location are determined to generate test data.
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述数据生成程序被处理器执行时实现所述根据测试信息中的数据位置,确定对应位置的数据长度和字符集合,以生成测试数据的步骤包括:The computer readable storage medium according to claim 18, wherein when the data generating program is executed by the processor, the data length and the character set of the corresponding position are determined according to the data position in the test information to generate The steps to test the data include:
    根据测试信息中的数据位置,识别对应位置上的数据长度和字符集合;Identifying the data length and character set at the corresponding location according to the data location in the test information;
    当检测到数据生成指令时,抽取字符集合中的字符并根据数据长度组合生成测试数据。When a data generation instruction is detected, characters in the character set are extracted and test data is generated based on the data length combination.
  20. 如权利要求16所述的计算机可读存储介质,其特征在于,所述数据生成程序被处理器执行时实现,所述验证生成的测试数据是否符合测试需求的步骤包括:The computer readable storage medium according to claim 16, wherein the data generating program is implemented by a processor, and the step of verifying whether the generated test data meets a test requirement comprises:
    根据待测试软件的软件功能,预设验证条件对生成的测试数据进行验证,以判断生成的测试数据是否符合测试需求。According to the software function of the software to be tested, the preset verification conditions verify the generated test data to determine whether the generated test data meets the test requirements.
PCT/CN2017/111900 2017-05-10 2017-11-20 Data generation method, apparatus, terminal, and computer-readable storage medium WO2018205545A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2018205545A1 true WO2018205545A1 (en) 2018-11-15

Family

ID=61134204

Family Applications (1)

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

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968514A (en) * 2019-12-02 2020-04-07 北京明略软件系统有限公司 Test method, test device, electronic equipment and storage medium

Families Citing this family (16)

* 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
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
CN114153911A (en) * 2021-12-21 2022-03-08 浪潮软件集团有限公司 Method and system for custom generation of database test data based on VBA technology
CN114817035B (en) * 2022-04-26 2024-06-25 苏州浪潮智能科技有限公司 Software testing method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760096A (en) * 2011-04-27 2012-10-31 阿里巴巴集团控股有限公司 Test data generation method, unit testing method and unit testing system
CN104615667A (en) * 2015-01-13 2015-05-13 联动优势电子商务有限公司 Basic data generation method and device and test data generation method and device
US20160299837A1 (en) * 2011-07-21 2016-10-13 International Business Machines Corporation Software test automation systems and methods

Family Cites Families (3)

* 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
CN102622294B (en) * 2011-01-28 2014-12-10 国际商业机器公司 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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760096A (en) * 2011-04-27 2012-10-31 阿里巴巴集团控股有限公司 Test data generation method, unit testing method and unit testing system
US20160299837A1 (en) * 2011-07-21 2016-10-13 International Business Machines Corporation Software test automation systems and methods
CN104615667A (en) * 2015-01-13 2015-05-13 联动优势电子商务有限公司 Basic data generation method and device and test data generation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968514A (en) * 2019-12-02 2020-04-07 北京明略软件系统有限公司 Test method, test device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107678935A (en) 2018-02-09
CN107678935B (en) 2020-07-14

Similar Documents

Publication Publication Date Title
WO2018205545A1 (en) Data generation method, apparatus, terminal, and computer-readable storage medium
WO2019165691A1 (en) Method, apparatus and device for automatically generating test case, and readable storage medium
WO2018227880A1 (en) Data comparison method, apparatus and device, and readable storage medium
WO2014025186A1 (en) Method for providing message function and electronic device thereof
WO2014182052A1 (en) Method and apparatus for providing contents including augmented reality information
WO2015135443A1 (en) Method and apparatus for simulating sound in virtual scenario, and terminal
WO2018205544A1 (en) Software project management method, apparatus, terminal, and computer storage medium
WO2014157899A1 (en) Method for controlling dynamically changing contents of web page and electronic device thereof
WO2019119624A1 (en) Excel table-based calculation method and apparatus, device, and storage medium
WO2019104876A1 (en) Insurance product pushing method and system, terminal, client terminal, and storage medium
WO2019169814A1 (en) Method, apparatus and device for automatically generating chinese annotation, and storage medium
WO2020224247A1 (en) Blockchain–based data provenance method, apparatus and device, and readable storage medium
WO2021215730A1 (en) Computer program, method, and device for generating virtual defect image by using artificial intelligence model generated on basis of user input
WO2014180149A1 (en) Method, system and computer storage medium for handling of account theft in online games
WO2018076811A1 (en) Data sharing method, device, system, storage medium and electronic device
WO2014035199A1 (en) User interface apparatus in a user terminal and method for supporting the same
WO2019168315A1 (en) Trustzone graphic rendering method and display device using the same
WO2018214599A1 (en) Scalable data reporting method and system, and storage medium
WO2018188342A1 (en) Method, apparatus and device for generating script file, and computer-readable storage medium
WO2018053964A1 (en) Android-based method and apparatus for voice input of punctuation mark
WO2020130447A1 (en) Method for providing sentences on basis of persona, and electronic device supporting same
WO2022080659A1 (en) Electronic device and control method therefor
WO2020114333A1 (en) Video-based ar education method, smart television, storage medium, and device
WO2014126412A1 (en) Method for generating writing data and an electronic device thereof
WO2019127869A1 (en) Vulnerability information collection method, apparatus and device, and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17909454

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17909454

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13.03.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17909454

Country of ref document: EP

Kind code of ref document: A1