This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “EasyMock”.
1. The Cobertura command to run while reporting is ____________
a) cobertura-report.bat
b) cobertura-instrument.bat
c) cobertura-check.bat
d) cobertura-merge.bat
View Answer
Explanation: The cobertura-report.bat command is used along with parameters to run reporting using Cobertura.
2. The ____________ parameter is used to specify the type of report.
a) datafile
b) basedir
c) encoding
d) format
View Answer
Explanation: The format parameter defines the type of report to be generated.
3. ____________ parameter specifies the encoding used to read the source.
a) datafile
b) basedir
c) encoding
d) format
View Answer
Explanation: During reporting with Cobertura, the encoding parameter defines the encoding of the files.
4. The source code directories are used to calculate the ____________ of each class.
a) Data size
b) Lines of code
c) Cyclomatic code complexity
d) Mutant score
View Answer
Explanation: The cyclomatic code complexity is a metric to indicate the complexity of the code.
5. The default value of the format parameter is ____________
a) html
b) jar
c) java
d) dat
View Answer
Explanation: The HTML reports are made of annotated versions of each source file.
6. The Cobertura command to run while checking coverage is ____________
a) cobertura-report.bat
b) cobertura-instrument.bat
c) cobertura-check.bat
d) cobertura-merge.bat
View Answer
Explanation: The cobertura-check.bat command is used along with parameters to run reporting using Cobertura.
7. “cobertura-check.bat” is run ________ the JUnit tests to show which classes do not have adequate test coverage.
a) Before
b) After
c) Along with
d) Before and after
View Answer
Explanation: This is used to check test coverage and hence, can only be run after the JUnit tests.
8. The ___________ parameter specifies the minimum acceptable branch coverage rate needed by each class during Cobetura coverage checking.
a) datafile
b) branch
c) line
d) regex
View Answer
Explanation: The branch parameter should be an integer between 0 and 100.
9. The ___________ parameter specifies the minimum acceptable line coverage rate needed by each class during Cobetura coverage checking.
a) datafile
b) branch
c) line
d) regex
View Answer
Explanation: The line parameter should be an integer between 0 and 100.
10. The ___________ parameter specifies the minimum acceptable branch coverage rate needed by each package during Cobetura coverage checking.
a) datafile
b) packagebranch
c) line
d) regex
View Answer
Explanation: The packagebranch parameter should be an integer between 0 and 100.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Practice Programming MCQs
- Check JUnit Books
- Apply for Computer Science Internship
- Check Programming Books