In accordance with the present invention, computer implemented methods and
systems are provided that allow an application to automatically recover
from software failures and attacks. Using one or more sensors, failures
may be detected in the application. In response to detecting the failure,
the portion of the application's code that caused the failure is
isolated. Using the input vectors that caused the failure, information
regarding the failure (e.g., the type of failure), a core dump file
(e.g., stack trace), etc., an emulator-based vaccine that repairs the
failure is constructed. In response to verifying that the vaccine
repaired the failure, the application is automatically updated with the
emulator-based vaccine without user intervention. Application community
features that efficiently use the resources available in software
monoculture is also provided. An application community may be defined
that includes a plurality of devices and the application's code may be
divided into smaller portions of code, which are assigned to each of the
plurality of devices for monitoring. Each device also notifies the other
devices of the failure.