CN107844420B - Binary online simulation and error checking method based on virtual machine snapshot - Google Patents

Binary online simulation and error checking method based on virtual machine snapshot Download PDF

Info

Publication number
CN107844420B
CN107844420B CN201711022557.5A CN201711022557A CN107844420B CN 107844420 B CN107844420 B CN 107844420B CN 201711022557 A CN201711022557 A CN 201711022557A CN 107844420 B CN107844420 B CN 107844420B
Authority
CN
China
Prior art keywords
virtual machine
mirror image
running
abnormal
images
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
CN201711022557.5A
Other languages
Chinese (zh)
Other versions
CN107844420A (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.)
Nanjing SAC Automation Co Ltd
Original Assignee
Nanjing SAC Automation 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 Nanjing SAC Automation Co Ltd filed Critical Nanjing SAC Automation Co Ltd
Priority to CN201711022557.5A priority Critical patent/CN107844420B/en
Publication of CN107844420A publication Critical patent/CN107844420A/en
Application granted granted Critical
Publication of CN107844420B publication Critical patent/CN107844420B/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/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/815Virtual
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/84Using snapshots, i.e. a logical point-in-time copy of the data

Landscapes

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

Abstract

The invention discloses a dichotomy online simulation and error checking method based on virtual machine snapshots, which comprises the following steps of: firstly, generating a No. 0 mirror image by using a software component to be subjected to online simulation and error checking and a software environment thereof; generating mutually independent multiple virtual machine running environment snapshots to form a virtual machine mirror image matrix; step three, sorting the snapshot mirror images of the virtual machine; step four, reducing the number of the snapshot images of the virtual machine by using a dichotomy; submitting the manual judgment of the fault reason; according to the method and the device, the characteristics of the virtual machine are fully utilized, the speed of fault recurrence is improved, different operation sequences of the same fault are analyzed manually, and the defect introduction point can be traced back, so that the position of the software defect possibly existing in the source code is pointed out.

Description

