Which of the following is NOT a key element to include in a clear defect report?
Think about what information helps fix the defect, not personal feelings.
A good defect report focuses on facts and clear information to help developers reproduce and fix the issue. Personal opinions do not help and should be avoided.
You want to write an assertion to check if a defect's severity is set to 'Critical'. Which assertion is correct?
defect = {'id': 101, 'severity': 'Critical'}
# Choose the correct assertion below:Remember Python is case-sensitive and assignment '=' is not used in assertions.
Option A correctly uses the get method and matches the exact case 'Critical'. Option A fails due to case mismatch. Option A uses assignment instead of comparison. Option A asserts the opposite.
What error will this defect report submission code raise?
def submit_defect(defect): if defect['title'] and defect['description']: print('Defect submitted') else: print('Missing information') submit_defect({'title': 'Crash', 'description': 'App crashes on start'})
Check the syntax of if-else statements carefully.
The else statement is missing a colon at the end, causing a SyntaxError.
Which practice is best when using a defect tracking tool?
Think about clear communication and avoiding confusion.
Updating defect status promptly and adding comments helps everyone stay informed and speeds up resolution. Creating duplicates causes confusion. Delayed updates reduce transparency. Random assignment wastes resources.
What is the output of this Python code that filters defects by priority?
defects = [
{'id': 1, 'priority': 'High'},
{'id': 2, 'priority': 'Low'},
{'id': 3, 'priority': 'Medium'},
{'id': 4, 'priority': 'High'}
]
high_priority_ids = [d['id'] for d in defects if d['priority'] == 'High']
print(high_priority_ids)Look for defects where priority equals 'High'.
The list comprehension selects defects with priority 'High', which are ids 1 and 4.