250+ MCQs on Operation Specification and Answers

Software Design Multiple Choice Questions on “Operation Specification”.

1. What is operation specification and what does it include?
a) Specification of an operation’s responsibilities and interface can be collected in one place, in structured
b) It includes Class or Module, Signatures, Descriptions
c) It includes Behavior, Implementation
d) All of the mentioned

Answer: d
Clarification: Specification of an operation’s responsibilities and interface can be collected in one place is called operation specification, and It includes Class or Module, Signatures, Descriptions, Behavior, Implementation.

2. What is Signature?
a) The operation’s class (in object-oriented designs) or module (in non-object-oriented designs)
b) The operation name, the names and types of its parameters,and its return type
c) A sentence or two informally stating the operation’s responsibilities
d) A detailed description of the algorithm and data structures used to implement this operation

Answer: b
Clarification: A signature is operation name, the names and types of its parameters, and its return type.

3. What is procedural specification?
a) A behavior description that does not use an algorithm
b) An algorithmic behavior description
c) All of the mentioned
d) None of the mentioned

Answer: b
Clarification: A behavior description that does not use an algorithm is called a declarative specification and algorithmic behavior description is called a procedural specification.

4. Declarative specifications are preferable for which of the following reasons?
a) Declarative specifications are more abstract because they ignore implementation details, and consequently they are more concise than procedural specifications
b) Declarative specifications focus on an operation’s interface, making it clearer how an operation interacts with its callers
c) Procedural specifications may bias programmers toward the implementation used in the specification
d) All of the mentioned

Answer: d
Clarification: Declarative specifications are preferable because of all of the mentioned reasons.

5. What is true with respect to operation contract?
a) It is a binding agreement between two or more parties
b) They usually state each party’s rights and obligations
c) All of the mentioned
d) None of the mentioned

Answer: c
Clarification: All the mentioned statements are true with respect to operation contract.

6. What is precondition?
a) It is an assertion that must be true at the initiation of an operation
b) It is an assertion that must be true upon completion of an operation
c) It is a statement that must be true at a designated point in a program
d) None of the mentioned

Answer: a
Clarification: A precondition is an assertion that must be true at the initiation of an operation and A post condition is an assertion that must be true upon completion of an operation.

7. Which of the following is incorrect?
a) The postconditions express the caller’s obligations and the called operation’s rights
b) The preconditions express the caller’s rights and the called operation’s obligations
c) All of the mentioned
d) None of the mentioned

Answer: d
Clarification: The preconditions express the caller’s obligations and the called operation’s rights and The postconditions express the caller’s rights and the called operation’s obligations.

8. What is Class Invariant?
a) A class invariant is an assertion that must be true of any class instance between calls of its exported operations
b) Class invariants must be established by class constructors
c) Class invariants must be preserved by every exported operation in the class
d) All of the mentioned

Answer: d
Clarification: All of the mentioned depicts class invariant.

9. Which of the following are post condition heuristics?
a) Specify restrictions on parameters
b) Specify conditions that must have been established
c) Specify empty preconditions as true or none
d) None of the mentioned

Answer: d
Clarification: All of the mentioned are precondition heuristics.

10. Which of the following are class invariant heuristics?
a) Specify restrictions on attributes
b) Specify restrictions on parameters
c) Specify relationships between the parameters and the results
d) All of the mentioned

Answer: a
Clarification: Class invariant heuristics-Specify restrictions on attributes and Specify relationships among attributes.

Leave a Reply

Your email address will not be published. Required fields are marked *