0
0
Testing Fundamentalstesting~20 mins

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

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of Black-box and White-box Testing
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Black-box Testing Focus
Which statement best describes the main focus of black-box testing?
ATesting internal code structure without knowing the program's inputs or outputs
BTesting the software by reviewing the source code line by line
CTesting software functionality based only on inputs and expected outputs without knowledge of internal code
DTesting the software performance by analyzing memory usage
Attempts:
2 left
💡 Hint
Think about testing without looking inside the program.
🧠 Conceptual
intermediate
2:00remaining
White-box Testing Characteristics
Which of the following is a key characteristic of white-box testing?
AIt requires knowledge of the internal code and logic to design test cases
BIt is performed only after black-box testing is complete
CIt ignores the program's internal structure and focuses on output correctness
DIt tests the software only through its user interface
Attempts:
2 left
💡 Hint
White-box testing means looking inside the program.
Predict Output
advanced
2:00remaining
Output of Black-box Test Case Result
Given a function that returns the sum of two numbers, what will be the output of this black-box test case if inputs are 3 and 5?
Testing Fundamentals
def add(a, b):
    return a + b

# Black-box test case
input1 = 3
input2 = 5
result = add(input1, input2)
print(result)
ATypeError
B8
C35
DNone
Attempts:
2 left
💡 Hint
Think about what adding 3 and 5 returns.
assertion
advanced
2:00remaining
Correct Assertion for White-box Testing Coverage
Which assertion best verifies that a specific function branch was executed during white-box testing?
Testing Fundamentals
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

result = is_even(4)
Aassert result == 4 # Incorrect output check
Bassert 'if' in is_even.__code__.co_names # Checks code contains 'if' keyword
Cassert result is not None # Checks function returns something
Dassert result == True # Checks output correctness only
Attempts:
2 left
💡 Hint
White-box testing checks internal logic by verifying outputs for specific inputs.
🔧 Debug
expert
2:00remaining
Identify the Testing Approach Causing a Bug Miss
A tester uses only black-box testing on a function that has a hidden division by zero error in an internal branch never triggered by normal inputs. What is the most likely outcome?
AThe bug will be missed because black-box testing does not examine internal code paths
BThe bug will be fixed automatically by black-box testing
CThe bug will cause a syntax error during black-box testing
DThe bug will be detected because black-box testing covers all internal branches
Attempts:
2 left
💡 Hint
Think about what black-box testing can and cannot see.