JUnit Questions and Answers – EasyMock

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

Answer: a
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

Answer: d
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

Answer: c
Explanation: During reporting with Cobertura, the encoding parameter defines the encoding of the files.
advertisement
advertisement

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

Answer: c
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

Answer: a
Explanation: The HTML reports are made of annotated versions of each source file.
Note: Join free Sanfoundry classes at Telegram or Youtube

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

Answer: c
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

Answer: b
Explanation: This is used to check test coverage and hence, can only be run after the JUnit tests.
advertisement

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

Answer: b
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

Answer: c
Explanation: The line parameter should be an integer between 0 and 100.
advertisement

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

Answer: b
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.