0
0
Testing Fundamentalstesting~10 mins

Decision table testing 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 decision table as a list of dictionaries.

Testing Fundamentals
decision_table = [[1]]
Drag options to blanks, or click blank then click option'
A'condition: A, action: X'
B{'condition': 'A', 'action': 'X'}
C('condition', 'A', 'action', 'X')
D['condition', 'A', 'action', 'X']
Attempts:
3 left
💡 Hint
Common Mistakes
Using tuples or lists instead of dictionaries for rules.
2fill in blank
medium

Complete the code to check if a condition matches in the decision table.

Testing Fundamentals
if rule['condition'] == [1]:
    execute_action(rule['action'])
Drag options to blanks, or click blank then click option'
Aaction
Brule
C'A'
Dcondition
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names instead of string literals.
3fill in blank
hard

Fix the error in the code to iterate over all rules in the decision table.

Testing Fundamentals
for rule in [1]:
    print(rule['action'])
Drag options to blanks, or click blank then click option'
Adecision-table
BdecisionTable
Cdecision_table()
Ddecision_table
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses like a function call.
Using invalid variable names with hyphens.
4fill in blank
hard

Fill both blanks to create a decision table filtering rules with condition 'B'.

Testing Fundamentals
filtered_rules = [rule for rule in decision_table if rule[[1]] == [2]]
Drag options to blanks, or click blank then click option'
A'condition'
B'action'
C'B'
D'Y'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping keys and values.
Using wrong string literals.
5fill in blank
hard

Fill all three blanks to create a decision table dictionary comprehension with conditions and actions.

Testing Fundamentals
decision_dict = { [1]: [2] for rule in decision_table if rule[[3]] == 'C'}
Drag options to blanks, or click blank then click option'
Arule['condition']
Brule['action']
C'condition'
D{rule['condition']}
Attempts:
3 left
💡 Hint
Common Mistakes
Missing curly braces for dict comprehension.
Swapping keys and values.