0
0
Testing Fundamentalstesting~10 mins

Defect prevention strategies in Testing Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the primary goal of defect prevention.

Testing Fundamentals
def defect_prevention_goal():
    return "[1]"
Drag options to blanks, or click blank then click option'
AReduce defects before they occur
BFind defects after release
CIgnore defects
DIncrease defect count
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing options that focus on finding defects after release.
2fill in blank
medium

Complete the code to select a common defect prevention technique.

Testing Fundamentals
def defect_prevention_technique():
    return "[1]"
Drag options to blanks, or click blank then click option'
AIgnoring requirements
BSkipping tests
CCode reviews
DDelaying fixes
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing options that ignore or delay defect handling.
3fill in blank
hard

Fix the error in the code that applies defect prevention by using a checklist.

Testing Fundamentals
def apply_defect_prevention():
    checklist = ['requirements', 'design', 'code']
    for item in checklist:
        if item == '[1]':
            print('Check completed')
Drag options to blanks, or click blank then click option'
Atest
Breview
Cdeploy
Dcode
Attempts:
3 left
💡 Hint
Common Mistakes
Using a word not in the checklist for the condition.
4fill in blank
hard

Fill both blanks to complete the defect prevention code that logs defects and notifies the team.

Testing Fundamentals
def log_and_notify(defect):
    log = []
    log.append([1])
    if [2]:
        notify_team(defect)
Drag options to blanks, or click blank then click option'
Adefect.description
Bdefect.severity == 'high'
Cdefect.severity != 'low'
Ddefect.id
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect comparison operators or logging wrong defect attributes.
5fill in blank
hard

Fill all three blanks to create a defect prevention function that filters defects by type and counts them.

Testing Fundamentals
def count_defects(defects):
    filtered = [d for d in defects if d.type == [1]]
    count = len(filtered)
    return [2] + [3]
Drag options to blanks, or click blank then click option'
A'UI'
Bcount
C0
D'backend'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong defect types or incorrect return expressions.