Software - Implemented Self-healing System

The term “Self-healing” denotes the capability of a software system in dealing with bugs. Fault tolerance for dependable computing is to provide the specified service through rigorous design whereas self-healing is meant for run-time issues. The paper describes various issues on designing a self-healing software application system that relies on the on-the-fly error detection and repair of web application or service agent code and data. Self-Healing is a very new area of research that deals with fault tolerance for dynamic systems. Self-healing deals with imprecise specification, uncontrolled environment and reconfiguration of system according to its dynamics. Software, which is capable of detecting and reacting to its malfunctions, is called self-healing software. Such software system has the ability to examine its failures and to take appropriate corrections. Self-Healing system must have knowledge about its expected behavior in order to examine whether its actual behavior deviates from its expected behavior in relation of the environment. A fault-model of Self-Healing system is to state what faults or injuries to be self-healed including fault duration, fault source such as, operational errors, defective system requirements or implementation errors etc. Self-healing categories of aspects include fault-model or fault hypothesis, System-response, System-completeness and Design-context. Based on many important literatures, this paper aims also to illustrate critical points of the emergent research topic of Self – Healing Software System.


INTRODUCTION
The Self-healing term is used to mean to recover from run-time failures. A system needs to be able to notice an error or injury and then to act on it. In the field of software, an error or injury is identified usually as a failure of a participating machine. A failure can happen in its hardware or the software running on it or a malfunctioning communication connection. It is expected to repair itself in a logical way. Self-healing system needs to be able to discover, diagnose and try to react to bugs and failures. Self-healing components can detect system malfunctions and initiate policy-based corrective action without disrupting the environment. Corrective action may involve a product altering its own state or effecting changes in other components in the environment. The remaining part should try to find a way to continue work without the faulty part. Although there are many possible crashes in different systems, three normal problems are defective hardware, crashed software and broken connection. One of the monitoring mechanisms is using broadcasting. Each agent periodically broadcasts a message of aliveness to its neighbors, and keeps track of when it last heard a reply from its neighbors. If a neighbor is missing, the agent can trigger some response. This primitive mechanism contains a tradeoff. The frequency of aliveness messages from neighbors determines the speed with which faults can be detected and the lag in response time. Faster response time comes with a higher cost of communication. Crashes management can be carried out in many ways. If a site crashes, all data on this site is irrevocably lost. Therefore, we need this data to be copied in advance, so that a redundant copy can be fetched and used to continue work. An obvious solution is to duplicate all data, so that in the case of a crash the lost data still has a copy anyway. However, to accomplish this, a copy of all data must be sent immediately over the network, much communication overhead can be expected. Second approach is to keep all applied data in memory until they are executed and have on their part applied new data to others. So in case of a data loss, the missing executions could be redone. This would require a powerful and costly mechanism to decide which data can be deleted. System-response includes the aspects of fault detection, degree of degradation, fault response and an attempt to recovery action or compensation for a fault. Fault detection approaches involved in a self-healing system include application system's semantics-driven assertions [13,14], supervisory checks, examining the computing answers, comparison of replicated components, online self testing etc. System-completeness aspect deals with reality of knowledge limits, incompleteness in specifications and designs thereof. It also deals with the problem of system self-knowledge, system evolution etc. Handling the architectural incompleteness for example, of third-party components or of various patches during or after system deployment is really a challenging issue in developing a self-healing system. A self-healing approach is to run-time validate the various assertions that are derived from application semantics for designing a Self-healing system. The assertions are derived from the application domain specific knowledge of the system's expected behavior and Self-Healing [1,2,3,4,5,6,7,8,9,10,11,12] achieved by examining whether the system's actual behavior deviates from its expected behavior in relation of the system's environment. The proposed self-healing approach, as described in section 3.1, aims to detect errors on-the-fly in web application's or service agent's code and data and to automatically recover [17] them allowing a system to keep on computing after it has sustained an error that would normally require a restart.

