Introduction
Finding and fixing defects after software is built can be costly and slow. Preventing defects early helps save time, money, and improves product quality.
Imagine a chef preparing meals in a busy kitchen. If the chef trains the team well, follows clear recipes, checks dishes early, uses kitchen gadgets, and learns from past mistakes, the meals will be tasty and consistent.
┌───────────────────────────────┐ │ Defect Prevention │ ├─────────────┬─────────────────┤ │ Training & │ Process │ │ Education │ Improvement │ ├─────────────┼─────────────────┤ │ Early │ Automation │ │ Reviews │ Tools │ ├─────────────┴─────────────────┤ │ Root Cause Analysis │ └───────────────────────────────┘
def review_code(code):
defects_found = []
for line in code:
if 'TODO' in line:
defects_found.append('Unfinished task')
return defects_found
code_sample = ['print("Hello")', '# TODO: fix bug', 'return True']
defects = review_code(code_sample)
print(defects)
What will be the output after running this code?Pass the test and this pattern moves unknown