Software Design Questions and Answers – Operation Specification

This set of Software Design Multiple Choice Questions & Answers (MCQs) focuses 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
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. 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. 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.
advertisement
advertisement

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
View Answer

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

Answer: c
Explanation: All the mentioned statements are true with respect to operation contract.
Note: Join free Sanfoundry classes at Telegram or Youtube

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
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. 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.
advertisement

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
View Answer

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

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

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
View Answer

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

Sanfoundry Global Education & Learning Series – Software Architecture and Design.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.