You are on page 1of 20

NPTEL Software Engineering Model Question Paper SET 1

Solve the following questions by selecting the correct option.

Q1. Which one of the following is not a symptom of the present software crisis?
a. Software is expensive.
b. It takes too long to build a software product.
c. Software is delivered late.
d. Software products are required to perform very complex tasks.

Q2. The goal of structured programming is which one of the following:


a. To have well indented programs
b. To be able to infer the flow of control from the compiled code
c. To be able to infer the flow of control from the program text
d. To avoid the use of GO TO statements

Q3. Unrestricted use of GO TO statements is normally avoided while writing a program, since:
a. It increases the running time of programs
b. It increases memory requirements of programs
c. It results in larger executable code sizes
d. It makes debugging difficult

Q4. Why is writing easily modifiable code important?


a. Easily modifiable code results in quicker run time.
b. Most real world programs require change at some point of time or other.
c. Most text editors make it mandatory to write modifiable code.
d. Several developers may write different parts of a large program.

Q5. Which one among the following is not a software service type of project?
a. Software maintenance b. Software customization
c. Outsourced software development d. Software product development

Q6. Model building is a form of which one of the following:


a. Abstraction b. Decomposition
c. Aggregation d. Composition

Q7. Which one of the following characteristics of software products being developed is not a
symptom of software crisis?
a. Fail to meet user requirements
b. Expensive
c. Highly interactive
d. Difficult to alter, debug, and enhance.

1
NPTEL Software Engineering Model Question Paper SET 1

Q8. What is the implication of the magical number 7 in build and fix development projects?
a. Development effort increases exponentially with program size
b. Development effort increases linearly with program size
c. Development effort increases sub-linearly with program size
d. Development effort decreases linearly with program size

Q9. Which one of the following is not an implication of severely restricted size of the short–
term memory?
a. Difficulty in permanently remembering large amount of information.
b. Difficulty in developing a program with large number of variables
c. Difficulty in debugging a program with large number of variables
d. Difficulty in understanding a program with large number of variables

Q10. Model building is based on which one of the following techniques?


a. Abstraction b. Decomposition
c. Aggregation d. Composition

Q11. Which one of the following may be experienced by a software development team when it
adopts a systematic development process model in preference to a build-and-fix style of
development?
a. Increased documentation overhead b. Increased development cost
c. Decreased maintainability d. Increased development time

Q12. A software process model represents which one of the following?


a. The way in which software is developed
b. The way in which software processes data
c. The way in which software is used
d. The way in which software may fail

Q13. Prototyping life cycle model is appropriate when a project suffers from which one of the
following risks?
a. Schedule slippage b. Manpower turnover
c. Incomplete and uncertain requirements d. Poor quality of outsourced work

Q14. Which one of the following activities spans all stages of a software development life cycle
(SDLC)?
a. Coding b. Testing
c. Project management d. Design

Q15. The operation phase of the waterfall model is a synonym for which one of the following
phases?
a. Coding and unit testing b. Integration and system testing
c. Maintenance phase d. Design phase

2
NPTEL Software Engineering Model Question Paper SET 1

Q16. The implementation phase of the waterfall model is a synonym for which one of the
following phases?
a. Coding and unit testing phase b. Integration and system testing
c. Maintenance phase d. Design phase

Q17. Unit testing is carried out during which phase of the waterfall model?
a. Implementation phase b. Testing phase
c. Maintenance phase d. Design phase

Q18. Which one of the following phases accounts for the maximum effort during development of
a typical software?
a. Coding b. Testing
c. Designing d. Specification

Q19. Which one of the following is not a standard software development process model?
a. Waterfall Model b. Recursive Model
c. RAD Model d. V Model

Q20. Which one of the following feedback paths is not present in an iterative waterfall model?
a. Design phase to feasibility study phase
b. Implementation phase to design phase
c. Implementation phase to requirements specification phase
d. Design phase to requirements specification phase

