Software Engineering Cohesion and Coupling
45 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which type of cohesion occurs when a module’s tasks must be executed in the same time-span?

  • Logical Cohesion
  • Functional Cohesion
  • Temporal Cohesion (correct)
  • Procedural Cohesion

In logical cohesion, all elements of the module perform different operations.

False (B)

What is an example of procedural cohesion?

An algorithm for decoding a message that requires tasks to be completed in a specific order.

Modules whose instructions are related by a specific sequence are said to exhibit __________ cohesion.

<p>procedural</p> Signup and view all the answers

Match the following types of cohesion with their definitions:

<p>Functional Cohesion = Tasks are part of a single functional task. Sequential Cohesion = Output from one module serves as input to another. Communicational Cohesion = Code is organized based on the shared data. Temporal Cohesion = Tasks that must be executed in the same time-span.</p> Signup and view all the answers

Which type of cohesion keeps all code that uses the same data together?

<p>Communicational Cohesion (C)</p> Signup and view all the answers

In sequential cohesion, all tasks within the module perform the same function.

<p>False (B)</p> Signup and view all the answers

What illustrates high cohesion in a programming module?

<p>A module where all components contribute to a single, well-defined task.</p> Signup and view all the answers

What type of coupling exists when two modules communicate solely through the passing of data?

<p>Data coupling (B)</p> Signup and view all the answers

Control coupling occurs when modules communicate by passing complete data structures.

<p>False (B)</p> Signup and view all the answers

What is content coupling?

<p>Content coupling occurs when module A changes the data of module B or control is passed into the middle of another module.</p> Signup and view all the answers

______ coupling occurs when two modules have access to shared global data areas.

<p>Common</p> Signup and view all the answers

Match the following types of coupling with their descriptions:

<p>Data coupling = Modules communicate by passing only data Control coupling = Modules communicate through control information Common coupling = Modules share a global data area Content coupling = One module controls or changes the data of another module</p> Signup and view all the answers

What is an example of control coupling?

<p>Setting a flag to control the flow of execution in a module (A)</p> Signup and view all the answers

In stamp coupling, only part of a data structure is passed between modules.

<p>True (A)</p> Signup and view all the answers

Define external coupling.

<p>External coupling occurs when two modules share an externally imposed data format or communication protocol.</p> Signup and view all the answers

Which of the following best describes composition in object-oriented design?

<p>Indicates a permanent part relationship where A contains B (C)</p> Signup and view all the answers

An actor within a sequence diagram represents a specific physical entity that interacts with the subject.

<p>False (B)</p> Signup and view all the answers

What is the primary purpose of a sequence diagram?

<p>To capture how objects interact with each other over time.</p> Signup and view all the answers

A lifeline in a sequence diagram represents an individual ______ in the interaction.

<p>participant</p> Signup and view all the answers

Match the following terms with their definitions:

<p>Aggregation = A relationship where A is part of B Dependency = A situation where A relies on B Subclass = A specialization of a superclass Association = A collaboration where A needs assistance from B</p> Signup and view all the answers

How many interaction diagrams should typically be drawn for each use case?

<p>One sequence diagram (A)</p> Signup and view all the answers

An activation in a sequence diagram is represented by a thick rectangle.

<p>False (B)</p> Signup and view all the answers

In object-oriented programming, what does a subclass represent?

<p>A kind of superclass or a specialization of it.</p> Signup and view all the answers

What does a call message represent in an interaction?

<p>Invocation of operation of target lifeline (D)</p> Signup and view all the answers

A destroy message represents the instantiation of a target lifeline.

<p>False (B)</p> Signup and view all the answers

What does a duration message show in an interaction?

<p>The distance between two time instants for a message invocation.</p> Signup and view all the answers

A _____ message represents the invocation of a message of the same lifeline.

<p>self</p> Signup and view all the answers

Which type of message indicates a request to destroy the lifecycle of a target lifeline?

<p>Destroy Message (B)</p> Signup and view all the answers

Match the following types of messages with their definitions:

