0
0
Testing Fundamentalstesting~10 mins

Black-box vs white-box testing in Testing Fundamentals - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the type of testing that focuses on inputs and outputs without knowing internal code.

Testing Fundamentals
def test_functionality():
    # This is an example of [1] testing
    input_data = 5
    expected_output = 25
    actual_output = square(input_data)
    assert actual_output == expected_output
Drag options to blanks, or click blank then click option'
Awhite-box
Bunit
Cblack-box
Dintegration
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing black-box with white-box testing
Thinking unit testing is the same as black-box testing
2fill in blank
medium

Complete the code to identify the testing type that requires knowledge of the internal code structure.

Testing Fundamentals
def test_internal_logic():
    # This is an example of [1] testing
    for i in range(10):
        assert process(i) == expected_result(i)
Drag options to blanks, or click blank then click option'
Awhite-box
Bacceptance
Csystem
Dblack-box
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up black-box and white-box testing
Assuming system testing is white-box testing
3fill in blank
hard

Fix the error in the code to correctly describe black-box testing.

Testing Fundamentals
def describe_testing():
    # Black-box testing focuses on [1] knowledge of the code
    return "Test based on inputs and outputs"
Drag options to blanks, or click blank then click option'
Adetailed
Bno
Cpartial
Dfull
Attempts:
3 left
💡 Hint
Common Mistakes
Saying black-box testing needs detailed code knowledge
Confusing black-box with white-box testing
4fill in blank
hard

Fill both blanks to complete the sentence about white-box testing.

Testing Fundamentals
White-box testing requires [1] of the code and focuses on [2] coverage.
Drag options to blanks, or click blank then click option'
Aknowledge
Binputs
Ccode
Doutput
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing inputs or outputs instead of code knowledge
Mixing black-box concepts here
5fill in blank
hard

Fill all three blanks to complete the dictionary comprehension describing testing types.

Testing Fundamentals
testing_types = {
    'black-box': 'Tests based on [1] and [2] without code knowledge',
    'white-box': 'Tests based on [3] knowledge and code structure'
}
Drag options to blanks, or click blank then click option'
Ainputs
Boutputs
Cinternal
Dexternal
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping internal and external
Confusing inputs and outputs