Complete the code to identify the primary goal of defect prevention.
def defect_prevention_goal(): return "[1]"
The main goal of defect prevention is to reduce defects before they occur in the software.
Complete the code to select a common defect prevention technique.
def defect_prevention_technique(): return "[1]"
Code reviews help catch defects early, which is a key defect prevention technique.
Fix the error in the code that applies defect prevention by using a checklist.
def apply_defect_prevention(): checklist = ['requirements', 'design', 'code'] for item in checklist: if item == '[1]': print('Check completed')
The checklist includes 'code', so the condition should check for 'code' to print the message.
Fill both blanks to complete the defect prevention code that logs defects and notifies the team.
def log_and_notify(defect): log = [] log.append([1]) if [2]: notify_team(defect)
The defect description is logged, and the team is notified only if severity equals 'high'.
Fill all three blanks to create a defect prevention function that filters defects by type and counts them.
def count_defects(defects): filtered = [d for d in defects if d.type == [1]] count = len(filtered) return [2] + [3]
The function filters defects of type 'UI', counts them, and returns the count plus zero (no offset).