MCQ On Coupling And Cohesion
Q1. Coupling refers to:.
- Degree to which elements inside a module belong together
- Amount of reusable code in a system
- Degree of interdependence between modules
- Number of functions inside a module
Answer: c, Degree of interdependence between modules
Solution: Degree of interdependence between modules
Q2. Which among the following shows increasing order of coupling (low -> high)?.
- Content -> Common -> Data
- Data -> Stamp -> Content
- Stamp -> External -> Data
- Data -> Control -> Content
Answer: d, Data -> Control -> Content
Solution: Coupling increases from Data (best) ? Stamp ? Control ? External ? Common ? Content (worst)
Q3. Which type of coupling is the worst?.
- Content Coupling
- Data Coupling
- Stamp Coupling
- Control Coupling
Answer: a, Content Coupling
Solution: Content coupling occurs when one module directly modifies or relies on another module’s internal data.
Q4. Which coupling is considered the best?.
- Control Coupling
- Common Coupling
- Stamp Coupling
- Data Coupling
Answer: d, Data Coupling
Solution: Data coupling means modules share only necessary data, making them loosely connected.
Q5. Control coupling happens when:.
- Modules share entire data structures
- A module passes a flag that affects the behavior of another module
- Modules modify each other's local data
- Modules use shared global variables
Answer: b, A module passes a flag that affects the behavior of another module
Solution: Control coupling occurs when one module controls another using flags or parameters.
Q6. Common coupling involves:.
- Sharing global variables
- Passing only required data
- Unrelated functions grouped together
- Sequential execution
Answer: a, Sharing global variables
Solution: Common coupling is when multiple modules access the same global data, increasing risk.
Q7. Stamp coupling refers to:.
- Passing full data structures unnecessarily
- Using global variables
- Passing minimal required data
- Modules working independently
Answer: a, Passing full data structures unnecessarily
Solution: Stamp coupling occurs when complex structures are passed even though only some fields are required.
Q8. Cohesion refers to:.
- Degree of interdependence between modules
- Degree to which elements inside a module belong together
- Amount of shared global data
- Communication between threads
Answer: b, Degree to which elements inside a module belong together
Solution: Degree to which elements inside a module belong together
Q9. Which among the following shows increasing order of cohesion (low -> high)?.
- Functional -> Logical -> Temporal
- Logical -> Temporal -> Functional
- Coincidental -> Logical -> Functional
- Temporal -> Functional -> Procedural
Answer: c, Coincidental -> Logical -> Functional
Solution: Cohesion increases from Coincidental (worst) ? Logical ? Functional (best)
Q10. Which cohesion type is considered the best?.
- Logical Cohesion
- Functional Cohesion
- Temporal Cohesion
- Procedural Cohesion
Answer: b, Functional Cohesion
Solution: Functional cohesion is the strongest form where all module elements work toward a single task.
Q11. Coincidental cohesion refers to:.
- Tasks grouped by sequence
- Tasks grouped by time
- Unrelated tasks grouped together
- Tasks using same input/output
Answer: c, Unrelated tasks grouped together
Solution: Coincidental cohesion is the weakest form where module elements have no meaningful relationship.
Q12. Sequential cohesion occurs when:.
- Tasks run at the same time
- Output of one becomes input to another
- Functions are logically grouped
- Tasks share global data
Answer: b, Output of one becomes input to another
Solution: Sequential cohesion means the work output by one module is used as input by the next.
Q13. Logical cohesion groups tasks based on:.
- Execution sequence
- Timing
- Category or type of task
- Input-output relation
Answer: c, Category or type of task
Solution: Logical cohesion groups tasks because they fall into the same category, not due to functional relatedness.
Q14. Temporal cohesion groups tasks that:.
- Are executed at the same time
- Use the same data
- Are unrelated
- Depend on each other
Answer: a, Are executed at the same time
Solution: Temporal cohesion refers to grouping tasks that must occur together in time, like initialization routines.
Q15. Module design is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule?.
- Inheritance
- Polymorphism
- Encapsulation
- Abstraction
Answer: c, Encapsulation
Q16. Which of the following combination is preferred with respect to cohesion and coupling :.
- low and low
- low and high
- high and low
- high and high
Answer: c, high and low