Class 12 Computer Science · Chapter 5 · Test 2
Unit Testing
38 MCQs
38 questions · 30 min · 38 marks
Want to try first? Take the free Computer Science test: Networks Basics
Sample questions
The first 5 of 38. Try each one, then tap to see the answer.
Question 1
Unit testing is:
- ATesting the entire application
- BTesting individual components or functions
- CTesting the user interface
- DTesting database connections
Show answerHide answer
Answer: B
Unit testing checks individual parts of a program.
Question 2
The Python module used for unit testing is:
- Anumpy
- Bmatplotlib
- Cunittest
- Dos
Show answerHide answer
Answer: C
unittest is the built-in module for unit testing.
Question 3
The main purpose of using testing tools like unittest and pytest is to:
- AIncrease program size
- BVerify code works correctly
- CDesign layouts
- DCompile programs
Show answerHide answer
Answer: B
These tools verify that code behaves as expected.
Question 4
Unit tests help catch errors:
- AEarly in development
- BAfter release
- CAfter deployment
- DWhen users report them
Show answerHide answer
Answer: A
Unit tests catch errors early.
Question 5
Unit testing makes debugging:
- ALonger
- BOptional
- CHarder
- DEasier
Show answerHide answer
Answer: D
Catching errors early makes debugging easier.
More tests in Code Testing and Debugging
Practise with a free account
Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.