IMPLEMENTATION OF THRESHOLD-BASED DIAGNOSTIC MECHANISMS FOR COTS-BASED APPLICATIONS