Binary online simulation and error checking method based on virtual machine snapshot
Technical Field
The invention relates to the technical field of software testing and fault positioning, in particular to a dichotomy online simulation and error checking method based on virtual machine snapshots.
Background
Due to the continuous development of virtualization technologies, most application scenarios can be realized by using virtualization technologies, as well as the debugging and testing environments of programs.
Software testing occupies a large amount of manpower and material resources in the software development process, and fault location is one of the behaviors with the highest payment cost in the testing. In the conventional method based on a single machine, a developer introduces a defect in a program, which causes an error state in the program, which in turn causes a program failure in the form of a perceptible external error. Then, the developer executes a failed test case, sets breakpoints repeatedly by using a debugger, and observes the program state until an error state occurs. Then deducing possible infection sources, positioning the defect position, verifying and correcting the software defect.
This conventional approach often requires program debuggers to simulate inputs, outputs one and the same time in order to get the program into the portion of the code where the problem is likely to occur, and also requires a significant amount of time to repeat the test if the problem is associated with runtime. The most fatal problem is that in the traditional method, in the process of repeatedly debugging from the beginning for a plurality of times, the problem that the debugging can not be repeated again exists or the phenomenon that the debugging is repeated is different every time, and the simulation and the test are difficult. The reason is mainly that in a multi-process and multi-thread environment of an operating system, due to uncertainty of external I/O delay and the like, scheduling of the operating system also has uncertainty, so that execution sequences of defective codes are inconsistent, and finally some problems cannot be reproduced reliably, so that the defect problems are difficult to locate and process.
Virtual machine technology may capture and store a snapshot of a running "machine," which is the state of the virtual machine at a particular time, including the hardware state, software state, operating system state, file system state, memory state, etc. of the machine. This captured state of the "in motion" machine has a complete context of the running state. The virtual machine can then be restored to any previous state by applying the corresponding snapshot to the virtual machine.
The market needs an online simulation and error checking method which can fully utilize the characteristics of a virtual machine, improve the speed of recurring faults, facilitate manual analysis of different running sequences of the same fault and trace back to a defect introduction point so as to point out the possible positions of software defects in source codes, and the invention solves the problems.
Disclosure of Invention
In order to solve the defects of the prior art, the invention aims to provide a dichotomy online simulation and error checking method based on virtual machine snapshots.
In order to achieve the above object, the present invention adopts the following technical solutions:
a dichotomy online simulation and error checking method based on virtual machine snapshots comprises the following steps:
firstly, generating a No. 0 mirror image by using a software component to be subjected to online simulation and error checking and a software environment thereof;
a) deploying a software component to be subjected to online simulation and debugging, a set target operating system, a set third-party soft environment, network initial configuration and a target program system in a virtual machine management platform;
b) deploying a stub code script program;
c) taking the virtual mechanism as an initial virtual machine mirror image, which is called as a No. 0 mirror image;
step two: generating mutually independent multiple virtual machine running environment snapshots to form a virtual machine mirror image matrix;
a) let the probability of the occurrence of a question be p, p ∈ (0, 1)]Deploying, in order to guarantee probability reproduction
Figure GDA0002523509480000021
A number of engineering instances; where k is a reliability parameter, k>0;
b) Deploying multiple No. 0 mirror image instances by using a virtual machine management API (application programming interface), and deploying a related virtual network environment; instantiating the mirror image No. 0 into a running state virtual machine;
c) for each mirror image instance No. 0, performing remote SSH control by using a management machine, and starting a stub code program running in the virtual machine instance;
d) after the pile code is started, the time when the target software starts to run is called as the respective 0 time, and a virtual machine snapshot is established for the target software, namely the 0 time virtual machine snapshot; if N mirror image instances of 0 are provided, S ═ S is generated01,S02,S03....S0N]The virtual machine snapshot cluster;
e) in the running process of the virtual machine, the management machine is arranged at time intervals T0Snapshotting the N virtual machines at regular time, and forming corresponding No. 1 mirror image instance, No. 2 mirror image instance and No. 3 mirror image instance … … N mirror image instance;
f) after a certain virtual machine runs for a period of time and program interruption or other abnormal behaviors to be debugged occur, recording the running working condition of the virtual machine at the running moment by the pile code, reporting the running working condition to the management machine in a communication mode, and closing the running of the virtual machine by the management machine; setting the virtual machine image number recorded before as I, and setting the virtual machine image at the time of operation error as an I +1 image;
g) waiting time TmaxThen, part of the virtual machine reappears at TmaxBefore or TmaxIf the other part of the virtual machines fails to successfully reproduce the fault, a virtual machine mirror image matrix shown as the following is formed; wherein K is Tmax/T0
Figure GDA0002523509480000031
Wherein T is not reached due to partial virtual machine instance runningmaxThe fault is reproduced, this time S after this point in timexyMirror is set to null, SxyRepresenting a virtual machine mirror image, wherein x is a row of a virtual machine mirror image matrix, and y is a column of the virtual machine mirror image matrix;
h) the management machine identifies the position of the program exception according to the stub code and confirms the exception as a target exception according to a preset index;
step three: sorting the snapshot mirror images of the virtual machine;
a) the management machine sets the mirror image S corresponding to the virtual machine with the abnormal reproduction as S abnormalx1,Sx2,Sx3....SxN]Reserve, will reach TmaxNormally deleting the mirror image S corresponding to the abnormal virtual machine when the abnormal virtual machine is not reproduced;
b) setting the mirror image set of the virtual machine with the fault as MfailFor each virtual machine image found to be abnormal i ∈ MfailIs provided with Sx1,Sx2,Sx3..SxkNot empty, Sx(k+1)If the number is null, the supervisor will Sx1-Sx,middleImage deletion, wherein midle ═ UpperRound (k/2); UpperRound is a value which is more than or equal to the minimum integer of k/2; then restoring S in the original virtual machine instancex,middleMirroring;
step four: the number of the snapshot images of the virtual machine is reduced progressively by utilizing a dichotomy;
a) ensuring that each virtual machine image with abnormal recurrence enters the next iteration, and taking out S of each virtual machine image i with abnormal recurrencex,middleMirroring and deploying at least 1 running instance; and after all abnormal virtual machine images are deployed, the abnormal virtual machine images still do not reach
Figure GDA0002523509480000041
When the number of the engineering instances is multiple, deploying the running environment of the residual number of the virtual machines which does not reach the number of the running instances of the virtual machines, wherein the mirror images adopted by the running environment are the mirror images of all the virtual machines which are found to be abnormal;
b) it is necessary to ensure that all exception-discovered virtual machine images are deployed at least equal to or greater than
Figure GDA0002523509480000042
A number of engineering instances;
c) for each utilization stub code implementation pair Sx,middleSubsequent input and output operations; and performing actual simulation operation as shown in e) -g) in the step two, wherein T is not reached due to partial virtual machine instance operationmaxThe fault is reproduced, this time S after this point in timexyThe mirror image is set to null; the virtual machine mirror image matrix S, S can be generated again according to the method of the third stepx,0-Sx,middleAn example is empty;
step five: submitting the fault causes for manual judgment;
a) when the number of the mirror image sets of a certain virtual machine which is not empty is found to be less than 100 samples, and the virtual machine enters a fault state; restoring all the images meeting the condition to the target virtual machine;
b) and submitting the information logs collected by the secondary stub codes of the virtual machines to manual analysis, and providing a virtual machine mirror image matrix for manual reduction test and debugging.
In the binary online simulation and error checking method based on the virtual machine snapshot, the function of the stub code includes: starting a target program; monitoring relevant software operation conditions; simulating related network communication, command input and human-computer interface input according to a set script; and generating the memory and call stack information of the target program crash point.
The dichotomy online simulation and error checking method based on the virtual machine snapshot comprises the following software operation conditions: memory occupation, CPU load, disk I/O, program crash intercept.
In the above dichotomy online simulation and error checking method based on virtual machine snapshot, in the second step, the probability of problem occurrence is p, p ∈ (0, 1)]To ensure probability recurrence, deployments may be made
Figure GDA0002523509480000051
A number of engineering instances; wherein k is a reliability parameter, and k is greater than or equal to 5.
In the binary online simulation and error checking method based on the virtual machine snapshot, in the second step, the virtual machine management API performs snapshot management by using functions provided by LibVirt and Qemu.
The binary method online simulation and error checking method based on the virtual machine snapshot,
step four: the number of the snapshot images of the virtual machine is reduced progressively by utilizing a dichotomy;
a) in order to ensure a certain recurrence rate, S of each abnormal virtual machine image i is taken outx,middleMirroring and deploying at least 1 running instance; and after all abnormal virtual machine images are deployed, the abnormal virtual machine images still do not reach
Figure GDA0002523509480000052
When the number of the engineering instances is multiple, deploying the running environments of the residual number of the virtual machines which do not reach the number of the running instances of the virtual machines, wherein the images adopted by the running environments are the images of all the virtual machines which are found to be abnormal;
b) virtual machine images needing to ensure that deployment discovery exception is at least greater than or equal to
Figure GDA0002523509480000053
A number of engineering instances;
c) for each utilization stub code implementation pair Sx,middleSubsequent input and output operations; and performing actual simulation operation as shown in e) -g) in the step two, wherein T is not reached due to partial virtual machine instance operationmaxThe fault is reproduced, this time S after this point in timexyThe mirror image is set to null; the virtual machine mirror image matrix S, S can be generated again according to the method of the third stepx,0-Sx,middleAn example is empty;
d) and repeating the contents of a) to c) in the third step and the fourth step to ensure that the possible virtual machine image instances can be further reduced.
In the fifth step, when the number of the mirror image sets of a certain virtual machine which is not empty is found to be less than 100 samples, and the virtual machine enters a fault state; restoring all the images meeting the condition to the target virtual machine; the judgment condition for the virtual machine to enter the fault state is as follows: and judging to enter a fault state when the running time of the virtual machine is less than 1 minute.
The invention has the advantages that: the invention provides a dichotomy online simulation and error checking method based on virtual machine snapshots, which utilizes the snapshot function of a virtual machine and the state information of a test case by fully utilizing the characteristics of the virtual machine; the method and the device have the advantages that the speed of reproducing the fault is improved, different operation sequences (located in different virtual machine instances of a fault point) of the same fault can be analyzed manually, and the defect introduction point can be traced back, so that the position of the software defect possibly existing in the source code can be pointed out. By the design, the software productivity and the software quality are greatly improved, and meanwhile, the characteristics of the computing resources of the modern pooled virtual machines are fully utilized, namely the number of deployed instances can be enough, and when the resource pool is large enough, as long as the sum of the running time of all instances is approximately equal to the cost of the virtual machine when the same instance and the same model machine are run; the method can reduce the use of an integral machine, thereby reducing the cost.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention;
FIG. 2 is a deployment process diagram of an embodiment of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and the embodiments.
As shown in fig. 1, a binary method online simulation and error checking method based on virtual machine snapshot includes the following steps:
firstly, generating a No. 0 mirror image by using a software component to be subjected to online simulation and error checking and a software environment thereof;
a) deploying a target operating system to be subjected to online simulation and debugging and well set, a third-party soft environment, network initial configuration and a target program system in a virtual machine management platform;
b) deploying a stub code script program; it should be noted that: the functions of the stub code include: starting a target program; monitoring relevant software operation conditions; simulating related network communication, command input and human-computer interface input according to a set script; and generating the memory of the collapse point of the target program and the call stack situation information. The software operation conditions comprise: memory occupation, CPU load, disk I/O, program crash intercept.
c) The virtual mechanism is used as an initial virtual machine image and is called as a No. 0 image.
Step two: generating mutually independent multiple virtual machine running environment snapshots to form a virtual machine mirror image matrix;
a) let the probability of the occurrence of a question be p, p ∈ (0, 1)]Deploying, in order to guarantee probability reproduction
Figure GDA0002523509480000071
A number of engineering instances; where k is a reliability parameter, k>0; as an example of engineering practice, k is greater than or equal to 5; however, in the principle of the patent, no limitation is made on the value of k, and the value of k should be related to factors such as actual hardware resources, problem reproduction difficulty, human resource consumption degree and the like;
b) deploying multiple No. 0 mirror image instances by using a virtual machine management API (application programming interface), and deploying a related virtual network environment; instantiating the mirror image No. 0 into a running state virtual machine; as an embodiment, the virtual machine management API performs snapshot management by using functions provided by LibVirt and Qemu; it should be noted that the method presented in the example is only an example of the virtual machine management API, and the manner described in this patent may be controlled according to the API provided by the virtualized software and hardware environment that is actually running.
c) For each mirror image instance No. 0, performing remote SSH control by using a management machine, and starting a stub code program running in the virtual machine instance;
d) after the pile code is started, the time when the target software starts to run is called 0 time respectively, and a virtual machine snapshot, namely the virtual machine snapshot at the time 0, is established for the target software; if N mirror image instances of 0 are provided, S ═ S is generated01,S02,S03....S0N]The virtual machine snapshot cluster;
e) in the running process of the virtual machine, the management machine is arranged at time intervals T0Snapshotting the N virtual machines at regular time, and forming corresponding No. 1 mirror image instance, No. 2 mirror image instance and No. 3 mirror image instance … … N mirror image instance;
f) after a certain virtual machine runs for a period of time and program interruption or other abnormal behaviors to be debugged occur, recording the running working condition of the virtual machine at the running moment by the pile code, reporting the running working condition to the management machine in a communication mode, and closing the running of the virtual machine by the management machine; setting the virtual machine image number recorded before as I, and setting the virtual machine image at the time of operation error as an I +1 image;
g) waiting time TmaxThen, part of the virtual machine reappears at TmaxBefore or TmaxIf the other part of the virtual machines fails to successfully reproduce the fault, a virtual machine mirror image matrix shown as the following is formed; wherein K is Tmax/T0
Figure GDA0002523509480000081
Wherein part of the virtual machine instance is not runningTo TmaxThe fault is reproduced, this time S after this point in timexyMirror is set to null, SxyRepresenting a virtual machine mirror image, wherein x is a row of a virtual machine mirror image matrix, and y is a column of the virtual machine mirror image matrix;
h) the management machine identifies the position of the program exception according to the stub code and confirms the exception as a target exception according to a preset index;
step three: sorting the snapshot mirror images of the virtual machine;
a) the management machine sets the mirror image S corresponding to the virtual machine with the abnormal reproduction as S abnormalx1,Sx2,Sx3....SxN]Reserve, will reach TmaxThe mirror image S corresponding to the abnormal virtual machine is normally deleted when the time is still not repeated;
b) setting a virtual machine set with a recurring fault as MfailFor each virtual machine image found to be abnormal i ∈ MfailIs provided with Sx1,Sy2,Sx3..SxkNot empty, Sx(k+1)If the number is null, the supervisor will Sx1-Sx,middleImage deletion, wherein midle ═ UpperRound (k/2); UpperRound is a value which is more than or equal to the minimum integer of k/2; then restoring S in the original virtual machine instancex,middleMirroring;
step four: the number of the snapshot images of the virtual machine is reduced progressively by utilizing a dichotomy;
a) in order to ensure that each virtual machine image with abnormal recurrence enters the next iteration, S of each virtual machine i with abnormal recurrence is taken outx,middleMirroring and deploying at least 1 running instance; and after all abnormal virtual machine images are deployed, the abnormal virtual machine images still do not reach
Figure GDA0002523509480000091
When the number of the engineering instances is multiple, deploying the running environment of the residual number of the virtual machines which does not reach the number of the running instances of the virtual machines, wherein the mirror images adopted by the running environment are the mirror images of all the virtual machines which are found to be abnormal;
b) it is necessary to ensure that all of the abnormally discovered mirror-image deployed virtual machines are at least equal to or greater than
Figure GDA0002523509480000092
A number of engineering instances;
c) for each utilization stub code implementation pair Sx,middleSubsequent input and output operations; for each utilization stub code implementation pair Sx,middleSubsequent input and output operations; and performing actual simulation operation as shown in e) -g) in the step two, wherein T is not reached due to partial virtual machine instance operationmaxThe fault is reproduced, this time S after this point in timexyThe mirror image is set to null; the virtual machine mirror image matrix S, S can be generated again according to the method of the third stepx,0-Sx,middleAn example is empty;
d) repeating the contents of steps three and a) -c) in step four, which ensures that the possible instances of the virtual machine image, i.e. the virtual machine image whose instance is not empty, can be further reduced.
Step five: submitting the fault causes for manual judgment;
a) when the number of the images of a certain virtual machine which is not empty is found to be less than 100 samples, and the virtual machine enters a fault state; restoring all the mirror images meeting the conditions to the target virtual machine; the judgment condition for the virtual machine to enter the fault state is as follows: and judging to enter a fault state when the running time of the virtual machine is less than 1 minute.
b) And submitting the information logs collected by the past stub codes of the virtual machines to manual analysis, and providing a virtual machine mirror image matrix (mostly set to be empty) for manual recovery testing and debugging.
As shown in fig. 2, the deployment process of the method specifically includes:
a) in a virtual machine management platform, a target operating system to be simulated and debugged on line and set, a third-party soft environment, network initial configuration and a target program system are deployed.
b) Deploying stub code scripts or programs. The function of the stub code is to start the target program and monitor the relevant software operating conditions (memory usage, CPU load, disk I/O, program crash intercept, etc.). For the requirement of on-line simulation, if necessary, the stub code simulates related network communication, command input, human-computer interface input and other operations according to a set script. Of particular importance, stub code will generate memory and call stack information for the point of target program crash.
c) The virtual mechanism is used as an initial virtual machine image and is called as a No. 0 image.
d) In order to ensure the recurrence of the problems, the scheme requires the deployment of a plurality of identical operation environment instances, and the probability of the occurrence of the problems is set as p, p ∈ (0, 1)]. To ensure that problems are replicated with a certain probability, deployments may be made
Figure GDA0002523509480000101
Number of engineering instances. Where k is a reliability parameter, k>0. As one proposal of engineering practice, k is equal to or greater than 5.
e) Deploying the multiple No. 0 mirror image instances by using a virtual machine management API, and deploying a related virtual network environment; image number 0 is instantiated as a running state virtual machine.
f) And for each mirror image instance No. 0, starting a stub code program running in the virtual machine instance by using a mode of performing remote SSH control and the like by using a management machine.
g) After the pile code is started, the time when the target software starts to run is called 0 time respectively, and a virtual machine snapshot, namely the virtual machine snapshot at the time 0, is established for the target software; if N mirror image instances of 0 are provided, S ═ S is generated01,S02,S03....S0N]The virtual machine snapshot cluster.
The invention provides a dichotomy online simulation and error checking method based on virtual machine snapshots, which utilizes the snapshot function of a virtual machine and the state information of a test case by fully utilizing the characteristics of the virtual machine; the method and the device have the advantages that the speed of reproducing the fault is improved, different operation sequences (located in different virtual machine instances of a fault point) of the same fault can be analyzed manually, and the defect introduction point can be traced back, so that the position of the software defect possibly existing in the source code can be pointed out. By the design, the software productivity and the software quality are greatly improved, and meanwhile, the characteristics of the computing resources of the modern pooled virtual machines are fully utilized, namely the number of deployed instances can be enough, and when the resource pool is large enough, as long as the sum of the running time of all instances is approximately equal to the cost of the virtual machine when the same instance and the same model machine are run; the method can reduce the use of an integral machine, thereby reducing the cost.
The foregoing illustrates and describes the principles, general features, and advantages of the present invention. It should be understood by those skilled in the art that the above embodiments do not limit the present invention in any way, and all technical solutions obtained by using equivalent alternatives or equivalent variations fall within the scope of the present invention.

