Engineering Questions with Answers - Multiple Choice Questions

MCQs on Operation Specification

1 - Question

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

View Answer

Answer: d
Explanation: 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 - Question

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

View Answer

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




3 - Question

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

View Answer

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




4 - Question

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

View Answer

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




5 - Question

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

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

 




6 - Question

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

View Answer

Answer: a
Explanation: 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 - Question

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

View Answer

Answer: d
Explanation: 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 - Question

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

View Answer

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




9 - Question

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

View Answer

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




10 - Question

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

View Answer

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

Get weekly updates about new MCQs and other posts by joining 18000+ community of active learners