0% found this document useful (0 votes)
38 views

Modules and Modularization

Software Engineering
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
38 views

Modules and Modularization

Software Engineering
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 9
MODULES AND MODULARIZATION Modules: + Software is divided into separately named components, Often called Modules. Modules and modularization criteri Characteristics: * Modules contain instructions, processing logic, and data structures, + Modules can be separately compiled and storedin alibrary. * Modules can beincludedin a program. *Module segments can beused by invokinganame and some parameters. + Modules can.use other modules. Examples: * Modules include procedures + Subroutines and functions + Functional groups of related procedures, subroutines and functions Data abstraction groups, uiliy groupsand concurrent processes. Modularizati + Modularization allows the designerto decompose. systeminto functional units, to impose hierarchical ordering on function usage, to implement data abstraction and to develop independently useful subsystem. + Where each modules and its submodules correspond toa processing step. + The execution sequence each modulehidesa difficultor changeable design decision from theothermodules. + Functionthat access and modify the data structures levels of abstraction. Goal of modularizatior + Reduce the complexity of the software and toimprove *Maintainabilty +Reusability “productivity Benefits of modularization: Productivity: + Development time should be shortened because several groups workon different modules with limited need forcommunication, Reusabili + ltshould be possible to make changes to one module without theneedtochange others, Comprehensibility: *Itshould be possible ostudy the system one module atte. Other modularization: * Additional criteria for deciding which functions to places in which modules ofa software system include * Hiding difficult and changeable design decisions * Limiting the physical size of modules. + Structuring the system toimprove observability and testability Coupling: © Coupling is the measure of the degree of interdependence between the modules. « Inother words, coupling is the strength of the relationships between modules, A good software will have low coupling. Coupling vs cohesior Coupling Cohesion High coupling and low coupling: High coupling: * High coupling means that modules are closely connected and changes in one module may affect other modules. Exampl A module that relies on specific implementation of another module. Low coupling: Low coupling means that modules are independent and changes in one module have little impact on other modules. Example: Modules that communicate through well-defined, simple interfaces. Types of coupling: The types of coupling are: Data Coupling. Stamp Coupling Control Coupling Common Coupling Content Coupling . Data coupling: * If the dependency between the modules is based on the fact that they communicate by passing only data, then the modules are said to be data coupled ML Data Variable Maun M2 Example-customer billing system 2. Stamp coupling: Stamp coupling occurs when modules share a composite data structure and use only parts of it, possibly different parts Record Data structure Record for ———————— > for module 1 module 2 8 Example- passing a whole record to a function that needs only one field of it. 3. Control coupling: © If the modules communicate by passing control information, then they are said to be control coupled. © It can be bad if parameters indicate completely different behavior and good if parameters allow factoring and reuse of functionality Module 1}s——{Module 2 Control information Example- sort function that takes comparison function as an argument 4. Common coupling: * The modules have shared data such as global data structures. © The changes in global data mean tracing back to all modules which access that data to evaluate the effect of the change. 5. content coupling: # Ina content coupling, one module can modify the data of another module, or control flow is passed from one module to the other module. Data Coupling ‘Stamp Coupling Control Coupling External Coupling Common Coupling Content Coupling Worst @ This is the worst form of coupling and should be avoided. COHESION + In computer programming, cohesion defines the degree towhich the elements of a module belong together. Thus, cohesion measures the strength of relationships between pieces of funetionality within a given module. For example, inhighly cohesive systems, functionalityis strongly related. * Cohesion isan ordinaltype of measurementandis generally described as "high cohesion” or"low cohesion.” ‘TYPES OF COHESION 1.Functional Cohesion: Functional Cohesion is said to existifthe ditferentelements ofa module, cooperate to achieve a single function. 2,Sequential Cohesion: A module is said to possess sequential cohesion ifthe elementof a module form the components of the sequence, where the output from one componentof the sequences inputtothe next. 3.Communicational Cohesion: A modules said to have communicationalcohesion, ifall tasks of the module refer to or update the same data structure, e.g, the setof functions definedonan array ora stack 4.Procedural Cohesion: A module is said to be procedural cohesion ifthe setofpurpose of the module are allparts ofa procedure in which particular sequence of steps has tobe cared out forachieving agoal,e.g,, the algorithm for decodinga message. 5, Temporal Cohesion: When a module includes functions that are associated by the act thatall he methods mustbe executed in the same time, the module is said to exhibit temporal cohesian. 6. Logical Cohesion: A module is said to be logically cohesive ifalthe elements ofthe ‘module performa similar operation. For example Error handling, data input and data output, ote. 7. Coincidental Cohesion: A modules said to have coincidental cohesion fit performs sotoftasks that are associated with each other very loosely, at all,

You might also like