1. What is debugging in programming?
(A) Allocating memory
(B) Writing new functions
(C) Creating loops
(D) The process of finding and fixing errors in a program
2. What is a bug?
(A) An error or flaw in a program that causes it to produce incorrect results
(B) A loop
(C) A function
(D) A variable
3. What is testing in programming?
(A) Allocating memory
(B) The process of evaluating a program to ensure it works correctly
(C) Creating loops
(D) Writing functions
4. Which type of testing checks the entire program as a whole?
(A) System testing
(B) Unit testing
(C) Integration testing
(D) Functional testing
5. Which type of testing checks individual modules or functions?
(A) Unit testing
(B) System testing
(C) Integration testing
(D) Performance testing
6. Which type of testing ensures that combined modules work together correctly?
(A) Integration testing
(B) Unit testing
(C) System testing
(D) Functional testing
7. What is a test case?
(A) A set of conditions or inputs used to test a program
(B) A loop in the program
(C) A variable
(D) A function
8. What is code optimization?
(A) Allocating memory
(B) Creating loops
(C) Writing functions
(D) The process of improving a program to run faster or use fewer resources
9. Which of the following can help in debugging?
(A) Variables
(B) Loops
(C) Print statements or logging
(D) Functions
10. What is the main goal of testing?
(A) To define variables
(B) To create loops
(C) To find errors and verify that the program works as expected
(D) To allocate memory
11. Which of the following is a type of white-box testing?
(A) User acceptance testing
(B) System testing
(C) Functional testing
(D) Unit testing
12. Which type of testing is based on the program’s external behavior without knowing internal details?
(A) Black-box testing
(B) White-box testing
(C) Unit testing
(D) Debugging
13. What is regression testing?
(A) Testing new features only
(B) Re-running previous tests to ensure changes did not introduce new errors
(C) Allocating memory
(D) Creating loops
14. Which of the following is a performance optimization technique?
(A) Reducing time complexity of algorithms
(B) Adding more print statements
(C) Increasing the number of loops unnecessarily
(D) Ignoring errors
15. What is the purpose of a debugger tool?
(A) To store variables
(B) To write loops
(C) To allocate memory
(D) To inspect code execution, variables, and find errors step by step
16. Which type of error can be detected only during program execution?
(A) Runtime error
(B) Syntax error
(C) Compile-time error
(D) Typing error
17. Which technique helps in reducing memory usage and execution time?
(A) Regression testing
(B) Debugging
(C) Unit testing
(D) Code optimization
18. Which of the following is an automated testing tool?
(A) Compiler
(B) Text editor
(C) Selenium
(D) Loop counter
19. Why is debugging important?
(A) To create loops
(B) To ensure the program behaves correctly and reliably
(C) To allocate memory
(D) To define variables
20. What is the main goal of debugging, testing, and optimization together?
(A) To make programs correct, efficient, and reliable
(B) To write loops
(C) To allocate memory
(D) To store variables