All Exams Test series for 1 year @ ₹349 only
Question

Modules X and Y operate on the same input and output, then the cohesion is

The correct answer is

Communicational cohesion

Understanding Module Cohesion in Software Design

Module cohesion is a measure of how closely related the elements within a module are. High cohesion is desirable in software design because it leads to modules that are easier to understand, maintain, and reuse. Low cohesion indicates that a module performs many unrelated tasks, making it more complex and fragile.

There are different types of cohesion, ordered from lowest (worst) to highest (best):

  • Coincidental Cohesion: Elements are grouped together randomly, with no meaningful relationship.
  • Logical Cohesion: Elements perform similar functions but are grouped because they fall into a logical category (e.g., a module for all input operations, regardless of type).
  • Temporal Cohesion: Elements are grouped because they are executed at the same time (e.g., initialization routines).
  • Procedural Cohesion: Elements are grouped because they are executed in a specific sequence, like steps in a procedure.
  • Sequential Cohesion: The output of one element serves as the input for the next element within the module.
  • Communicational Cohesion: Elements operate on the same input data or produce the same output data.
  • Functional Cohesion: Elements are grouped because they all contribute to performing a single, well-defined task. This is the highest and most desirable type of cohesion.

Analyzing the Question: Same Input and Output

The question states that two modules, X and Y, operate on the same input and output. This specific condition is the key to identifying the type of cohesion.

Let's look at the provided options in the context of this condition:

  1. Logical cohesion: This type groups logically similar functions, not necessarily functions operating on the exact same data.
  2. Sequential cohesion: This implies a flow where the output of one part becomes the input of another part *within the same module*. The question describes modules operating on the same *external* input/output, not an internal data flow from one element to the next.
  3. Procedural cohesion: This relates to the order of execution, grouping elements that follow a specific control flow. It doesn't specifically require shared data access.
  4. Communicational cohesion: This type is defined precisely by elements that operate on the same input data or produce the same output data. The scenario described in the question directly matches this definition.

Determining the Cohesion Type

When modules or elements within a module share the same input data or share producing the same output data, they exhibit Communicational cohesion. The question explicitly mentions operating on the "same input and output," which is the defining characteristic of Communicational cohesion.

Conclusion on Module Cohesion

Based on the definitions and the specific condition given in the question (operating on the same input and output), the cohesion type is Communicational cohesion.

Cohesion Type Description Relationship to Shared Data
Logical Grouped by logical category Not necessarily related to shared data
Sequential Output of one is input to next (internal) Involves data flow, but typically internal to the module
Procedural Grouped by order of execution Not directly related to shared data access
Communicational Operate on same input OR produce same output Directly defined by shared data access (input or output)

Therefore, if modules X and Y operate on the same input and output, their cohesion is Communicational cohesion.

Revision Table: Software Cohesion Types

Cohesion Level (Worst to Best) Type Characteristics
1 (Worst) Coincidental Random grouping
2 Logical Logically categorized functions
3 Temporal Executed at the same time
4 Procedural Grouped by order of execution
5 Sequential Output of one is input to the next
6 Communicational Operate on same data (input/output)
7 (Best) Functional Single, well-defined task

Additional Information on Software Cohesion

Cohesion is a key principle in modular design, often discussed alongside coupling. While cohesion measures the strength of the relationships *within* a module, coupling measures the strength of the relationships *between* different modules.

  • High Cohesion: A module does one thing well. Easier to understand, test, and maintain. Changes inside don't affect other parts much.
  • Low Cohesion: A module does many unrelated things. Harder to understand, test, and maintain. Changes inside can have unpredictable effects.
  • Low Coupling: Modules are independent. Changes in one module have minimal impact on others. Makes system easier to modify and reuse parts.
  • High Coupling: Modules are highly dependent on each other. Changes in one module often require changes in many others. Makes system hard to modify and fragile.

The goal of good design is generally to achieve high cohesion and low coupling. Communicational cohesion is considered a relatively good level of cohesion, better than sequential, procedural, temporal, logical, or coincidental, but not as good as functional cohesion.

Was this answer helpful?

Important Questions from Software Maintenance

  1. Software products need perfective maintenance for which of the following reasons?

  2. Which of the following statement(s) is/are true regarding PERT chart in software project management?

    I. PERT charts consists of a network of boxes and arrows.

    II. In PERT chart, the boxes represent activities and the arrow represents task dependencies.

  3. Statistical software quality assurance in software engineering involves _________

  4. Software reliability is described with respect to

    (A) Execution Time

    (B) Calendar Time

    (C) Clock Time

    Choose the correct answer from the options given below:

  5. Size and complexity are a part of

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App