Complete the code to define a traceability matrix as a dictionary.
traceability_matrix = [1]The traceability matrix is best represented as a dictionary to map requirements to test cases.
Complete the code to add a test case ID 'TC1' for requirement 'REQ1' in the matrix.
traceability_matrix['REQ1'] = [1]
Test cases are stored as a list for each requirement to allow multiple test cases.
Fix the error in the code to append 'TC2' to the test cases of 'REQ1'.
traceability_matrix['REQ1'].[1]('TC2')
Lists use the append() method to add a single item at the end.
Fill both blanks to check if 'REQ2' exists and add 'TC3' to its test cases.
if [1] in traceability_matrix: traceability_matrix['REQ2'].[2]('TC3')
Check if 'REQ2' is a key in the dictionary, then append 'TC3' to its list.
Fill all three blanks to create a traceability matrix with one requirement and one test case.
traceability_matrix = [1] traceability_matrix[[2]] = [[3]]
Initialize an empty dictionary, then add a key 'REQ1' with a list containing 'TC1'.