Q21. Which one of the following most accurately reflects Agile software development?
a. Incremental development b. Iterative development
c. Linear development d. Both (a) & (b)

Q22. Agile model advocates which one of the following approaches?


a. In each increment, get something “quick & dirty” delivered & thereby save time
b. In each increment, get something simple released as quickly as possible
c. In each increment, get something of business-value delivered as quickly as possible,
consistent with the right level of quality
d. In each increment, get something delivered once it has been fully documented and the
documentation has been signed off as complete

Q23. Which of the following is not a characteristic of an Agile software development project?
a. Shared code ownership
b. Implement the simplest solution to meet today's problem
c. Continual feedback from customer
d. Postpone integration until all the incremental deliveries are complete

3
NPTEL Software Engineering Model Question Paper SET 1

Q24. Members of a Scrum team are not expected to answer which one of the following questions
during a daily Scrum meeting?
a. What did you do yesterday b. What will you do today?
c. What obstacles are in your way? d. Why are you getting delayed?

Q25. Which one of the following is not true of a Sprint?


a. It is the fundamental process flow of Scrum
b. It is month-long iteration, during which an incremental product functionality completed
c. During a Sprint, customer feedback is continually obtained and the Sprint backlog is
accordingly modified
d. Each day begins with a daily Scrum meeting

Q26. Which one of the following statements most accurately identifies the stakeholders in a
software development project?
a. A shareholder of the organization developing the software
b. Anyone who is interested in the software
c. Anyone who is a source of requirements for the software
d. Anyone who might be affected by the software

Q27. Which one of the following is performed during the requirements analysis activity?
a. Identify requirements.
b. Build a prototype.
c. Identify any ambiguity, inconsistency, and incompleteness in the gathered requirements
d. Analyze and allocate resources for requirements specification

Q28. Pair programming intends to take which one of the following best practices to the extreme?
a. Design b. Incremental development
c. Code review d. Simplicity

Q29. Which one of the following is not a goal of requirements analysis?


a. Weed out ambiguities in the requirements
b. Weed out inconsistencies in the requirements
c. Weed out non-functional requirements
d. Weed out incompleteness in the requirements

Q30. How is agility achieved in the Agile model of software development?


a. Elaborate documentation b. Rigorous planning
c. Avoidance of things that waste time d. Prototype construction

Q31. SRS document should avoid discussing which one of the following?
a. Functional requirements b. Non-functional requirements
c. Design specification d. Constraints on the implementation

4
NPTEL Software Engineering Model Question Paper SET 1

Q32. Consider the following requirement for a word processor software: " The software should
provide facility to import an existing image available as a jpeg file into the document being
created.". Which one of the following types of requirements is this?
a. Functional requirement b. Non-functional requirement
c. Constraint on the implementation d. Goal of implementation

Q33. Which one of the following assertions is FALSE about functional requirements?
a. A functional requirement is also called a behavioral requirement
b. A functional requirement may consist of several scenarios of execution
c. A functional requirement is a statement of how certain inputs to program are mapped to the
outputs
d. Some of the functional requirements specify the required system performance

Q34. Consider the following partial description of the IIT security software. “A camera at the
main gate should detect an incoming vehicle, and the gate should be opened for registered
vehicles.” Which one of the following types of requirements is this?
a. Functional requirement b. Non-Functional requirement
c. Design requirement d. Design constraint

Q35. Consider the following partial requirement for a software: “A web browser should be used
as the front end.” It can be considered to be which one of the following types of
requirements?
a. Functional requirement b. Non-functional requirement
c. Design constraint d. External interface

Q36. When is the requirement specification activity carried out?


a. During requirements gathering activity
b. Before requirements analysis activity
c. Before requirements gathering activity
d. After requirements analysis activity

Q37. When a company plans to develop a generic product, who among the following is usually
the source of the requirements?
a. Development team members
b. Project manager
c. Marketing personnel
d. Personnel from finance department

Q38. Which one of the following is not a requirements gathering technique?


a. Task analysis b. Scenario analysis
c. Form analysis d. SRS document review

