MCQ On Unit Testing
Q1. Unit Testing focuses on:.
- Complete system behavior
- Individual units or components
- User interface design
- 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:.
- Entire application
- User interface screen
- Smallest testable part of code
- 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?.
- End users
- Business analysts
- Developers
- Clients
Answer: c, Developers
Solution: Unit testing is generally done by developers.
Q4. Unit Testing is mainly performed during:.
- Deployment phase
- Maintenance phase
- Development phase
- 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?.
- Selenium
- JMeter
- JUnit
- LoadRunner
Answer: c, JUnit
Solution: JUnit is a commonly used unit testing framework.
Q6. Unit Testing helps in:.
- Finding integration defects
- Improving code quality
- Testing system performance
- Validating user requirements
Answer: b, Improving code quality
Solution: Unit testing improves code quality by catching bugs early.
Q7. Unit Testing is done before:.
- System Testing
- User Acceptance Testing
- Integration Testing
- Alpha Testing
Answer: c, Integration Testing
Solution: Unit testing is performed before integration testing.
Q8. Which testing isolates individual functions or methods?.
- System Testing
- Integration Testing
- Unit Testing
- Regression Testing
Answer: c, Unit Testing
Solution: Unit testing isolates and tests individual functions.
Q9. Automated Unit Testing is commonly implemented using:.
- Manual test cases
- Test scripts and frameworks
- End-user feedback
- Production monitoring
Answer: b, Test scripts and frameworks
Solution: Automation frameworks are used for automated unit testing.
Q10. Unit Testing cannot:.
- Detect coding errors
- Improve code maintainability
- Find bugs early
- Detect integration issues
Answer: d, Detect integration issues
Solution: Integration issues are detected in integration testing, not unit testing.