<p>Call Message = Defines communication invoking operation in target lifeline Return Message = Passes information back to the caller Create Message = Instantiates a target lifeline Recursive Message = Invokes a message from the same lifeline</p> Signup and view all the answers

An iteration marker is used to indicate that a message is sent many times.

<p>True (A)</p> Signup and view all the answers

What is an optional feature of return values in an interaction?

<p>Indicated using a dashed arrow with a label.</p> Signup and view all the answers

In a 1:N relationship, what is added to the relation on the many side?

<p>Primary key attribute from the one side as a Foreign key (A)</p> Signup and view all the answers

In a binary 1:N relationship, the many side does not migrate any keys from the one side.

<p>False (B)</p> Signup and view all the answers

What is the purpose of creating another relation in an M:N relationship?

<p>To include primary keys of all relations as the primary key of the new relation.</p> Signup and view all the answers

In the ORDER table after the relationship, the added attribute is the ______.

<p>Customer_ID</p> Signup and view all the answers

Match the following tables with their respective attributes:

<p>ORDER = Order_Number, Order_Date, Promised_Date, Customer_ID Manages = ssn, did, since Employees = Employee_ID, Employee_Name Departments = Department_ID, Department_Name</p> Signup and view all the answers

What is a sequence fragment in UML 2.0?

<p>A box that encloses a portion of interactions in a sequence diagram (A)</p> Signup and view all the answers

The fragment operator is located in the bottom right corner of a combined fragment.

<p>False (B)</p> Signup and view all the answers

Name one type of fragment used in UML sequence diagrams.

<p>opt</p> Signup and view all the answers

An attribute is a property of an entity that is of interest to an ______.

<p>organization</p> Signup and view all the answers

Which of the following is NOT a fragment type in UML?

<p>data (B)</p> Signup and view all the answers

What are the three main constructs used in Entity-Relationship Diagrams?

<p>Entity, Attribute, Relationship</p> Signup and view all the answers

Match the following entity types with their examples:

<p>Employee = An individual working in a company Student = A learner enrolled in educational programs Car = A vehicle for transport Bank Account = A financial account held by an individual or organization</p> Signup and view all the answers

A candidate key is an attribute that can uniquely identify an entity type.

<p>True (A)</p> Signup and view all the answers

Flashcards

Communicational Cohesion

A type of module cohesion where all functions within the module use the same data structures, like an array or a stack. Example: Functions for storing, searching, and printing student data.

Temporal Cohesion

A type of module cohesion where functions are grouped based on the fact that they must be executed within the same time frame. Example: Initialization, start-up, and shut-down functions.

Procedural Cohesion

A type of module cohesion where functions are grouped based on the specific order in which they must be completed to achieve a goal. Example: Decoding a message using a specific algorithm.

Logical Cohesion

A type of module cohesion where functions are grouped based on the fact that they perform similar operations, such as error handling, data input, or data output. Example: A module containing various print functions to generate output reports.

Signup and view all the flashcards

Functional Cohesion

A type of module cohesion where functions are grouped based on their direct relationship to a single functional task. Example: Functions that handle a specific part of an order processing system.

Signup and view all the flashcards

Sequential Cohesion

A type of module cohesion where the output of one function serves as the input for another function within the module. Example: A function that calculates a sum, and another function that uses that sum to calculate an average.

Signup and view all the flashcards

Module Cohesion

A principle that describes the degree to which elements within a module are related and contribute to a single, well-defined purpose. It is an important factor in software design, influencing maintainability, reusability, and understandability.

Signup and view all the flashcards

Module Coupling

A metric used to assess the strength of relationships between different modules. It indicates how interdependent modules are, with high coupling suggesting a tight connection and potential for dependency.

Signup and view all the flashcards

Entity-Relationship Diagrams

A representation of data for an organization. It uses three main components: Entities, Attributes, and Relationships.

Signup and view all the flashcards

Entities

Things in the real world that are being represented in a database. For example: employees, students, cars, houses, bank accounts.

Signup and view all the flashcards

Attributes

Properties of an entity that are of interest to an organization. They are what we store in a database.