5
NPTEL Software Engineering Model Question Paper SET 1

Q39. Which one of the following problems in the gathered requirements is not the focus of the
requirements analysis task?
a. Inconsistency b. Ambiguity
c. Incompleteness d. Unstructuredness

Q40. Which one of the following views is implicit in an SRS document?


a. Black box b. White box
c. Grey box d. Glass box

Q41. The extent of data exchanges between two modules is called which one of the following?
a. Coupling b. Cohesion
c. Structure d. Union

Q42. Which one of the following types of cohesion can be considered as the best form of
cohesion?
a. Logical b. Coincidental
c. Temporal d. Functional

Q43. The modules in a good software design should have which one of the following
characteristics?
a. High cohesion, low coupling b. Low cohesion, high coupling
c. Low cohesion, low coupling d. High cohesion, high coupling

Q44. Which of the following is the best (most desirable) type of module coupling?
a. Control coupling b. Stamp coupling
c. Data coupling d. Content coupling

Q45. Which one of the following is the worst type of module coupling?
a. Control coupling b. Stamp coupling
c. External coupling d. Content coupling

Q46. Which one of the following is the worst type of module cohesion?
a. Logical Cohesion b. Temporal Cohesion
c. Functional Cohesion d. Coincidental Cohesion

Q47. In which one of the following types of coupling, complete data structures are passed from
one module to another?
a. Control Coupling b. Stamp Coupling
c. External Coupling d. Content Coupling

6
NPTEL Software Engineering Model Question Paper SET 1

Q48. If all tasks must be executed in the same time-span, what type of cohesion is being
exhibited?
a. Functional Cohesion b. Temporal Cohesion
c. Functional Cohesion d. Sequential Cohesion

Q49. Which one of the following is the correct ordering of the coupling of modules from
strongest (least desirable) to weakest (most desirable)?
a. content, common, control, stamp, data
b. common, content, control, stamp, data
c. content, data, common, stamp, common
d. data, control, common, stamp, content

Q50. During the detailed design of a module, which one of the following is designed?
a. Data structures and algorithms b. Control structure
c. Data flow structure d. Module interfaces

Q51. A data flow diagram represents which one of the following?


a. The conditions based on which data items may be processed
b. The order in which different activities are carried out
c. The transformation of data through processing stations
d. The order in which various functions of a program are invoked

Q52. For a given programming problem, a DFD model depicts which of the following?
a. Flow of data b. Flow of control
c. Flow of decisions d. Flow of atomic conditions

Q53. Which one of the following statements is not true of a data flow diagram (DFD) model?
a. It is a hierarchical diagram.
b. It represents code structure
c. It does not represent decisions and control flows.
d. It represents decomposition of functions and data into finer forms.

Q54. In a procedural design approach, during the detailed design stage, which of the following is
undertaken?
a. Module structure is designed
b. Data flow representation is developed
c. Data structures and algorithms for the individual modules are designed
d. Structure chart is developed

Q55. Which one of the following is true of a function-oriented design approach?


a. Top-down b. Bottom-up
c. Mixed-in d. Bottom-out

7
NPTEL Software Engineering Model Question Paper SET 1

Q56. A context diagram should not represent which one of the following?
a. External entities
b. Data input to the system by the external entities
c. Output data generated by the system
d. Module structure

Q57. Which one of the following correctly characterizes balancing of DFDs?


a. Data flowing into or out of a bubble must match the data flows at the next level of DFD
b. Data flowing into or out of a bubble must match the data flows out of the bubble
c. Data flowing into or out of a bubble must match the data flows to the other bubbles
d. Data flowing into a bubble must match the data flowing out of the bubble

Q58. What is wrong with the following context diagram?

a. External entities are appearing at the context level


b. Input/output occurring at the context level
c. Data item name missing on a data flow arrow
d. A data store appearing at the context level

Q59. What is wrong with the following DFD?

a. Unbalanced
b. Presence of synchronous data flow
c. Presence of asynchronous data flow
d. Presence of control information