Claims (7)

1. A dichotomy online simulation and error checking method based on virtual machine snapshots is characterized by comprising the following steps:
firstly, generating a No. 0 mirror image by using a software component to be subjected to online simulation and error checking and a software environment thereof;
a) deploying a software component to be subjected to online simulation and debugging, a set target operating system, a set third-party soft environment, network initial configuration and a target program system in a virtual machine management platform;
b) deploying a stub code script program;
c) taking the virtual mechanism as an initial virtual machine mirror image, which is called as a No. 0 mirror image;
step two: generating mutually independent multiple virtual machine running environment snapshots to form a virtual machine mirror image matrix;
a) let the probability of the occurrence of a question be p, p ∈ (0, 1)]Deploying, in order to guarantee probability reproduction
Figure FDA0002523509470000011
A number of engineering instances; where k is a reliability parameter, k>0;
b) Deploying multiple No. 0 mirror image instances by using a virtual machine management API (application programming interface), and deploying a related virtual network environment; instantiating the mirror image No. 0 into a running state virtual machine;
c) for each mirror image instance No. 0, performing remote SSH control by using a management machine, and starting a stub code program running in the virtual machine instance;
d) start stake codeThen, the time when the target software starts to run is called as the respective 0 time, and a virtual machine snapshot is established for the target software, namely the 0 time virtual machine snapshot; if N mirror image instances of 0 are provided, S ═ S is generated01,S02,S03....S0N]The virtual machine snapshot cluster;
e) in the running process of the virtual machine, the management machine is arranged at time intervals T0Snapshotting the N virtual machines at regular time, and forming corresponding No. 1 mirror image instance, No. 2 mirror image instance and No. 3 mirror image instance … … N mirror image instance;
f) after a certain virtual machine runs for a period of time and program interruption or other abnormal behaviors to be debugged occur, recording the running working condition of the virtual machine at the running moment by the pile code, reporting the running working condition to the management machine in a communication mode, and closing the running of the virtual machine by the management machine; setting the virtual machine image number recorded before as I, and setting the virtual machine image at the time of operation error as an I +1 image;
g) waiting time TmaxThen, part of the virtual machine reappears at TmaxBefore or TmaxIf the other part of the virtual machines fails to successfully reproduce the fault, a virtual machine mirror image matrix shown as the following is formed; wherein K is Tmax/T0
Figure FDA0002523509470000021
Wherein T is not reached due to partial virtual machine instance runningmaxThe fault is reproduced, this time S after this point in timexyMirror is set to null, SxyRepresenting a virtual machine mirror image, wherein x is a row of a virtual machine mirror image matrix, and y is a column of the virtual machine mirror image matrix;
h) the management machine identifies the position of the program exception according to the stub code and confirms the exception as a target exception according to a preset index;
step three: sorting the snapshot mirror images of the virtual machine;
a) the management machine sets the mirror image S corresponding to the virtual machine with the abnormal reproduction as S abnormalx1,Sx2,Sx3....SxN]Reserve, will reach TmaxNormally deleting the mirror image S corresponding to the abnormal virtual machine when the abnormal virtual machine is not reproduced;
b) setting the mirror image set of the virtual machine with the fault as MfailFor each virtual machine image found to be abnormal i ∈ MfailIs provided with Sx1,Sx2,Sx3..SxkNot empty, Sx(k+1)If the number is null, the supervisor will Sx1-Sx,middleImage deletion, wherein midle ═ UpperRound (k/2); UpperRound is a value which is more than or equal to the minimum integer of k/2; then restoring S in the original virtual machine instancex,middleMirroring;
step four: the number of the snapshot images of the virtual machine is reduced progressively by utilizing a dichotomy;
a) ensuring that each virtual machine image with abnormal recurrence enters the next iteration, and taking out S of each virtual machine image i with abnormal recurrencex,middleMirroring and deploying at least 1 running instance; and after all abnormal virtual machine images are deployed, the abnormal virtual machine images still do not reach
Figure FDA0002523509470000031
When the number of the engineering instances is multiple, deploying the running environment of the residual number of the virtual machines which does not reach the number of the running instances of the virtual machines, wherein the mirror images adopted by the running environment are the mirror images of all the virtual machines which are found to be abnormal;
b) it is necessary to ensure that all exception-discovered virtual machine images are deployed at least equal to or greater than
Figure FDA0002523509470000032
A number of engineering instances;
c) for each utilization stub code implementation pair Sx,middleSubsequent input and output operations; and performing actual simulation operation as shown in e) -g) in the step two, wherein T is not reached due to partial virtual machine instance operationmaxThe fault is reproduced, this time S after this point in timexyThe mirror image is set to null; the virtual machine mirror image matrix S, S can be generated again according to the method of the third stepx,0-Sx,middleExample is empty;
Step five: submitting the fault causes for manual judgment;
a) when the number of the mirror image sets of a certain virtual machine which is not empty is found to be less than 100 samples, and the virtual machine enters a fault state; restoring all the images meeting the condition to the target virtual machine;
b) and submitting the information logs collected by the secondary stub codes of the virtual machines to manual analysis, and providing a virtual machine mirror image matrix for manual reduction test and debugging.
2. The binary online simulation and error-checking method based on the virtual machine snapshot according to claim 1, wherein the functions of the stub code include: starting a target program; monitoring relevant software operation conditions; simulating related network communication, command input and human-computer interface input according to a set script; and generating the memory and call stack information of the target program crash point.
3. The dichotomy online simulation and error checking method based on the virtual machine snapshot according to claim 2, wherein the software operation condition comprises: memory occupation, CPU load, disk I/O, program crash intercept.
4. The binary online simulation and error-checking method based on virtual machine snapshot as claimed in claim 1, wherein in the second step, the probability of problem occurrence is set as p, p ∈ (0, 1)]To ensure probability recurrence, deployments may be made
Figure FDA0002523509470000041
A number of engineering instances; wherein k is a reliability parameter, and k is greater than or equal to 5.
5. The binary online simulation and error-checking method based on virtual machine snapshots as claimed in claim 1, wherein in step two, the virtual machine management API utilizes functions provided by LibVirt and Qemu to perform snapshot management.
6. The binary online simulation and error-checking method based on virtual machine snapshot according to claim 1,
step four: the number of the snapshot images of the virtual machine is reduced progressively by utilizing a dichotomy;
a) in order to ensure a certain recurrence rate, S of each abnormal virtual machine image i is taken outx,middleMirroring and deploying at least 1 running instance; and after all abnormal virtual machine images are deployed, the abnormal virtual machine images still do not reach
Figure FDA0002523509470000042
When the number of the engineering instances is multiple, deploying the running environments of the residual number of the virtual machines which do not reach the number of the running instances of the virtual machines, wherein the images adopted by the running environments are the images of all the virtual machines which are found to be abnormal;
b) virtual machine images needing to ensure that deployment discovery exception is at least greater than or equal to
Figure FDA0002523509470000043
A number of engineering instances;
c) for each utilization stub code implementation pair Sx,middleSubsequent input and output operations; and performing actual simulation operation as shown in e) -g) in the step two, wherein T is not reached due to partial virtual machine instance operationmaxThe fault is reproduced, this time S after this point in timexyThe mirror image is set to null; the virtual machine mirror image matrix S, S can be generated again according to the method of the third stepx,0-Sx,middleAn example is empty;
d) and repeating the contents of a) to c) in the third step and the fourth step to ensure that the possible virtual machine image instances can be further reduced.
7. The dichotomy online simulation and error checking method based on the virtual machine snapshot according to claim 1, wherein in the fifth step, when the number of the mirror image sets that a certain virtual machine is not empty is found to be less than 100 samples, and the virtual machine enters a fault state; restoring all the images meeting the condition to the target virtual machine; the judgment condition for the virtual machine to enter the fault state is as follows: and judging to enter a fault state when the running time of the virtual machine is less than 1 minute.
CN201711022557.5A 2017-10-27 2017-10-27 Binary online simulation and error checking method based on virtual machine snapshot Active CN107844420B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711022557.5A CN107844420B (en) 2017-10-27 2017-10-27 Binary online simulation and error checking method based on virtual machine snapshot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711022557.5A CN107844420B (en) 2017-10-27 2017-10-27 Binary online simulation and error checking method based on virtual machine snapshot

