A new algorithm for complex faults and object-oriented programming