0
0
Testing Fundamentalstesting~10 mins

Traceability matrix 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 define a traceability matrix as a dictionary.

Testing Fundamentals
traceability_matrix = [1]
Drag options to blanks, or click blank then click option'
Aset()
B[]
C()
D{}
Attempts:
3 left
💡 Hint
Common Mistakes
Using a list or tuple instead of a dictionary.
2fill in blank
medium

Complete the code to add a test case ID 'TC1' for requirement 'REQ1' in the matrix.

Testing Fundamentals
traceability_matrix['REQ1'] = [1]
Drag options to blanks, or click blank then click option'
A'TC1'
B['TC1']
C('TC1')
D{'TC1'}
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of a list, which prevents adding multiple test cases.
3fill in blank
hard

Fix the error in the code to append 'TC2' to the test cases of 'REQ1'.

Testing Fundamentals
traceability_matrix['REQ1'].[1]('TC2')
Drag options to blanks, or click blank then click option'
Ainsert
Badd
Cappend
Dextend
Attempts:
3 left
💡 Hint
Common Mistakes
Using add() which causes an error because it's not a list method.
4fill in blank
hard

Fill both blanks to check if 'REQ2' exists and add 'TC3' to its test cases.

Testing Fundamentals
if [1] in traceability_matrix:
    traceability_matrix['REQ2'].[2]('TC3')
Drag options to blanks, or click blank then click option'
A'REQ2'
Bappend
Cadd
D'TC3'
Attempts:
3 left
💡 Hint
Common Mistakes
Using add() instead of append() for lists.
Checking membership with a wrong key.
5fill in blank
hard

Fill all three blanks to create a traceability matrix with one requirement and one test case.

Testing Fundamentals
traceability_matrix = [1]
traceability_matrix[[2]] = [[3]]
Drag options to blanks, or click blank then click option'
A{}
B'REQ1'
C'TC1'
D[]
Attempts:
3 left
💡 Hint
Common Mistakes
Using list [] instead of dictionary {} for the matrix.
Not using a list for test cases.