Signup and view all the flashcards

Relationships

Associations between sets of entities. They describe how entities relate to each other.

Signup and view all the flashcards

Candidate Key

A specific attribute or combination of attributes used to uniquely identify each instance of an entity.

Signup and view all the flashcards

Coincidental Cohesion

Modules with instructions that have little to no relationship to each other.

Signup and view all the flashcards

Data Coupling

Modules communicate by passing only data values. They are independent beyond data exchange.

Signup and view all the flashcards

Stamp Coupling

Complete data structures are passed between modules. One module relies on the entire structure of another.

Signup and view all the flashcards

Control Coupling

Modules communicate by passing control information (flags). One module's behavior depends on flags set by another.

Signup and view all the flashcards

Common Coupling

Modules share a common data area. Changes affect all modules accessing the shared data.

Signup and view all the flashcards

Content Coupling

Module A modifies data directly within Module B, or control is passed to the middle of another module.

Signup and view all the flashcards

External Coupling

Modules depend on an external format, protocol, or device interface.

Signup and view all the flashcards

External Coupling

Modules share an externally defined data format, communication protocol, or device interface.

Signup and view all the flashcards

Call Message

A type of message in sequence diagrams that represents a communication between lifelines where the caller is invoking an operation on the target lifeline.

Signup and view all the flashcards

Return Message

A type of message in sequence diagrams that represents the return of information back to the caller of a previous message.

Signup and view all the flashcards

Self Message

A type of message in sequence diagrams that represents a message sent from one lifeline to itself, indicating an internal operation.

Signup and view all the flashcards

Create Message

A type of message in sequence diagrams that represents the creation of a new object or lifeline.

Signup and view all the flashcards

Destroy Message

A type of message in sequence diagrams that represents a request to destroy an object or lifeline.

Signup and view all the flashcards

Condition Message

A message in sequence diagrams that represents a condition that must be true for the message to be sent.

Signup and view all the flashcards

Iteration Message

A message in sequence diagrams that indicates that a message is sent multiple times, typically iterating over a collection or array.

Signup and view all the flashcards

Duration Message

A type of message in sequence diagrams that represents the duration of a message invocation.

Signup and view all the flashcards

Binary Relationship

In a database, a relationship describes how two entities are connected. A binary relationship involves two entities, like "CUSTOMER places ORDER(s)" where "CUSTOMER" and "ORDER" are entities.

Signup and view all the flashcards

1:N Relationship

A 1:N relationship in a database means one entity on one side is related to multiple entities on the other side. For example, one customer can place many orders.

Signup and view all the flashcards

Transforming 1:N Relationships

To transform a 1:N relationship into a database table, the primary key of the "one" side is added as a foreign key to the "many" side. This connects the tables.

Signup and view all the flashcards

M:N Relationships

For a M:N relationship (many-to-many), you create a new table (called a "join table"). This table acts like a bridge, containing primary keys from both entities involved in the relationship. This allows you to record relationships with multiple entities on both sides.

Signup and view all the flashcards

Foreign Key

In database design, a foreign key is a field (column) that references the primary key of another table. This creates a connection between tables, ensuring data integrity and relationships.

Signup and view all the flashcards

Class Diagram

A diagram that shows the relationships between classes, including inheritance, aggregation, composition, and association. It provides a blueprint for the structure of a software system.

Signup and view all the flashcards

Object Diagram

A diagram that represents instances of classes and their relationships at a specific point in time. It shows how objects interact with each other in a specific scenario.

Signup and view all the flashcards

Composition Relationship

Represents a 'whole-part' relationship where the part (B) cannot exist without the whole (A). The whole (A) is responsible for creating and destroying the part (B).

Signup and view all the flashcards

Aggregation Relationship

Represents a 'whole-part' relationship where the part (B) can exist independently from the whole (A). The whole (A) simply uses the part (B), but doesn't control its lifecycle.

Signup and view all the flashcards

Dependency Relationship

Represents a dependency between two elements where one element (A) uses or relies on the other element (B). It indicates that changes in element (B) can potentially affect element (A).

