menu

Python Testing and Debugging


1. What is a debugger in Python?

A tool used to test user interfaces

A tool used to analyze code performance

A tool used to verify database connections

A tool used to find and fix errors in code


2. What is unit testing in Python?

Testing individual units or components of code in isolation

Testing the entire program as a whole

Testing user interface interactions

Testing database connections


3. Which tool is used for profiling Python code?

cProfile

unittest

logging

pdb


4. What is a regression test in Python testing?

A test that ensures that code changes have not introduced new errors

A test that measures the performance of a system under heavy loads

A test that simulates user interactions with a system

A test that verifies that code is functioning as expected


5. What is a breakpoint in Python debugging?

A point in the code where execution is paused to allow for inspection

A point in the code where execution is terminated

A point in the code where a specific action is triggered

A point in the code where an error is expected to occur


6. What is the purpose of code coverage in Python testing?

To verify the user interface

To verify database connections

To measure how much of the code is being tested

To measure how much of the code is being used by the user


7. What is a mutation test in Python testing?

A test that introduces deliberate errors into the code to measure the effectiveness of tests

A test that simulates user interactions with a system

A test that verifies that code is functioning as expected

A test that measures the performance of a system under heavy loads


8. What is the purpose of a test runner in Python testing?

To run tests and report the results

To generate test data for use in testing

To analyze code performance during testing

To identify and fix errors in test code


9. What is code coverage in Python testing?

The percentage of code that is executed during testing

The amount of time it takes to run a test suite

The number of test cases that are run during testing

The number of bugs that are found during testing


10. Which tool in Python can be used for load testing?

locust

pytest-benchmark

httperf

all of the above