CN110543420B - Software testing method, system, terminal and storage medium - Google Patents

Software testing method, system, terminal and storage medium Download PDF

Info

Publication number
CN110543420B
CN110543420B CN201910814208.XA CN201910814208A CN110543420B CN 110543420 B CN110543420 B CN 110543420B CN 201910814208 A CN201910814208 A CN 201910814208A CN 110543420 B CN110543420 B CN 110543420B
Authority
CN
China
Prior art keywords
software
test data
probe
source code
simulation test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910814208.XA
Other languages
Chinese (zh)
Other versions
CN110543420A (en
Inventor
李男
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910814208.XA priority Critical patent/CN110543420B/en
Publication of CN110543420A publication Critical patent/CN110543420A/en
Application granted granted Critical
Publication of CN110543420B publication Critical patent/CN110543420B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis

Abstract

The invention provides a software testing method, a system, a terminal and a storage medium, comprising the following steps: inserting probes into the source code of the test software; inputting simulation test data to a source code through the probe; controlling the test software to run and executing the simulation test data; capturing abnormal information of the running of the test software by monitoring the test software in real time; and confirming and capturing the abnormal information, and recording the probe position corresponding to the abnormal information and corresponding simulation test data. The invention detects software bugs by providing unexpected, random or erroneous data as input, and monitors abnormal results to find potential bugs in the software when it crashes. Can be used as an auxiliary means for the test of software testers.

Description

Software testing method, system, terminal and storage medium
Technical Field
The invention relates to the technical field of server testing, in particular to a software testing method, a system, a terminal and a storage medium.
Background
With the rapid development of the software industry, the software scale and the software function point may grow exponentially, because the new functions and states interact with the existing functions, but the test only grows linearly, and there is a blank that the test cannot cover. With the emergence of new development modes such as agile development and iterative development, higher challenges are also provided for software testing, namely the testing is required to be capable of rapidly carrying out high-coverage testing. Introducing various automatic testing means is imperative.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, the present invention provides a software testing method, system, terminal and storage medium to solve the above-mentioned technical problems.
In a first aspect, the present invention provides a software testing method, including:
inserting probes into the source code of the test software;
inputting simulation test data to a source code through the probe;
controlling the test software to run and executing the simulation test data;
capturing abnormal information of the running of the test software by monitoring the test software in real time;
and confirming and capturing the abnormal information, and recording the position of the probe corresponding to the abnormal information and corresponding simulation test data.
Further, the inserting a probe into the test software source code includes:
setting a pile inserting strategy;
and inserting probes at corresponding positions of the source codes of the test software according to the instrumentation strategy.
Further, the inputting simulation test data to the source code through the probe includes:
collecting source code keywords of the probe position;
generating simulation test data according to the source code key words;
inputting the simulated test data into a source code of the probe location.
Further, the recording of the probe position corresponding to the abnormal information and the corresponding simulation test data includes:
acquiring abnormal information generation time;
recording the probe position corresponding to the generation time;
and collecting and recording the simulation test data input at the position of the corresponding probe.
In a second aspect, the present invention provides a software testing system, comprising:
the probe inserting unit is configured to insert the probe into the test software source code;
the data input unit is configured to input simulation test data to the source code through the probe;
the software running unit is configured to control the test software to run and execute the simulation test data;
the abnormality capturing unit is configured to capture the abnormal information of the running of the test software by monitoring the test software in real time;
and the information recording unit is configured to confirm that the abnormal information is captured, and record the probe position corresponding to the abnormal information and corresponding simulation test data.
Further, the probe insertion unit includes:
the strategy setting module is configured for setting a pile inserting strategy;
and the probe inserting module is configured for inserting probes at corresponding positions of the test software source code according to the instrumentation strategy.
Further, the data input unit includes:
a code acquisition module configured to acquire source code keywords for a probe position;
the data generation module is configured to generate simulation test data according to the source code keywords;
a data input module configured to input the simulated test data into a source code of the probe location.
Further, the information recording unit includes:
the time acquisition module is configured to acquire abnormal information generation time;
the position recording module is configured for recording the probe position corresponding to the generation time;
and the data recording module is configured for acquiring and recording the simulation test data input at the position corresponding to the probe.
In a third aspect, a terminal is provided, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
The beneficial effect of the invention is that,
according to the software testing method, system, terminal and storage medium, provided by the invention, the automatic testing of the software is completed by traversing the source code of the software to be tested, inserting the simulated testing data into the source code according to the instrumentation strategy, executing the simulated testing data, and executing the recording and tracking program. That is, software vulnerabilities are detected by providing unexpected, random, or erroneous data as input, and the results of the anomalies are monitored for potential vulnerabilities that exist when the software crashes. Can be used as an auxiliary means for the test of software testers.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following explains key terms appearing in the present invention.
Pile inserting technology: the program instrumentation is a method for inserting some probes (also called as detectors) into a program on the basis of ensuring the original logic integrity of the tested program, and by executing the probes and throwing out characteristic data of program operation, and by analyzing the data, the control flow and data flow information of the program can be obtained, thereby realizing the test purpose.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention. The execution subject in fig. 1 may be a software testing system.
As shown in fig. 1, the method 100 includes:
step 110, inserting probes into source codes of the test software;
step 120, inputting simulation test data to a source code through the probe;
step 130, controlling the test software to run and executing the simulation test data;
step 140, capturing abnormal information of the running of the test software by monitoring the test software in real time;
and 150, confirming that the abnormal information is captured, and recording the probe position corresponding to the abnormal information and corresponding simulation test data.
Optionally, as an embodiment of the present invention, the inserting a probe into a source code of a test software includes:
setting a pile inserting strategy;
and inserting probes at corresponding positions of the source codes of the test software according to the instrumentation strategy.
Optionally, as an embodiment of the present invention, the inputting, by the probe, simulation test data into a source code includes:
collecting source code keywords of the probe position;
generating simulation test data according to the source code keywords;
inputting the simulated test data into a source code of the probe location.
Optionally, as an embodiment of the present invention, the recording the probe position and the corresponding simulation test data corresponding to the abnormal information includes:
acquiring abnormal information generation time;
recording the probe position corresponding to the generation time;
and collecting and recording the simulation test data input at the position of the corresponding probe.
In order to facilitate understanding of the present invention, the software testing method provided by the present invention is further described below with reference to the principle of the software testing method of the present invention and the software testing process performed in the embodiments.
Specifically, the software testing method comprises the following steps:
s1, inserting a probe into a source code of the test software.
And inserting probes at corresponding positions of the source codes according to the instrumentation strategy. I.e. the location of the subsequent analog test data input. Commonly used stake strategies are: branch override probe, statement override probe, conditional override probe.
And S2, inputting simulation test data to the source code through the probe.
Before software testing is executed, corresponding simulation data generation strategies need to be formulated according to different keywords needing to be tested in source codes. For example, if the source code contains a "name" source code segment, then the parameterized test data is performed on the name: numbers, characters, very long characters, null characters, chinese characters, special characters, etc. And storing all the preset simulation data generation strategies in a database. And when the software test is executed, acquiring source code keywords at the position of the probe, and calling corresponding simulation data from the database according to the acquired source code keywords to generate a strategy. And generating simulation test data according to the called simulation data generation strategy, and inputting the simulation test data into the source code at the position of the probe.
And S3, controlling the test software to run and executing the simulation test data.
And running test software, and calling corresponding simulation test data to be executed in cooperation with the probe.
And S4, capturing abnormal information of the running of the test software by monitoring the test software in real time. And confirming and capturing the abnormal information, and recording the probe position corresponding to the abnormal information and corresponding simulation test data.
And monitoring the software in real time by using a monitor, and capturing abnormal information generated when the test software runs. If the abnormal information is captured, the position of the probe and input simulation data when the abnormal information is generated are recorded, so that the subsequent abnormal reproduction and correction are facilitated.
As shown in fig. 2, the system 200 includes:
a probe insertion unit 210 configured to insert a probe in the test software source code;
a data input unit 220 configured to input analog test data to the source code through the probe;
a software running unit 230 configured to control the test software to run and execute the simulation test data;
an exception capture unit 240 configured to capture exception information of the running of the test software by monitoring the test software in real time;
and the information recording unit 250 is configured to confirm that the abnormal information is captured, and record the probe position corresponding to the abnormal information and corresponding simulation test data.
Optionally, as an embodiment of the present invention, the probe insertion unit includes:
the strategy setting module is configured for setting a pile inserting strategy;
and the probe inserting module is configured for inserting probes at corresponding positions of the test software source code according to the instrumentation strategy.
Optionally, as an embodiment of the present invention, the data input unit includes:
a code acquisition module configured to acquire source code keywords for a probe position;
the data generation module is configured to generate simulation test data according to the source code keywords;
a data input module configured to input the simulated test data into a source code of the probe location.
Optionally, as an embodiment of the present invention, the information recording unit includes:
the time acquisition module is configured to acquire abnormal information generation time;
the position recording module is configured to record the probe position corresponding to the generation time;
and the data recording module is configured for acquiring and recording the simulation test data input at the position corresponding to the probe.
Fig. 3 is a schematic structural diagram of a terminal system 300 according to an embodiment of the present invention, where the terminal system 300 may be used to execute the software testing method according to the embodiment of the present invention.
The terminal system 300 may include: a processor 310, a memory 320, and a communication unit 330. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as a Static Random Access Memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk. The executable instructions in memory 320, when executed by processor 310, enable terminal 300 to perform some or all of the steps in the method embodiments described below.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Therefore, the invention completes the automatic test of the software by traversing the source code of the tested software, inserting the simulated test data in the source code according to the instrumentation strategy, executing and executing through recording and tracking programs. That is, software vulnerabilities are detected by providing unexpected, random, or erroneous data as input, and the results of the anomalies are monitored for potential vulnerabilities that exist when the software crashes. The method can be used as an auxiliary means for testing by software testers, and the technical effects achieved by the embodiment can be referred to the description above, which is not repeated herein.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant points, reference may be made to the description in the method embodiment.
In the embodiments provided by the present invention, it should be understood that the disclosed system, system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection of systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A software testing method, comprising:
inserting probes into the source code of the test software;
inputting simulation test data to a source code through the probe;
controlling the test software to run and executing the simulation test data;
capturing abnormal information of the running of the test software by monitoring the test software in real time;
confirming that the captured abnormal information is captured, and recording the probe position corresponding to the abnormal information and corresponding simulation test data;
inputting simulation test data into the source code through the probe, comprising: before the software test is executed, aiming at different keywords to be tested in a source code, a corresponding simulation test data generation strategy is formulated, if the source code contains a 'name' source code segment, parameterized test data is generated for the name, and the method comprises the following steps: numbers, characters, ultra-long characters, null characters, chinese characters, special characters; storing all the pre-made simulation test data generation strategies to a database; when the software test is executed, acquiring source code keywords at the position of a probe, and calling corresponding simulation test data from a database according to the acquired source code keywords to generate a strategy; and generating simulation test data according to the called simulation test data generation strategy, and inputting the simulation test data into the source code at the position of the probe.
2. The method for testing software according to claim 1, wherein the inserting probes into the source code of the test software comprises:
setting a pile inserting strategy;
and inserting probes at corresponding positions of the source codes of the test software according to the instrumentation strategy.
3. The software testing method of claim 1, wherein the recording of probe positions and corresponding simulation test data corresponding to the anomaly information comprises:
acquiring abnormal information generation time;
recording the probe position corresponding to the generation time;
and collecting and recording the simulation test data input at the position of the corresponding probe.
4. A software testing system, comprising:
the probe inserting unit is configured to insert the probe into the test software source code;
the data input unit is configured to input simulation test data to the source code through the probe;
the software running unit is configured to control the test software to run and execute the simulation test data;
the abnormality capturing unit is configured to capture the abnormal information of the running of the test software by monitoring the test software in real time;
the information recording unit is configured to confirm that the abnormal information is captured, and record the probe position corresponding to the abnormal information and corresponding simulation test data;
inputting simulation test data into the source code through the probe, comprising: before software testing is executed, aiming at different keywords to be tested in a source code, a corresponding simulation test data generation strategy is formulated, if the source code contains a 'name' source code segment, parameterized test data is generated for the name, and the method comprises the following steps: numbers, characters, ultra-long characters, null characters, chinese characters, special characters; storing all the pre-made simulation test data generation strategies to a database; when the software test is executed, acquiring source code keywords at the position of a probe, and calling corresponding simulation test data from a database according to the acquired source code keywords to generate a strategy; and generating simulation test data according to the called simulation test data generation strategy, and inputting the simulation test data into the source code at the position of the probe.
5. The software testing system of claim 4, wherein the probe insertion unit comprises:
the strategy setting module is configured for setting a pile inserting strategy;
and the probe inserting module is configured for inserting probes at corresponding positions of the test software source code according to the instrumentation strategy.
6. The software testing system of claim 4, wherein the information recording unit comprises:
the time acquisition module is configured to acquire abnormal information generation time;
the position recording module is configured to record the probe position corresponding to the generation time;
and the data recording module is configured for acquiring and recording the simulation test data input at the position corresponding to the probe.
7. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-3.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-3.
CN201910814208.XA 2019-08-30 2019-08-30 Software testing method, system, terminal and storage medium Active CN110543420B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910814208.XA CN110543420B (en) 2019-08-30 2019-08-30 Software testing method, system, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910814208.XA CN110543420B (en) 2019-08-30 2019-08-30 Software testing method, system, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110543420A CN110543420A (en) 2019-12-06
CN110543420B true CN110543420B (en) 2023-01-10

Family

ID=68710931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910814208.XA Active CN110543420B (en) 2019-08-30 2019-08-30 Software testing method, system, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110543420B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948013B (en) * 2019-12-24 2023-10-10 深圳市明源云科技有限公司 Application probe configuration method and device, terminal equipment and storage medium
CN111061644B (en) * 2019-12-25 2021-04-30 南京大学 Method and device for detecting and positioning abnormal throwing processing defects
CN111813693B (en) * 2020-07-31 2023-06-06 南方科技大学 Software compatibility detection method, intelligent terminal and storage medium
CN114780958B (en) * 2022-04-14 2023-03-24 深圳开源互联网安全技术有限公司 Automatic pile inserting method and device for buried points and computer readable storage medium
CN114706794B (en) * 2022-06-06 2022-08-30 航天亮丽电气有限责任公司 Data processing system for production management software

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067798A (en) * 2007-06-14 2007-11-07 华南理工大学 Dynamic probe method and application in embedded system thereof
CN109783383A (en) * 2019-01-08 2019-05-21 郑州云海信息技术有限公司 A kind of code level method for testing software, device, terminal and storage medium
US10380350B1 (en) * 2019-01-15 2019-08-13 Cyberark Software Ltd. Efficient and comprehensive source code fuzzing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067798A (en) * 2007-06-14 2007-11-07 华南理工大学 Dynamic probe method and application in embedded system thereof
CN109783383A (en) * 2019-01-08 2019-05-21 郑州云海信息技术有限公司 A kind of code level method for testing software, device, terminal and storage medium
US10380350B1 (en) * 2019-01-15 2019-08-13 Cyberark Software Ltd. Efficient and comprehensive source code fuzzing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基本路径覆盖测试探针插桩技术研究;施冬梅;《计算机工程与设计》;20100716(第13期);全文 *

Also Published As

Publication number Publication date
CN110543420A (en) 2019-12-06

Similar Documents

Publication Publication Date Title
CN110543420B (en) Software testing method, system, terminal and storage medium
US9465718B2 (en) Filter generation for load testing managed environments
US11036507B2 (en) Processor testing using pairs of counter incrementing and branch instructions
US20070079288A1 (en) System and method for capturing filtered execution history of executable program code
CN111756575A (en) Performance analysis method and device of storage server and electronic equipment
CN107025167B (en) Method and apparatus for data flow analysis using compiler type information in processor trace logs
CN107710166A (en) Using checking after the silicon of the quick error detection of symbol and debug
CN108628734B (en) Functional program debugging method and terminal
CN110580220B (en) Method for measuring code segment execution time and terminal equipment
CN110287700B (en) iOS application security analysis method and device
CN110865941A (en) Interface test case generation method, device and system
CN110688173B (en) Positioning method and device of components in cross-platform interface framework and electronic equipment
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN112256532A (en) Test interface generation method and device, computer equipment and readable storage medium
CN109902001B (en) Method for detecting uninitialized variable and terminal equipment
CN111680463A (en) File checking method and device
CN111538665A (en) Program testing method and device, storage medium, and electronic device
CN110633199A (en) Testing apparatus, method, and medium for block chain supporting intelligent contract
CN115470141A (en) Fault simulation method, device and related equipment
CN114416596A (en) Application testing method and device, computer equipment and storage medium
CN111274143B (en) Buried point test method, buried point test device, buried point test equipment and storage medium
CN114218119A (en) Software abnormal flow testing method, system, terminal and storage medium
CN113806231A (en) Code coverage rate analysis method, device, equipment and medium
CN113868137A (en) Method, device and system for processing buried point data and server
CN109800114B (en) BMC visual test method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant