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.
advertisement

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.

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.
advertisement

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.

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.

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.
advertisement

Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn