0
0
Testing Fundamentalstesting~20 mins

Cost of bugs at different stages in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bug Cost Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Cost impact of fixing bugs in different stages

Which stage typically incurs the highest cost to fix a software bug?

ADuring the requirements gathering phase
BDuring the design phase
CAfter the software has been released to customers
DDuring the coding phase
Attempts:
2 left
💡 Hint

Think about how much effort it takes to fix a bug after users start using the software.

🧠 Conceptual
intermediate
2:00remaining
Relative cost of fixing bugs in testing vs coding

Compared to fixing bugs during coding, fixing bugs found during testing is usually:

AMore expensive because the bug has been integrated into more code
BLess expensive because testing is automated
CThe same cost because both happen before release
DImpossible to estimate
Attempts:
2 left
💡 Hint

Consider how many parts of the software might be affected by the time testing happens.

Predict Output
advanced
2:00remaining
Cost multiplier calculation for bug fixes

What is the output of the following Python code that calculates cost multipliers for fixing bugs at different stages?

Testing Fundamentals
stages = ['Requirements', 'Design', 'Coding', 'Testing', 'Production']
cost_multipliers = [1, 5, 10, 20, 100]

for stage, cost in zip(stages, cost_multipliers):
    print(f"{stage}: ${cost * 100}")
A
Requirements: $100
Design: $500
Coding: $1000
Testing: $2000
Production: $10000
B
Requirements: $1
Design: $5
Coding: $10
Testing: $20
Production: $100
C
Requirements: $100
Design: $500
Coding: $1000
Testing: $2000
Production: $10000
Extra: $0
DSyntaxError due to missing colon in for loop
Attempts:
2 left
💡 Hint

Check the multiplication of cost multipliers by 100 and the print format.

assertion
advanced
2:00remaining
Assertion to verify bug cost increase

Which assertion correctly verifies that the cost to fix a bug in production is at least 10 times the cost in coding?

Testing Fundamentals
cost_coding = 1000
cost_production = 12000
Aassert cost_production < cost_coding
Bassert cost_coding >= 10 * cost_production
Cassert cost_production == cost_coding * 5
Dassert cost_production >= 10 * cost_coding
Attempts:
2 left
💡 Hint

Think about which cost should be larger and by what factor.

🔧 Debug
expert
2:00remaining
Identify the error in cost calculation code

What error does the following code raise when calculating bug fix costs?

Testing Fundamentals
costs = {'requirements': 1, 'design': 5, 'coding': 10, 'testing': 20, 'production': 100}

for stage in ['requirements', 'design', 'coding', 'testing', 'deployment']:
    print(f"{stage}: ${costs[stage] * 100}")
ATypeError because costs values are integers
BKeyError because 'deployment' is not in the costs dictionary
CSyntaxError due to missing colon in for loop
DNo error, prints all costs correctly
Attempts:
2 left
💡 Hint

Check if all stages in the list exist as keys in the dictionary.