Publications (2)

Publication Number Publication Date
CN107844420A CN107844420A (en) 2018-03-27
CN107844420B true CN107844420B (en) 2020-08-28

Family

ID=61662926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711022557.5A Active CN107844420B (en) 2017-10-27 2017-10-27 Binary online simulation and error checking method based on virtual machine snapshot

Country Status (1)

Country Link
CN (1) CN107844420B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779094A (en) * 2012-08-21 2012-11-14 深圳中兴网信科技有限公司 Terminal and software exception test method
CN102799522A (en) * 2012-06-28 2012-11-28 浪潮(北京)电子信息产业有限公司 Managing method and system for software version tracing test
CN103365741A (en) * 2012-03-30 2013-10-23 伊姆西公司 Method and equipment for snapshot and recovery of virtual machine cluster

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9846637B2 (en) * 2015-12-02 2017-12-19 Fujitsu Limited Machine learning based software program repair

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103365741A (en) * 2012-03-30 2013-10-23 伊姆西公司 Method and equipment for snapshot and recovery of virtual machine cluster
CN102799522A (en) * 2012-06-28 2012-11-28 浪潮(北京)电子信息产业有限公司 Managing method and system for software version tracing test
CN102779094A (en) * 2012-08-21 2012-11-14 深圳中兴网信科技有限公司 Terminal and software exception test method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种快速定位bug的记录-回放调试***;江山等;《计算机应用与软件》;20161031;第33卷(第10期);第219-237页 *