8
NPTEL Software Engineering Model Question Paper SET 1

Q60. Which one of the following information is not present in a structure chart model of a
software system?
a. Various modules making up the system
b. Module call structure
c. Parameters passed among different modules
d. Data structures and algorithms of the modules

Q61. The packing of data and functions into a single unit in a program is known as:
a. polymorphism b. abstraction
c. encapsulation d. inheritance

Q62. Consider the statement: “An employee is either a worker or a manager.” Assuming that
Employee and Manager to be two classes, what can be said about the relationship between
these two classes?
a. Association b. Generalization-specialization
c. Containment d. Polymorphism

Q63. Which one of the following can be said about an abstract data type (ADT)?
a. It is a synonym for an abstract class
b. A data type that cannot be instantiated
c. A data type that can only be used through the operations defined on it
d. It is the same as a collection of data items

Q64. Which one of the following phrases indicates the relationship that exists between a class and
its public parent class?
a. "...is a..." b. "...has a..."
c. "...is implemented as a..." d. "...uses a..."

Q65. Which one of the following sentences most closely describes "multiple inheritance"?
a. Two classes inherit from each other
b. A base class has two or more derived classes
c. A child class has two or more parent classes
d. A child class has both an "is a" and a "has a" relationship with its parent class

Q66. Which one of the following best characterizes the inheritance relation between two classes?
a. It is the same as encapsulation b. Aggregation of information
c. Generalization and specialization d. Polymorphism

9
NPTEL Software Engineering Model Question Paper SET 1

Q67. How is inheritance useful?


a. It prevents inherited properties from being lost
b. It minimizes the amount of code which has to be written
c. It creates elegant tree structures in the class model
d. It divides objects up into useful classes

Q68. Consider the sentence: A book has one or more pages. Which of the following best
characterizes the relationship between the Book class and the Page class?
a. Inheritance b. Specialization
c. Association d. Composition

Q69. Which one of the following characteristics of a class implies that the same message can be
interpreted by it differently?
a. Encapsulation b. Polymorphism
c. Information Hiding d. Inheritance

Q70. Which one of the following is true of encapsulation?


a. Encapsulation helps in reuse since it is not necessary for the developers to know how an off-
the-shelf software component works internally.
b. Encapsulation means that software components can work more efficiently.
c. Encapsulation means that there is no need for software developers to document their work.
d. Encapsulation hinders reuse.

Q71. Which one of the following best characterizes a sequence diagram?


a. A call graph illustrating all possible sequences of calls between class method members
b. A time-line illustrating a typical sequence of calls between object methods
c. A time-line illustrating the changes in inheritance and instantiation relationships between
classes and objects over time
d. A tree illustrating inheritance relationship between classes

Q72. Which of the following UML diagrams should you use when allocating use-case behavior
to classes?
a. sequence and communication diagrams
b. use-case and activity diagrams
c. sequence and activity diagrams
d. class and composite structure diagrams

Q73. Consider the following sentence: “A square is a polygon”. From an analysis of the sentence,
identify the relations between the two classes Square and Polygon that can be inferred from
the sentence.
a. Inheritance b. Association
c. Aggregation d. Composition

10
NPTEL Software Engineering Model Question Paper SET 1

Q74. Consider the following sentence: “100 paisa are one rupee”. From an analysis of the
sentence, identify the relation between the two classes Paisa and Rupee that can be inferred
from the sentence.
a. Inheritance b. Association
c. Aggregation d. Composition

Q75. Consider the following sentence: “Students live in hostels”. From an analysis of the
sentence, identify the relation between the two classes Student and Hostel that can be
inferred from the sentence.
a. Inheritance b. Association
c. Aggregation d. Composition

Q76. A collaboration diagram depicts which one of the following types of information?
a. The decision structure among the classes
b. The looping structure
c. The attribute values of the objects
d. Structural information such as class association

Q77. Which one of the following is true of unary association?


a. It is defined between multiple classes
b. It is defined on exactly one object
c. It is defined between multiple objects of the same class
d. It is defined between multiple objects of different classes

