A primary purpose of testing is to detect software failures so that defects may be discovered and corrected.