Software coupling involves dependencies among pieces of software called modules. Which of the following are correct statements with respect to module coupling? P: Common Coupling occurs when two modules share the same global data Q: control Coupling occur when modules share a composite data structure and use only part of it.
P and R only
Software coupling is a measure of how much different software modules depend on each other. High coupling means modules are highly dependent, which can make software harder to understand, modify, and test. Low coupling is generally desired in software design.
Let's examine each statement provided regarding module coupling:
This statement accurately describes Common Coupling. In Common Coupling, multiple modules access and modify the same global data structure. This creates strong dependencies because changes to the global data structure or how one module uses it can affect all other modules accessing it. This is generally considered undesirable due to the difficulty in tracing data flow and potential side effects.
This statement describes Stamp Coupling (or possibly Data Coupling if only a primitive data type is shared, although the phrasing "composite data structure" points more towards Stamp Coupling). Control Coupling occurs when one module passes a piece of information (like a flag or command) to another module that controls the logic or flow of execution in the receiving module. Therefore, statement Q is incorrect with respect to Control Coupling.
This statement correctly defines Content Coupling (also known as Pathological Coupling). This is the highest and worst form of coupling. Examples include one module modifying another module's local data, accessing its internal variables directly, or branching into the middle of another module's code. This makes modules highly interdependent and changes in one module's internal implementation directly break another module.
Based on the analysis:
Therefore, the correct statements are P and R.
The question asks which of the statements P, Q, and R are correct with respect to module coupling types. Our analysis shows that statements P (Common Coupling definition) and R (Content Coupling definition) are correct, while statement Q (Control Coupling definition) is incorrect.
| Coupling Type | Description | Dependency Level |
|---|---|---|
| Content Coupling | One module depends on the internal implementation details of another module. | Highest / Worst |
| Common Coupling | Modules share global data. | High |
| Control Coupling | One module passes a control flag/value to another, influencing its logic. | Moderate |
| Stamp Coupling | Modules share a composite data structure but only use parts of it. | Lower Moderate |
| Data Coupling | Modules exchange data through parameters of primitive types. | Low / Best (among procedural) |
| No Coupling | Modules are completely independent. | Lowest / Ideal |
The option that correctly identifies P and R as the correct statements is the right answer.
| Coupling Type | Characteristics | Impact on Maintainability | Desirability |
|---|---|---|---|
| Content (Pathological) | Module A accesses/modifies internal data/code of Module B. | Very Hard | Least Desirable |
| Common (Global) | Modules share global variables. | Hard (side effects are hard to trace) | Undesirable |
| Control | Module A passes a flag to Module B that controls B's logic. | Moderate (B depends on A's control choice) | Acceptable in specific cases |
| Stamp (Data Structure) | Module A passes a data structure to Module B, and B uses only part of it. | Fair (B depends on the structure, even if it doesn't use all of it) | Better than Control, Common, Content |
| Data | Module A passes simple data (parameters) to Module B. | Easy (dependencies are clear) | Most Desirable (in procedural design) |
Coupling is closely related to another software design principle called Cohesion. While coupling measures dependencies BETWEEN modules, cohesion measures how related the elements WITHIN a single module are. Good software design aims for low coupling and high cohesion.
Think of it like a team:
Achieving low coupling and high cohesion leads to software systems that are easier to understand, debug, modify, and reuse. These are fundamental principles in modular design and object-oriented programming.
Various types of cohesion exist, such as Functional Cohesion (most desirable), Sequential Cohesion, Communicational Cohesion, Procedural Cohesion, Temporal Cohesion, Logical Cohesion, and Coincidental Cohesion (least desirable).
Which of the following UML diagrams has a static view ?
Match the following in Software Engineering:
List – I | List – II | ||
(a) | Product Complexity | (i) | Software Requirements Definition |
(b) | Structured System Analysis | (ii) | Software Design |
(c) | Coupling and Cohesion | (iii) | Validation Technique |
(d) | Symbolic Execution | (iv) | Software Cost Estimation |
Software validation mainly checks for inconsistencies between
Which of the following statements is/are TRUE?
P: In software engineering, defects that are discovered earlier are more expensive to fix
Q: A software design is said to be a good design, if the components are strongly cohesive and weakly coupled
Select the correct answer from the options given below:
Which of the following are the primary objectives of risk monitoring in software project tracking?
P: To assess whether predicted risks do, in fact, occur
Q: To ensure that risk aversion steps defined for the risk are being properly applied
R: To collect information that can be used for future risk analysis