Q78. When using an informal (natural language) description of a programming problem, which
parts of the description are likely represent objects?
a. All of the nouns and some of the verbs
b. All of the verbs and some of the nouns
c. Some of the nouns.
d. Some of the verbs

Q79. Which one of the following can be said of a sequence diagram?


a. It is used to model the behavior of a single object when many use cases are executed
b. It is used to model the behavior of several objects when a single use case is executed
c. It is used to model the behavior of a single object when a single use case is executed
d. It is used to model the behavior of several objects when many use cases are executed

11
NPTEL Software Engineering Model Question Paper SET 1

Q80. Which one of the following is achieved by developing a sequence diagram during an object-
oriented design process?
a. Identification of object state behavior
b. Determination of attributes of a class
c. Determination of inheritance relationships among classes
d. Responsibility assignment to classes

Q81. Pick the correct statement from the following.


a. Every error causes a failure b. Every error causes a fault
c. Every failure is caused by a fault d. Every bug causes a failure

Q82. Which one of the following is true concerning verification?


a. Helps answer the question: “Have you built the right thing?”
b. Checks the final product against the specification.
c. Usually carried out by the test team.
d. Checks whether an artifact produced in a phase conforms to the corresponding artifact
produced in a previous phase.

Q83. Which one of the following can be inferred from the pesticide paradox?
a. More number of bugs are detected towards the end of testing
b. More severe bugs are detected towards the end of testing
c. After a test methodology has been used to detect bugs, it becomes ineffective for detecting
the remaining bugs
d. A set of test methodologies should be applied again and again until most bugs are
eliminated

Q84. What is the number of boundary classes required for a software development project whose
use case diagram is shown below?

a. 3 b. 4
c. 6 d. 8

12
NPTEL Software Engineering Model Question Paper SET 1

Q85. What is the number of controller classes required for a software development project whose
use case diagram is shown below?

a. 3 b. 4
c. 6 d. 8

Q86. Which one of the following does not serve as a guideline in identifying entity classes from a
problem description?
a. Entity classes usually appear as data stores in a DFD model
b. Entity classes usually occur as group of objects that are aggregated
c. The aggregator of the objects of an entity class corresponds to a register in the physical
world
d. Users are considered as entity classes

Q87. CRC cards are usually not much useful in performing which one of the following activities?
a. Method identification b. Responsibility assignment
c. Collaborator identification d. Class identification

Q88. Which one of the following is not true of monkey testing?


a. Many program parts may not get tested
b. Risky areas of a program may not get tested
c. The tester can easily reproduce any failures
d. Easy to generate test values

Q89. Which of the following, who conducts acceptance testing?


a. The development team b. The test team
c. A set of friendly clients d. Customer

13
NPTEL Software Engineering Model Question Paper SET 1

Q90. Which one of the following is an example of a negative test case?


a. A test designed to crash the software
b. A test designed with negative integral values
c. A test case causing software failure
d. A test case with values outside the valid range of values

Q91. Which one of the following testing techniques is effective in testing whether a developed
software meets its non-functional requirements?
a. Path testing b. Dataflow testing
c. Robust boundary-value testing d. Performance testing

Q92. Which one of the following is a fault-based testing technique?


a. Pair wise testing b. Dataflow testing
c. Path testing d. Mutation testing

Q93. Consider a function that takes an integer a (which can assume integral values between 0 to
100) as argument and carries out actions involving setting the value of a variable b as
specified in the following table:

Condition Action
(a < 10) || (a > 80) b = b + 10
(a = = 30) b = b + 20;
(a = = 40) b = b + 30;
For all other cases b = b + 40;

During black box testing of the function, how many valid equivalence class test cases with
valid input values are required?
a. 4 b. 5
c. 6 d. 7

