Java MCQ Set 1
1. ___ is a free Java tool that calculates the percentage of code accessed by tests.
a) Cobertura
b) JUnit
c) XUnit
d) Maven
Answer
Answer: a [Reason:] Cobertura is used to identify which parts of the Java program are lacking test coverage.
2. Cobertura is based on ______
a) JUnit
b) XUnit
c) Maven
d) Jcoverage
Answer
Answer: d [Reason:] Jcoverage is an open source tool that allows to test the effectiveness of java tests.
3. In order to measure test coverage, Cobertura creates ____ of class files specified.
a) Instrumented copies
b) Objects
c) Mocks
d) Images
Answer
Answer: a [Reason:] Cobertura uses instrumented copies of the code to provide test coverage.
4. While using Cobertura from the command line, which parameter specifies the base directory?
a) −−datafile
b) −−destination
c) −−ignore
d) −−basedir
Answer
Answer: d [Reason:] The –basedir parameter specifies the base directory of the class files that are to be instrumented.
5. ________ is used to specify the name of the file to use for storing the metadata about the classes.
a) −−datafile
b) −−destination
c) −−ignore
d) −−basedir
Answer
Answer: a [Reason:] The file specifies by –datafile is a single file containing serialized Java classes.
6. ________ specifies the output directory for the instrumented classes.
a) −−datafile
b) −−destination
c) −−ignore
d) −−basedir
Answer
Answer: b [Reason:] The –destination parameter is used to fix an output directory.
7. _____ specifies a regular expression to filter out certain lines of the source code.
a) −−datafile
b) −−destination
c) −−ignore
d) −−basedir
Answer
Answer: c [Reason:] This is useful for ignoring logging statements and for such the ignore parameter is used.
8. _____ is used to add extra classes and jar files to Cobertura.
a) −−datafile
b) −−destination
c) −−ignore
d) −−auxClasspath
Answer
Answer: d [Reason:] This adds files that Cobertura may have missed during instrumentation.
9. The default value for the –datafile parameter is ______
a) cobertura.ser
b) cobertura.dat
c) datafile.ser
d) cobertura.log
Answer
Answer: a [Reason:] The file is created in the current directory.
10. To use cobertura, we need to include ____
a) cobertura.jar
b) junit.jar
c) hamcrest.jar
d) junitCobertura.jar
Answer
Answer: a [Reason:] The external jar file adds Cobertura to the present project.
Java MCQ Set 2
1. All ______ has to be completed before integration testing can be done.
a) Stress testing
b) Functional testing
c) Unit testing
d) Load testing
Answer
Answer: c [Reason:] Once the tests for a class are up and running, the next step is to hook up the class with other methods and services.
2. KISS is an acronym for ____
a) Keep it simple, stupid
b) Keep it safe and sound
c) Know it soundly and systematically
d) Know information safely and securely
Answer
Answer: a [Reason:] The principle most finds its uses in minimalist software development concepts.
3. In software engineering, ___ is a principle of software development, which aims at reducing repetition of information of every kind, especially useful in multi-tier architectures.
a) KISS
b) WET
c) SSOT
d) DRY
Answer
Answer: d [Reason:] The DRY principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”.
4. DRY stands for ______
a) Do right yourself
b) Don’t repeat yourself
c) Don’t ring the yarn
d) Do rule over yourself
Answer
Answer: b [Reason:] Application of the DRY principle successfully means a modification of any single element of a system does not need a change in other logically unrelated elements.
5. Violations of DRY are referred to as ___ solutions.
a) WET
b) NOT DRY
c) KISS
d) ENGAGE
Answer
Answer: a [Reason:] WET stands for “write everything twice”.
6. ___ tests are designed early.
a) Preventive
b) Reactive
c) Associative
d) Amorous
Answer
Answer: a [Reason:] Preventive testing involves not only measuring, but also improving the quality of the software.
7. _____ tests are designed after the software has been produced.
a) Preventive
b) Reactive
c) Associative
d) Amorous
Answer
Answer: b [Reason:] Reactive testing is a software testing approach done after the production of the software.
8. What does an exit criteria do?
a) Define when to remove control
b) Defines the level of a test
c) Defines which test to not test
d) Defines when a test level is completed
Answer
Answer: d [Reason:] An exit criteria is used to denote that a particular test level is completed.
9. The likelihood of a/an ____ event determines the level of risk.
a) unlikely
b) adverse
c) ordinary
d) expected
Answer
Answer: b [Reason:] The adverse event and the impact of the event determines the level of risk.
10. ___ testing is used for testing systems for which the specification takes in the form of rules or cause-effect combinations.
a) Unit Testing
b) Functional Testing
c) Load Testing
d) Decision Table Testing
Answer
Answer: d [Reason:] In a decision table the inputs are listed down in the form of a column, while the outputs are in the same column but below the inputs.
Java MCQ Set 3
1. A combination of function coverage and branch coverage is sometimes also called ___
a) Function coverage
b) Statement coverage
c) Decision coverage
d) Condition coverage
Answer
Answer: c [Reason:] In decision coverage, both aspects of function coverage and branch is used to complete code coverage.
2. ______ criterion requires that every point of entry and exit in the program has been invoked at least once.
a) Function coverage
b) Statement coverage
c) Decision coverage
d) Condition coverage
Answer
Answer: c [Reason:] Decision coverage requires that every decision in the program has taken on all possible outcomes at least once.
3. For the following code
if (a or b) and c then
The condition/decision criteria will be satisfied by:
a) a=true, b=true, c=true and a=false, b=false, c=false
b) a=false, b=true, c=true
c) a=true, b=false, c=true
d) a=true, b=true, c=false
Answer
Answer: a [Reason:] Condition/decision coverage requires that both decision and condition coverage be satisfied.
4. _______ criterion extends the decision criteria with specifications that each condition has to affect the decision outcome independently.
a) Redundant Condition/decision coverage
b) Transferred Condition/decision coverage
c) Modified Condition/decision coverage
d) Lossless Condition/decision coverage
Answer
Answer: c [Reason:] Modified Condition/Decision coverage extends upon condition/decision coverage and is used for safety-critical applications.
5. ____ criterion requires that inside each decision, all combinations of conditions are tested.
a) Redundant Condition/decision coverage
b) Multiple condition coverage
c) Modified Condition/decision coverage
d) Lossless Condition/decision coverage
Answer
Answer: b [Reason:] Multiple condition coverage checks for every condition possible and each decision is tested.
6. ______ requires that in a method taking parameters, all the common values for such parameters be considered.
a) Redundant Condition/decision coverage
b) Multiple condition coverage
c) Modified Condition/decision coverage
d) Parameter Value Coverage
Answer
Answer: d [Reason:] The idea in Parameter Value Coverage is that all common possible values for a parameter are tested.
7. ________ applications are often required to show that testing achieves 100% of some form of code coverage.
a) Non safe
b) Safety Critical
c) Critical
d) Lossless
Answer
Answer: b [Reason:] A safety critical application can result in severe loss if not tested properly.
8. PVC stands for _______
a) Parameter Value Condition
b) Parameterised Values Check
c) Parameter Value Coverage
d) Path Value Check
Answer
Answer: c [Reason:] PVC is also known as parameter value coverage which tests code coverage for a parameter.
9. ________ is a method of achieving complete branch coverage without achieving complete path coverage.
a) Basis Path Testing
b) Loss Testing
c) Universal Testing
d) Random Testing
Answer
Answer: a [Reason:] Basis path testing provides a technique of total branch coverage without having total path coverage.
10. ____ criteria checks whether each state in a finite-state machine been reached and explored.
a) Path coverage
b) Loop coverage
c) Entry/exit coverage
d) State coverage
Answer
Answer: d [Reason:] State coverage ensures that every state of a finite state machine is covered by the test suite.
Java MCQ Set 4
1. To perform ______ the code needs to be in executive form.
a) Dynamic Testing
b) Static Testing
c) Integration Testing
d) Documentation Testing
Answer
Answer: a [Reason:] Dynamic testing tests the dynamic parts of the code and needs the code in executive form.
2. ________ is a process of evaluating software at development phase.
a) Validation
b) Verification
c) Design Check
d) Design Evaluation
Answer
Answer: b [Reason:] Verification is a way of checking “are we building the product right?”.
3. ______ is the process of checking whether the software meets the customer requirements as well as evaluating it after the development process.
a) Validation
b) Verification
c) Design Check
d) Design Evaluation
Answer
Answer: a [Reason:] Validation is a way of checking “are we building the right product?”.
4. _____ is finding defects when the system under goes testing as a whole.
a) User Acceptance Testing
b) Unit Testing
c) Loss Testing
d) System Testing
Answer
Answer: d [Reason:] In System testing, the entire system is subjected to tests to find faults.
5. System testing is also known as ______
a) User Acceptance Testing
b) Regression Testing
c) End to End Testing
d) Lossless Testing
Answer
Answer: c [Reason:] In end to end or system testing, the application undergoes testing from beginning till the end.
6. UAT stands for ______
a) Universal Access Testing
b) Unified Anchor Testing
c) User Access Testing
d) User Acceptance Testing
Answer
Answer: d [Reason:] UAT is a specified test done for the users and hence, stands for user acceptance testing.
7. ______ involves running a product through a series of specific tests which determine whether the product meets the needs of its users.
a) User Acceptance Testing
b) Unit Testing
c) Loss Testing
d) System Testing
Answer
Answer: a [Reason:] UAT or User Acceptance Testing is done with the users in mind and hence, determine whether the product meets the needs of its users.
8. _____ is prepared before the actual testing starts.
a) Test Scenarios
b) Test Cases
c) Test Script
d) Latent defect
Answer
Answer: a [Reason:] Test Scenarios includes plans for testing product, number of team members and environmental condition.
9. ___ is a document that contains the steps that has to be executed.
a) Test Scenarios
b) Test Cases
c) Test Script
d) Latent defect
Answer
Answer: b [Reason:] Test cases are used to test the modularity in the code.
10. _______ is written in a programming language and is a short program used to test part of functionality of the software system.
a) Test Scenarios
b) Test Cases
c) Test Script
d) Latent defect
Answer
Answer: c [Reason:] Test script is a written set of steps that should be performed manually.
Java MCQ Set 5
1. Decision table technique is sometimes also referred to as a ________ table.
a) Cause-effect
b) Redundant
c) Extreme
d) Isolated
Answer
Answer: a [Reason:] An associated logic diagramming technique known as ‘cause-effect graphing’ is sometimes used to help derive the decision table.
2. _____ is a model that illustrates how testing activities integrate with software development phases.
a) Waterfall Model
b) V-Model
c) Spiral Model
d) Iterative Model
Answer
Answer: b [Reason:] The V-model represents a development process that may be considered to be an extension of the waterfall model.
3. _______ is triggered by modifications, migration or retirement of existing software.
a) Regression Testing
b) Unit Testing
b) Maintenance testing
d) Integration Testing
Answer
Answer: c [Reason:] Maintenance Testing is done on the already deployed software.
4. RTM stands for ______
a) Repeated Trade Matrix
b) Redundant Trace Module
c) Robust Test Mechanism
d) Requirement traceability matrix
Answer
Answer: d [Reason:] The Requirements Traceability Matrix or RTM is a document that links requirements throughout the validation process.
5. The purpose of the _______ is to ensure that all requirements defined for a system are tested in the test protocols.
a) RTM
b) FDD
c) KISS
d) TM
Answer
Answer: a [Reason:] The RTM links requirements and hence, ensures all the requirements are tested.
6. RTM is prepared _____
a) After test case designing
b) Before test case designing
c) During test case designing
d) Not prepared
Answer
Answer: b [Reason:] Requirements should already be traceable from Review activities ande RTM is prepared before test case designing.
7. In _____ each component at lower hierarchy is tested individually and then the components that rely upon these components are tested.
a) Top down testing
b) Unit testing
c) Bottom up
d) Load testing
Answer
Answer: c [Reason:] The modules at lower hierarchy is tested and then the testing goes up in bottom up testing.
8. Bottom up testing starts with ____
a) Root
b) Second level roots
c) Inner nodes
d) Terminal nodes
Answer
Answer: d [Reason:] Since bottom up testing tests from lower hierarchy, terminal nodes are tested first.
9. DRE stands for ______
a) Defect Removal Efficiency
b) Detect Redundant Errors
c) Defectively Run Enumerations
d) Detect Random Error
Answer
Answer: a [Reason:] It is a powerful metric used to measure test effectiveness.
10. DRE=Number of bugs while testing /number of bugs while testing + number of bugs _______
a) Found redundant
b) Not found
c) Found by user
d) Found by tester
Answer
Answer: c [Reason:] DRE takes into consideration the bugs found by the user too.