0% found this document useful (0 votes)
3 views2 pages

Difference Between Coupling and Cohesion

The document outlines key software engineering concepts including the differences between coupling and cohesion, the open-closed principle, and the static and dynamic structures of programming. It also discusses programming practices, incremental coding processes like test-driven development and pair programming, and common coding errors to avoid. Additionally, it includes a class diagram for a queue and mentions a sequence diagram for a library management system.

Uploaded by

Teshome Girma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Difference Between Coupling and Cohesion

The document outlines key software engineering concepts including the differences between coupling and cohesion, the open-closed principle, and the static and dynamic structures of programming. It also discusses programming practices, incremental coding processes like test-driven development and pair programming, and common coding errors to avoid. Additionally, it includes a class diagram for a queue and mentions a sequence diagram for a library management system.

Uploaded by

Teshome Girma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Difference Between Coupling and Cohesion


Coupling Cohesion
It refers to the degree to which elements within a
It refers to the degree of interdependence between modules or
single module or component work together to
components in a software system.
achieve a single purpose.
Inter-module Binding Intra-module Binding
Between two different modules. Between the same module.
Loose coupling High cohesion
Coupling is avoided for software. Cohesion is good for software.
2. What is Open-closed Principle
▪Principle: Classes should be open for extension but closed for modification
3. Briefly explain static structure and dynamic structure of structured programming.
1. A program has a static structure which is the ordering of stmts in the code – and this is a linear ordering
- order in which stmts are linear order
2. A program also has dynamic structure –order in which stmts are executed
4. list at least 4 programing practices that should be considered while writing a program
- Documentation, Code readability Testing, Error handling, Security practice, Maintainability

5. briefly explain an incremental coding process test driven development and pair programing
- An Incremental Coding Process : Write code for the module, unit test it, fix the bugs
▪It is better to do this incrementally – write code for part of functionality, then test it and fix it, then proceed
- Test Driven Development ▪ programmer first writes the test scripts and then writes the code to pass the test
cases in the script
- Pair Programming ▪Code is written by pair of programmers rather than individuals
6. least and explain at list three common coding errors that need to be avoided

- Memory Leaks- A memory leak is a situation, where the memory is allocated to the program which is not
freed subsequently
- Freeing an Already Freed Resource- Programmer tries to free the already freed resource
- NULL Dereferencing - Occurs when we access a location that points to NULL
- Lack of Unique Addresses - Aliasing creates many problems among them is violation of unique addresses
when we expect different addresses.
- Synchronization Errors - Possible when there are multiple threads which are accessing some common
resources, in a parallel program
- Buffer overflow - It is a security vulnerability, can be exploited by executing arbitrary code by a malicious
user
7. draw class diagram for queue

Queue
{private} front: int
{private} rear:int
{readonly} MAX:int
{public} add(element:int)
{public}remove():int
{protected}isEmpty():boolean

8. draw a sequence diagram for library management system

You might also like