SELF-HEALING SOFTWARE ARCHITECTURAL REQUIREMENTS
A Self-healing system has the ability to modify its own behavior in response to changes in its environment, such as resource variability, changing user needs, mobility, and system errors. A self-healing system's lifecycle has the following four major activities as described in [16]:-(a) Monitoring the system at runtime, (b) Planning the changes, (c) Deploying the change descriptions, and (d) Enacting the changes. Depending on the above mentioned activities, characteristics of existing architectural [7] issues, selfhealing systems have the following architectural requirements:-(a) Awareness: Supporting the monitoring of the system's performance (state, behavior, correctness, reliability, and so forth) and recognition of anomalies in that performance.
(b) Adaptability: Enabling modification of a system's static (structural and topological), dynamic (behavioral and interaction) and run-time aspects.
(c) Dynamicity: Encapsulating system adaptability during run-time (communication integrity and internal state consistency).
(d) Autonomy: Providing ability to address the anomalies as discovered through awareness and observability in the performance of a resulting system and / or its execution environment. Planning, deploying, and enacting the necessary changes can achieve autonomy. (e) Observability: Enabling the monitoring of a resulting self-healing system's execution environment. It is to be noted that the system might not be able to influence changes in its environment (say, re-establishing the failed network links), but it might plan changes within itself in response to the environment (say, performing in degraded mode until the network-link is reestablished).
(f) Robustness: Providing ability for a resulting system to effectively respond to unforeseen operating conditions those might be imposed by the system's external environment (such as, malicious attacks, unpredictable behavior of the system's runtime substrate, unintended system usage), as well as errors, faults, and failures within the system itself. This is to be noted that this definition of robustness subsumes fault-tolerance. (g) Distributability: Supporting effective performance of a resulting system in the face of different distribution or deployment profiles.
(h) Mobility: Providing the ability to dynamically change the (physical or logical) locations of a system's constituent elements.
(i) Traceability: Relating a system's architectural elements to the system's execution-level modules in order to enable change enactment in support of the above mentioned requirements.

SELF-HEALING SOFTWARE SYSTEM'S FAULTS & FIXES
In a typical multi-tier computing infrastructures [11] consisting of web applications and web services, we expect similar ubiquity and reliability from such services as that offered by the electricity grid and phone system. Recent studies [1,2,3,4,5,6,7,8,9,10,11,12] show that 72% of the top-40 web sites suffer uservisible failures, for example, items not being added to shopping carts or various error messages. Such failures occur because of various failures such as Java exception, deadlock threads, aging, source code bug etc. Some of the similar faults and their remedies or fixes [11] as observed in multi-tier J2EE services are stated in table 1. The self-healing part of web applications must deal with failures. The failures can be in both of system level and logical level. System failure can be the failure of say, medicine supplier's web services [5,15]. Logical failure say, can be the medicine supplier does not fulfill the order. After detecting these failures, the web services must be able to make an optimal choice and solve the problem by reconfiguration. However the important principle is the healing behavior must still obey to the policies we specified. For instance, if we set the policy as long-term relationship the solution would be to cancel the order instead of replacing the supplier. Healing mechanism must be created based on combinations of compensation, recovery and an optimization model for making an appropriate plan for healing. So, for designing a self-healing software system, we need to take care of application semantics also apart from other existing error or fault detection techniques. Based on the application's semantics, we need to produce assertions and to validate them during run-time against known set of test data too.

The Algorithmic Approach of On-the-fly Automatic_Error_Detection_Repair to Self-Healing Web Application Software
The following steps or pseudo-code describe how this on-the-fly Automatic_Error_Detection_Repair algorithm verifies for the presence of multiple data -errors in the web application or service agent code and data, and how it corrects the erroneous data of the contaminated agent code, by comparing an web application's state (using three copies of an web application service agent code and data that are injected at a host upon its arrival) byte by byte. The symbols "/* */" are to enclose remarks only. /* There are three images or replicas of an agent that are injected at a host. Byte-wise comparisons and corrections are carried out (using XOR) till the last byte of the copies. It verifies the corresponding three bytes at an offset say, d, of the three copies of the service agent code and if any byte error has occurred, then it repairs the corrupted byte. Starting addresses of the three images are known. The notation C 1 d denotes the d th byte (at an offset say, d) in the agent's first copy or Copy -1. */ Step 1. Set B = Size of an image in bytes. /* Size of an image in bytes is known*/ Step 2.
R 12  The possibility of getting inadvertently alteration (by transients) of two similar bytes in two copies (located at two distant locations) to mean a some other value resulting in a similar corrupted byte-pattern, is negligibly small. In other words the chances of byte error remaining undetected is:

(1 / ( 2 8 ))* (1 / ( 2 8 )) = 1 / ( 2 16 )
The above procedure verifies and recovers byte errors in the entire web application or service agent code and data, by increasing the value of offset d from 0 to B-1 (the size of an image is of say, B bytes). This is very effective for soft errors (induced during its transit or at reception at a host) detection and corrections of code and data prior to its execution on a host. After detecting and repairing the entire code and data, program control goes to start the execution of an agent's copy. This approach can detect 38% errors (i.e., fault coverage) in a typical fault injection (i.e., causing random bit errors) experiment, whereas hardware Error Detection Mechanisms (EDM) at a host could detect 26% errors. Even an entirely corrupted agent code can be repaired by this effective technique of self-healing that relies on this on-the-fly error detection and repair.

CONCLUSION
A useful algorithmic approach to on-the-fly automatic data error detection and recovery using moderate code and time redundancy of the order of 2.6, has been described in this paper. This paper has also described various important issues of designing a self-healing system based on available literatures. In order to develop an effective self-healing system model we must be conversant to all these points as described here. The proposed approach is an important one toward Self -Healing software design, which is a much research topic for developing reliable web services and web applications.