What is the main purpose of software testing in the development process?
Think about what testing aims to achieve before fixing anything.
Testing is done to identify defects or bugs in the software. Fixing those defects is the next step called debugging.
Which statement best describes debugging?
Debugging happens after defects are found.
Debugging is the process of locating and fixing the root cause of defects found during testing.
Given the following test code snippet, what will be the test result?
def add(a, b): return a + b def test_add(): assert add(2, 3) == 5 assert add(-1, 1) == 0 assert add(0, 0) == 1 test_add()
Check each assertion carefully for correctness.
The last assertion expects add(0, 0) to be 1, but the function returns 0, so it fails with AssertionError.
Which assertion helps identify if a function returns None unexpectedly during debugging?
Focus on checking for None specifically.
Using assert result is not None directly checks if the function returned a value instead of None, which helps catch unexpected None returns.
In a test automation framework, which step corresponds to debugging?
Debugging is about fixing problems found by tests.
Debugging in a test automation framework involves analyzing why tests failed and correcting the code or environment issues causing those failures.