Question 1 (1o Marks) Consider a program containing many modisam A between two m
ID: 3717174 • Letter: Q
Question
Question 1 (1o Marks) Consider a program containing many modisam A between two modules A and B . Is the coupling of modules A and B low or high? How can you modity this program to improve its coupling? Question 2 (6 Marks) Ia logical cohesion the module perforins a set of logically similar functions. If s tnodule has logical cohesion, what kind of coupling is this module likely to have with others? Question 3 (10 Marks) Discuss briefly the relationship between fornality and anticipation of change. uestion 4 (10 Marks) A key-manager module provides a different key every time a key is requested by a elien A key-manager can return keys to its clients, compare them for equality, keys is smaller. Design the key-manager module and describe the design using TDN. and determine which of two estion 5 (6 marks) Consider a module M that contains the following code structure: if cond then proci else proc2 Procedure proc1 is in module M1 and procedure proc2 is in module M2. In some executions proct may be executed and in others proc2 may be executed. What is the USES relation among the mod M, MI and M2? Justify your answer tion 6 (9 marks) This question contains three parts. All parts refer to the scenario described below. J your answers. Consider the following specification of a change command for a word processor: change (p,q) is defined by: for any sequence of characters s in the text if p s then replace p by q end if; end change; (a) Is this specification formal, semiformal or informal? (b) Is it operational or descriptive? (c) Is it ambiguous?Explanation / Answer
Hi,
Its against chegg policy to post multiple questions as one, please post others as separate questions
1.
Coupling is the term that is used to measure the degree of independence between modules.
As given in the question, both modules A and B use the global variable x, which means A and B are dependent on each other for the value x, and hence this is HIGH COUPLING, and is generally a bad practice in Software Engineering
b) The code can be made Low coupled by making the modules independent i.e instead of using global variable, the x variable should be passed as a parameter or injected via a dependency.
Thumbs up if this was helpful, otherwise let me know in comments
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.