The following self explanatory figure explains the life cycle of a defect: