Method and system for testing and checking the correctness of a computer program during runtime
AssigneeB.G. Negev Technologies and Applications Ltd.
InventorsShlomi Dolev, Amit Rokach, Roman Manevich
Life of this patent
Estimating the term…
Abstract
The present invention is directed to a method and system for testing, during runtime, the correctness of a computer program (such as a hypervisor, an operating system or an interpreter) that controls a system and has one or more software modules. Accordingly, a reflexive code of a reflex function is integrated into the software modules or into a virtual infrastructure that executes the computer program. Whenever desired, the reflexive code is activated by an input and its corresponding output is processed. Then, the correctness of the one or more software modules or of the computer program is determined according to the processing results.
Claims15
A method for testing, during runtime, correctness of a computer program that controls a system and having one or more software modules, comprising the steps of:
- a) integrating a reflexive code of a reflex function into a code of said one or more software modules or into a virtual infrastructure that executes said computer program, said reflexive code is configured to verify the internal state and operation of said computer program and to provide, during runtime, on-demand indications regarding normal or abnormal operation of segments of said computer program;
- b) whenever desired or whenever the execution of one or more of said software modules is stuck, activating and executing said reflexive code by a system initiated input without interrupting the normal operation of said system or returning back to preceding instructions and regardless the current execution stage, and processing its corresponding output;
- and
- c) sequentially or parallelly determining the correctness of said one or more software modules of said computer program, according to processing results;
- d) forming an abstraction layer between a kernel and the program to be controlled and duplicated, for running the program in a lightweight container system, by:
- d.i) configuring a first container to mimic an environment of the program, to generate a clone environment;
- d.ii) redirecting inputs and outputs (I/O) to be controlled and examined by a second container, and monitoring the system I/O;
- d.iii) upon receiving a reflex request, replicating the system state to a different container;
- d.iv) activating said reflex function on said clone environment, while resuming the running of the first container,
- wherein on demand activation of the reflexive code for obtaining indications about whether or not for an executed code, a software module or a component functions properly is done sequentially or parallelly during runtime without affecting the program state, regardless where the program control currently is and regardless the current execution state of the said code, said software module or said software component, said on-demand activation is performed:
- i) on reflexive codes that have been already executed during said runtime, for obtaining indications about whether or not for an executed code, a software module or a component will function properly if re-executed during said runtime, or
- ii) on reflexive codes to be executed during said runtime, for obtaining indications about whether or not for an executed code, a software module or a component will function properly, before being executed during said runtime,
- wherein whenever said computer executes a software component, allowing any other program components to be checked on-demand during runtime, without affecting the program state and regardless where the program control is, while other runtime checks are directed to the component that is currently being executed.
A system for testing, during runtime, correctness of a computer program that controls a system and having one or more software modules, comprising:
- a) at least one processor with a memory that stores:
- a.1) an Injection Module, for performing instrumentation of said program and for adding reflexive capabilities, to generate an instrumented code;
- a.2) an Execution Module for receiving said instrumented code which will run the program alongside a Reflex Monitor Module;
- b) said Injection Module is further operative for:
- b.1) defining reflexive code to be inserted at a predetermined place within said computer program or said one or more software modules, said reflexive code is configured to verify the internal state and operation of said computer program and to provide, during runtime, on-demand indications regarding normal operation of segments of said computer program, wherein on-demand activation of said reflexive code for obtaining indications about whether or not for an executed code, a software module or a component of said computer program functions properly is done during runtime without affecting the program state, regardless where the program control currently is and regardless the current execution state of the said code, said software module or said software component, said on-demand activation is performed:
- i) on reflexive codes that have been already executed during said runtime, for obtaining indications about whether or not for an executed code, a software module or a component will function properly if re-executed during said runtime, or
- ii) on reflexive codes to be executed during said runtime, for obtaining indications about whether or not for an executed code, a software module or a component will function properly, before being executed during said runtime;
- b.2) whenever desired or whenever the execution of one or more of said software modules is stuck, activating and executing said reflexive code by a system initiated input without interrupting the normal operation of said system or returning back to preceding instructions and regardless the current execution stage, and processing its corresponding output;
- c) said execution module is further operative for running said computer program on the host system using all local configurations, such that reflex actions are unobtrusive to said computer program;
- d) a reflex monitor module for separating input arrival from functionality by listening to a reflex request and performing requested reflexive actions;
- and
- e) a verification module for checking correctness of user defined reflexive functions by producing reflexive functions according to formal specification of the computer program as an automata,
- wherein said at least one processor is adapted to form an abstraction layer between a kernel and the program to be controlled and duplicated, for running the program in a lightweight container system, by:
- i) configuring a first container to mimic an environment of the program, to generate a clone environment;
- ii) redirecting inputs and outputs (I/O) to be controlled and examined by a second container, and monitoring the system I/O;
- iii) upon receiving a reflex request, replicating the system state to a different container;
- iv) activating a reflex function on said clone environment, while resuming the running of the first container,
- wherein whenever said computer executes a software component, allowing any other program components to be checked on-demand sequentially or parallelly during runtime, without affecting the program state and regardless where the program control is, while other runtime checks are directed to the component that is currently being executed.
Dependencies are inferred from the claim text.