Q94. A function named compute-electricity-bill was written to compute the electricity bill by an
electricity distribution company. The tariff depends not only the customer type, but also on
the number of units consumed. The function compute-electricity-bill takes two parameters,
the number of units consumed by a customer and the corresponding customer type. The
customer type is an integer value in the range 1 to 5 indicating whether the customer is
domestic, industrial, commercial establishment, etc. The slabs for different charges based
on the units consumed are 0 to 100 units, 100 to 200 units, 200 to 500 units, and 500 units
and above. How many test cases are required for weak equivalence class test testing of the
function compute-electricity-bill?
a. 4 b. 5
c. 8 d. 10

14
NPTEL Software Engineering Model Question Paper SET 1

Q95. For the function compute-electricity-bill described in question 93 above, at least how many
test cases are required for strong equivalence class testing of the function?
a. 10 b. 11
c. 20 d. 21

Q96. For the function compute-electricity-bill described in question 93 above, at least how many
test cases are required for strong robust equivalence class testing?
a. 25 b. 28
c. 35 d. 42

Q97. Suppose a certain function takes 5 Integer input parameters. The valid values for each
parameter takes an integer value in the range 1...100. What is the minimum number of test
cases required for robust boundary value testing?
a. 20 b. 21
c. 30 d. 31

Q98. Scenario coverage testing can be considered to be which one of the following types of
testing strategies?
a. Pair-wise testing b. Decision table-based testing
c. Equivalence partitioning-based testing d. Boundary value-based testing

Q99. An untested program was determined to contain 640 bugs. Three different testing
techniques were applied to test the code. Each testing technique is effective to detect 50% of
the bugs that exist before the concerned testing technique applied. While fixing a bug after
the application of a test strategy, there is a 50% chance of creating another bug. How many
bugs would exist in the code after the 3 testing & bug-fix cycles have been carried out?
a. 200 b. 270
c. 350 d. 448

Q100. Which one of the following types of bugs may not get detected in black-box testing, but are
very likely to be get detected by white-box testing?
a. Syntax errors b. Behavioral errors
c. Logic errors d. Performance errors

Q101. Cause-effect test cases are, in effect, designed using which one of the following types of
testing techniques?
a. Decision-table based testing b. Coverage-based testing
c. Fault-based testing d. Path-based testing

Q102. If a user interface has three checkboxes, at least how many test cases are required to achieve
pair- wise coverage?
a. 3 b. 4
c. 5 d. 6

15
NPTEL Software Engineering Model Question Paper SET 1

Q103. At least how many test cases are required to achieve basic condition coverage of the
following code segment:
If ((a > 5) and (b < 100) and (c > 50)) x = x + 1;
a. 1 b. 2
c. 3 d. 4

Q104. For the following program statement, which one of the following test suites would achieve
basic condition/decision coverage?
if (a > 10 && b < 50) p++;
a. (a = 20, b = 10), (a = 0, b = 15)
b. (a = 20, b = 10), (a = 0, b = 15), (a = 5, b = 45)
c. (a = 50, b = 70), (a = 0, b = 35)
d. (a = 50, b = 20), (a = 1, b = 85)

Q105. Why is it necessary to test a large program at three different levels: unit, integration, as well
as system levels, rather than testing only at the system level?
a. It reduces the number of test cases that can be designed
b. It reduces the test execution effort
c. It reduces the debugging effort
d. It reduces test case design effort.

Q106. Code coverage analysis is used to measure which one of the following?
a. Thoroughness of testing b. Quality of test cases
c. Quality of code d. Distribution of bugs

Q107. Consider the following “C” code segment. At least how many test cases are needed for the
given C code for achieving decision coverage?

a. 3 b. 6
c. 8 d. 10

16
NPTEL Software Engineering Model Question Paper SET 1

Q108. At least how many test cases are needed for the C code segment given question 107, for
achieving basic condition coverage?
a. 4
b. 6
c. 8
d. Basic condition coverage is not achievable

Q109. At least how many test cases are needed for the C code segment given question 107, for
achieving multiple condition coverage?
a. 4
b. 6
c. 8
d. Multiple condition coverage is not achievable for the given code