Signup and view all the flashcards

Interaction Diagram

Models the interactions between objects over time, depicting message exchanges between them. Often used to illustrate the flow of a particular use case.

Signup and view all the flashcards

Sequence Diagram

A specialized interaction diagram that focuses on the temporal order of messages between objects. It is used to model sequential flows, branching, loops, and recursion.

Signup and view all the flashcards

Lifeline

An element in a sequence diagram that represents a participant in an interaction, typically an object or an actor.

Signup and view all the flashcards

Study Notes

Software Design

  • Software design involves transforming the system requirements specification (SRS) document into a design document.
  • The design process has two parts: conceptual design and technical design.
  • Developers and customers collaboratively work on the design.
  • Conceptual design focuses on understanding data sources, system operation, user interface, and user choices.
  • Technical design details hardware, software, communication interfaces, and solutions.
  • The design process is iterative; it involves refining designs in several versions.
  • Design starts with informal outlining and refines into more formal completed designs.

Conceptual Design

  • Conceptual design answers where data originates, how it's handled within the system, how the system appears to users, the available user choices, event timing, and output format of reports and screens.

Technical Design

  • This includes hardware specifications, the needed software, communication interfaces, and system solutions for the customer's requirements.
  • Software architecture, network architecture, and other components are described.

Overview of the Design Process

  • The general design process model includes requirement specifications, architectural design, abstract specification, interface design, component design, data structure design, and algorithm design.

Design Products

  • Architectural design identifies subsystems and defines sub-system control and communication frameworks.
  • Output is an architectural design document.
  • Abstract specification details services and constraints for each subsystem.
  • Interface design documents an interface for each subsystem.
  • Component design details allocated services and components' interfaces.
  • Data structure design involves detailing used system data types.
  • Algorithm design involves specifying algorithms for handling system processes.

Good Software Design

  • A good design is easy to understand, maintain, and modify.
  • Using consistent and significant names in components and modules enhances readability.
  • Modularity, breaking down the solution into modules, promotes independent functionality and reduces interconnectedness.

Modularity

  • Modularization divides a system into distinct modules, each performing specific tasks independently.
  • Independent modules improve understanding, reducing complexity..

Cohesion and Coupling

  • Cohesion describes the strength of a module’s functionality.
  • Coupling measures the interdependence between modules.
  • High cohesion enhances modularity and reduces complexity.
  • Low coupling indicates minimal dependence and easier modifications.

Classification of Cohesion

  • Types of cohesion include coincidental, logical, temporal, procedural, communicational, sequential, and functional.

Classification of Coupling

  • Types include data coupling, stamp coupling, control coupling, external coupling, common coupling, and content coupling.
  • Data coupling is the best form and content coupling is the worst form.

Data Dictionary

  • All data items used in DFDs are listed and described in the data dictionary, including their definitions, purpose, and usage.

Data Flow Diagram (DFD)

  • DFDs are graphical representations of data flows in a system, often used in information systems.
  • Symbols represent data flows between entities and processes.

Level 0 Data Flow Diagram

  • A high-level overview of the system, representing the entire system as a single process with its relationship to external entities.
  • Inputs and outputs are identified as data flows.
  • A top-level overview of the system and how external components interact.

Level 1 Data Flow Diagram

  • Decomposition of a level 0 data flow diagram into smaller, more specific processes (bubbles) which illustrate sub processes, often focusing on the inputs, outputs, and data stores involved in each process.

Object-Oriented Design (OOD)

  • OOD treats the system as a collection of objects with their own data and methods, handling data within each object, with objects communicating through message passing.

Unified Modeling Language (UML)

  • UML provides a standard graphical language for modeling systems from various viewpoints.
  • UML diagrams depict system structure and behavior.
  • UML is not a system design but is a modeling language.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Software Design PDF

Description

Test your knowledge on cohesion and coupling in software engineering. This quiz covers various types of cohesion and coupling, their definitions, and examples. See how well you understand these important concepts in programming.

More Like This

Use Quizgecko on...
Browser
Browser