Also Published As

Publication number Publication date
CN107844420A (en) 2018-03-27

Similar Documents

Publication Publication Date Title
JP7209034B2 (en) Edge computing test method, apparatus, equipment and readable storage medium
US8352907B2 (en) Software application recreation
US7398514B2 (en) Test automation stack layering
US9047413B2 (en) White-box testing systems and/or methods for use in connection with graphical user interfaces
US8276127B2 (en) Devices, methods and computer program products for reverse execution of a simulation
US20150058826A1 (en) Systems and methods for efficiently and effectively detecting mobile app bugs
US9075915B2 (en) Managing window focus while debugging a graphical user interface program
WO2019056720A1 (en) Automated test case management method and apparatus, device, and storage medium
WO2021029952A1 (en) Data race analysis based on altering function internal loads during time-travel debugging
WO2016160190A1 (en) Technologies for application validation in persistent memory systems
CN113590454A (en) Test method, test device, computer equipment and storage medium
CN102073590B (en) Event simulation-based user interface test method and device
JP2010539577A (en) Method for processing the amount of information handled during the debug phase of airborne operations software and device for implementing the method
CN114168454B (en) Asynchronous testing method based on dynamic pile inserting-pile pinning technology
CN107844420B (en) Binary online simulation and error checking method based on virtual machine snapshot
Side et al. A debugger for distributed programs
US20240004780A1 (en) Parallel execution during application debugging
CN112015650B (en) Event testing method and device based on computer vision
CN115391084B (en) Intelligent solution method and system for cloud game abnormity
Liu Research on Graphic User Interface Automation Testing Technology Based on Cloud Platform
CN118035070A (en) Reliability design verification method for large complex software equipment
CN116339904A (en) Hardware-assisted virtualization instruction simulation error detection method and system
CN103092756B (en) A kind of interactive automation test system and method thereof
CN117130891A (en) Parallelization acceleration method of simulation model
Wu et al. Intelligent Software Testing based on Visual Feedback

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