Q110. If branch coverage has been achieved on a unit under test, which of the following is
coverage is implicitly implied?
a. Path coverage b. Multiple condition coverage
c. Statement coverage d. Data flow coverage

Q111. At least how many test cases are required to achieve MC/DC coverage of the following
code segment:
If ((a > 5) or (b < 100) or (c > 50)) x = x + 1;
a. 1 b. 2
c. 3 d. 4

Q112. If MC/DC coverage has been achieved on a unit under test, which one of the following test
coverage is implicitly implied?
a. Path coverage b. Multiple condition coverage
c. Condition/decision coverage d. Data flow coverage

Q113. What is the McCabe’s Cyclomatic complexity for the following code segment?

a. 2 b. 3
c. 4 d. 5

17
NPTEL Software Engineering Model Question Paper SET 1

Q114. Which one of the following can be considered as a fault-based testing technique?
a. Cause-effect graphing b. Data flow testing
c. Orthogonal array testing d. Mutation testing

Q115. Among the following test techniques, which one of the following is the strongest?
a. All path coverage testing b. Decision coverage testing
c. Basic condition coverage testing d. MC/DC testing

Q116. Why is the all path testing strategy rarely used in practice?
a. Too many test cases are required
b. Too weak a testing technique
c. It is subsumed by basis path testing
d. It is subsumed by statement coverage

Q117. Which one of the following attributes of a program can be inferred from its Cyclomatic
complexity?
a. Computational complexity b. Lines of code (LoC)
c. Executable code size d. Testability

Q118. What would be the Cyclomatic complexity of the following program?

a. 2 b. 3
c. 4 d. 5

18
NPTEL Software Engineering Model Question Paper SET 1

Q119. Consider the following “C” code segment. At least how many test cases are needed for the
given C code for achieving MC/DC coverage?
int main (){
int a, b = 0;
scanf (“%d”, &a);
if (a < 10 || a >100) {b = b + 10;}
if (a == 20) {b = b + 20;}
if (a == 30) {b = b + 30;}
else {b = b + 40;}
}
a. 3
b. 4
c. 5
d. MC/DC coverage is not achievable for the given code

Q120. For the following decision statement, at least how many test cases are needed for the given
C code for achieving basis condition coverage?
If ((a > 50) && (b < 20) && (c == 0) || (d == 5)) …
a. 2
b. 6
c. 8
d. Basis condition coverage is not achievable for the given code

19
NPTEL Software Engineering Model Question Paper SET 1

ANSWER KEY

1. D, 2. D, 3. D, 4. B, 5. D, 6. A, 7. C, 8. A, 9. A, 10. A

11. A, 12. A, 13. C, 14. C, 15. C, 16. A, 17. A, 18. B, 19. B, 20. A

21. D, 22. C, 23. D, 24. D, 25. C, 26. B, 27. C, 28. C, 29. C, 30. C

31. C, 32. A, 33. D, 34. A, 35. D, 36. D, 37. C, 38. D, 39. D, 40. A

41. A, 42. D, 43. A, 44. C, 45. D, 46. D, 47. B, 48. B, 49. A, 50. A

51. C, 52. A, 53. C, 54. C, 55. A, 56. D, 57. A, 58. D, 59. D, 60. D

61. C, 62. B, 63. C, 64. A, 65. C, 66. C, 67. B, 68. D, 69. B, 70. A

71. B, 72. A, 73. A, 74. D, 75. B, 76. D, 77. C, 78. C, 79. B, 80. D

81. C, 82. D, 83. C, 84. B, 85. A, 86. D, 87. D, 88. C, 89. D, 90. D

91. D, 92. D, 93. A, 94. B, 95. C, 96. C, 97. D, 98. C, 99. B, 100. C

101. A, 102. B, 103. B, 104. D, 105. C, 106. B, 107. A, 108. A, 109. A, 110. C

111. D, 112. C, 113. B, 114. D, 115. A, 116. A, 117. D, 118. C, 119. B, 120. A

20

You might also like