Vaidikalaya

MCQ On Unit Testing


Q1. Unit Testing focuses on:.
  1. Complete system behavior
  2. Individual units or components
  3. User interface design
  4. Database performance

Answer: b, Individual units or components

Solution: Unit testing focuses on testing individual units or components.

Q2. A unit in Unit Testing refers to:.
  1. Entire application
  2. User interface screen
  3. Smallest testable part of code
  4. Database server

Answer: c, Smallest testable part of code

Solution: A unit is the smallest testable part of a program.

Q3. Who usually performs Unit Testing?.
  1. End users
  2. Business analysts
  3. Developers
  4. Clients

Answer: c, Developers

Solution: Unit testing is generally done by developers.

Q4. Unit Testing is mainly performed during:.
  1. Deployment phase
  2. Maintenance phase
  3. Development phase
  4. Acceptance phase

Answer: c, Development phase

Solution: Unit testing is done during the development phase.

Q5. Which of the following is a Unit Testing tool?.
  1. Selenium
  2. JMeter
  3. JUnit
  4. LoadRunner

Answer: c, JUnit

Solution: JUnit is a commonly used unit testing framework.

Q6. Unit Testing helps in:.
  1. Finding integration defects
  2. Improving code quality
  3. Testing system performance
  4. Validating user requirements

Answer: b, Improving code quality

Solution: Unit testing improves code quality by catching bugs early.

Q7. Unit Testing is done before:.
  1. System Testing
  2. User Acceptance Testing
  3. Integration Testing
  4. Alpha Testing

Answer: c, Integration Testing

Solution: Unit testing is performed before integration testing.

Q8. Which testing isolates individual functions or methods?.
  1. System Testing
  2. Integration Testing
  3. Unit Testing
  4. Regression Testing

Answer: c, Unit Testing

Solution: Unit testing isolates and tests individual functions.

Q9. Automated Unit Testing is commonly implemented using:.
  1. Manual test cases
  2. Test scripts and frameworks
  3. End-user feedback
  4. Production monitoring

Answer: b, Test scripts and frameworks

Solution: Automation frameworks are used for automated unit testing.

Q10. Unit Testing cannot:.
  1. Detect coding errors
  2. Improve code maintainability
  3. Find bugs early
  4. Detect integration issues

Answer: d, Detect integration issues

Solution: Integration issues are detected in integration testing, not unit testing.