MCQs on Software Metrics along with answers and explanations, useful for UGC NET, ISRO, and Assistant Professor exams:
1. Software metrics are used to:
a) Design the software architecture
b) Estimate and improve software quality and productivity
c) Create test cases
d) Write documentation
Answer: b) Estimate and improve software quality and productivity
Explanation: Software metrics help measure aspects like complexity, size, and quality to manage software development effectively.
2. Which of the following is not a software metric?
a) Lines of Code (LOC)
b) Function Points (FP)
c) Cyclomatic Complexity
d) Flowchart
Answer: d) Flowchart
Explanation: A flowchart is a diagramming technique, not a metric.
3. Cyclomatic complexity is a metric used to measure:
a) Code size
b) Program readability
c) Number of test cases required
d) Memory usage
Answer: c) Number of test cases required
Explanation: Cyclomatic complexity represents the number of independent paths in code and helps in determining the number of test cases needed.
4. Function Point (FP) metric is based on:
a) Lines of code written
b) Number of functions in a module
c) External inputs, outputs, files, and user interactions
d) Programming language used
Answer: c) External inputs, outputs, files, and user interactions
Explanation: FP measures functionality from the user's point of view, independent of technology.
5. Which of the following is a dynamic metric?
a) Cyclomatic complexity
b) Function Point
c) Code coverage
d) LOC
Answer: c) Code coverage
Explanation: Code coverage is collected during runtime (i.e., execution), making it a dynamic metric.
6. Which metric can be used to estimate effort and time using historical data?
a) Function Point
b) Bug frequency
c) Gantt chart
d) Use case diagram
Answer: a) Function Point
Explanation: Function Points help estimate project size, which can be used for effort and time estimation.
7. Which metric is most useful to detect high complexity in control flow?
a) Halstead’s metric
b) LOC
c) Cyclomatic complexity
d) Data coupling
Answer: c) Cyclomatic complexity
Explanation: It measures the number of independent paths through a program's source code.
8. In Halstead's software science, which of the following is not a basic measure?
a) Number of operators
b) Number of operands
c) Number of lines
d) Number of unique operators
Answer: c) Number of lines
Explanation: Halstead’s metrics are based on operators and operands, not on lines of code.
9. A software metric should be:
a) Expensive to calculate
b) Subjective
c) Valid and reliable
d) Always static
Answer: c) Valid and reliable
Explanation: A good metric must measure what it claims (valid) and give consistent results (reliable).
10. Which metric is language-independent?
a) Lines of Code (LOC)
b) Function Point (FP)
c) Cyclomatic complexity
d) Halstead’s metric
Answer: b) Function Point (FP)
Explanation: Function Point analysis is based on system functionality, not the programming language.
Comments
Post a Comment