0
0
Testing Fundamentalstesting~10 mins

Defect density and detection rate 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 calculate defect density given total defects and size.

Testing Fundamentals
defect_density = total_defects / [1]
Drag options to blanks, or click blank then click option'
Asize
Btotal_defects
Ctime
Dtest_cases
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing defects by time instead of size.
Using total defects twice in the calculation.
2fill in blank
medium

Complete the code to calculate defect detection rate given defects found and total defects.

Testing Fundamentals
detection_rate = defects_found / [1]
Drag options to blanks, or click blank then click option'
Adefects_found
Btotal_defects
Ctest_cases
Dtime_spent
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing defects found by defects found (always 1).
Using test cases or time instead of total defects.
3fill in blank
hard

Fix the error in the code to calculate defect density correctly.

Testing Fundamentals
defect_density = [1] / size
Drag options to blanks, or click blank then click option'
Asize
Bdefects_found
Ctime
Dtotal_defects
Attempts:
3 left
💡 Hint
Common Mistakes
Using size as numerator causing density to be 1.
Using defects found instead of total defects.
4fill in blank
hard

Fill both blanks to calculate defect detection rate as a percentage.

Testing Fundamentals
detection_rate = ([1] / [2]) * 100
Drag options to blanks, or click blank then click option'
Adefects_found
Btotal_defects
Ctest_cases
Dtime_spent
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping numerator and denominator.
Using test cases or time instead of defects counts.
5fill in blank
hard

Fill all three blanks to create a dictionary with defect density and detection rate.

Testing Fundamentals
metrics = {"density": [1] / [2], "detection": ([3] / total_defects) * 100}
Drag options to blanks, or click blank then click option'
Atotal_defects
Bsize
Cdefects_found
Dtime_spent
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up variables for density and detection.
Using time_spent instead of size or defects.