![]() Communicational/informational cohesion Communicational cohesion is when parts of a module are grouped because they operate on the same data (e.g., a module which operates on the same record of information). Procedural cohesion Procedural cohesion is when parts of a module are grouped because they always follow a certain sequence of execution (e.g., a function which checks file permissions and then opens the file). Temporal cohesion Temporal cohesion is when parts of a module are grouped by when they are processed - the parts are processed at a particular time in program execution (e.g., a function which is called after catching an exception which closes open files, creates an error log, and notifies the user). ![]() ![]() Example: Logical cohesion Logical cohesion is when parts of a module are grouped because they are logically categorized to do the same thing even though they are different by nature (e.g., grouping all mouse and keyboard input handling routines). Cohesion types, from the worst to the best, are as follows: Coincidental cohesion (worst) Coincidental cohesion is when parts of a module are grouped arbitrarily the only relationship between the parts is that they have been grouped together (e.g., a “Utilities” class). ![]() Cohesion is a qualitative measure, meaning that the source code to be measured is examined using a rubric to determine a classification.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |