A computer program product for use with a computer, the computer program product comprising a nontransitory computer usable storage medium having a computer readable program code embodied therein for preemptive detection of occurrence of one or more faulty conditions based on usage of one or more resources, the one or more faulty conditions are detected during an execution of a program, the program comprising at least one function, the computer readable program code storing a set of instructions comprising instructions for causing at least one computer processor to:
- a. initialize Application Program Interfaces (APIs) across the at least one function defined in the program;
- b. intercept calls to the APIs used within a namespace of the program, the interception being performed by the at least one function through extended method classes;
- c. check the usage of the one or more resources for the at least one function intercepting the APIs, the usage of the one or more resources being checked against a corresponding pre-determined threshold limit;
- d. identify context of the usage of the one or more resources based on a pre-defined knowledge;
- and
- e. determine the occurrence of the one or more faulty conditions based on the identification.