Skip to main content
UNIT 3
Programming Technique
flutterjunction.com
Unit outline
● Types of Programming Techniques (Approaches)
● Program Development Model (Methods)
● Cohesion and coupling
flutterjunction.com
Introduction to Programming Techniques
A program is a set of instructions that a computer follows to perform a
specific task.
Programming techniques are methods and practices used by programmers
to write efficient, reliable, and maintainable code.
flutterjunction.co
Types of Programming Techniques
1) Modular
2) Top-down
3) Bottom-up
4) Procedural
5) Structured
6) Object Oriented
flutterjunction.co
1. Modular
Modular programming (also referred to as modular architecture) is a general
programming concept. It involves separating a program’s functions into independent
pieces or building blocks, each containing all the parts needed to execute a single aspect
of the functionality. Together, the modules make up the executable application program.
It was originated back in the 1960s.
Modularity is about making building blocks, and even building blocks made up of smaller
building blocks. Each is separate, strong, and testable, and can be stacked together at the
end to create your application. Thinking about modularity in this way also means that you
can build it into your code style and architecture. You can create rules and guidelines
around what modularity means at each level and how you handle certain things, like how
each part is defined and located within files, folders, and libraries.
flutterjunction.co
flutterjunction.co
Advantages of Modular Approach
Reusability: Modules can be reused in multiple systems, reducing the need to write new
code and increasing efficiency.
Maintenance: Modules can be updated or changed independently, which makes
maintenance easier and less time-consuming.
Scalability: New modules can be added or existing ones can be modified to meet changing
requirements, making the system more scalable.
Testing: Modules can be tested individually, reducing the time and effort required for testing
the entire system.
Readability: Modules provide a clear structure and hierarchy, making the code easier to
understand and maintain.
flutterjunction.co
Advantages of Modular Approach
Easily find things later
Modularity involves grouping similar types
of functions into their own files and
libraries, and splitting out related helper
functions into their own files (instead of
leaving them mixed in with the core logic
code).
With modular programming, you can make
finding specific code even easier, by creating
conventions for file names and locations.
flutterjunction.co
Disadvantages of Modular Approach
Complexity: Creating and maintaining the modules and their
interconnections can be complex and time-consuming.
Dependencies: Modules can have dependencies on other modules, which can
lead to problems if those dependencies are not well-managed.
Overhead: The modular approach can add some overhead, such as the need
to manage inter-module communication, which can impact performance.
Difficult debugging: Debugging a modular system can be more challenging,
as errors can occur in any of the modules and affect the rest of the system.
flutterjunction.co
2. Top Down
The top-down approach is a method of designing and developing a program
or system by breaking it down into smaller, more manageable parts, starting
with a high-level overview and gradually drilling down into the details.
In the top-down approach, the program or system is divided into a hierarchy
of modules, with each level representing a more detailed view of a specific
aspect of the system. The top-level module represents the overall system,
while lower-level modules represent the sub-components and functions that
make up the system.
flutterjunction.co
Example
Problem: To develop a system to store and manage student information, including student
ID, name, grades, and average grade. The system should be able to print the details of a
student, find the highest grade of a student, and calculate the average grade of a student.
Solution: We’ll use the top-down approach to solve this problem. Firstly, the process will
start by dividing the problem into sub-problems, such as:
● Designing a data structure to store student information
● Implementing functions to add, delete, and update student information
● Implementing functions to print the details of a student, find the highest grade of a
student, and calculate the average grade of a student
● Developing a user interface to interact with the system
flutterjunction.co
flutterjunction.co
Advantages of Top Down approach
Improved understanding: The top-down approach makes it easier to understand the overall
structure and organization of a system, as well as the relationships between its various components.
Better testing: The top-down approach makes it easier to test each component of a system
individually, reducing the risk of introducing bugs into the system as a whole.
Easier maintenance: The top-down approach makes it easier to maintain a system, as components
can be updated and modified individually without affecting the rest of the system.
Better collaboration: The top-down approach can facilitate collaboration between team members, as
each component can be assigned to a specific individual or team for implementation.
Better code organization: The top-down approach helps to organize the code into a clear and
structured hierarchy, making it easier to navigate and maintain.
flutterjunction.co
Disadvantages of Top Down approach
Rigidity: The top-down approach can lead to inflexibility, as changes in requirements or the
environment can be difficult to accommodate.
Increased development time: The top-down approach can take longer to implement, as each
component must be designed and implemented in turn.
Over-specification: The top-down approach can lead to over-specification, as components may be
specified in greater detail than is necessary.
Increased complexity: The top-down approach can lead to increased complexity, especially if the
system has many interdependent components.
Difficulty in accommodating change: The top-down approach can make it difficult to accommodate
changes in requirements or the environment, as changes in one component can affect the rest of the
system.
flutterjunction.co
Bottom Up Approach
The bottom-up approach, also known as the code-and-fix approach, is a method of
designing and developing software by starting with the implementation of individual
components or modules and gradually building the system up from there. This approach
is often used in the early stages of development when the requirements for the system
are not fully understood or when the development process is being prototyped.
In the bottom-up approach, individual components or modules are designed,
implemented, and tested in isolation, with each component being built up from smaller,
more basic components. Once all the components are functional, they are combined and
integrated into the overall system. The process of integration is typically repeated
multiple times until the system is fully functional.
flutterjunction.co
Example
Cooking a Meal: A chef starts with individual ingredients and combines them
to create a dish.
flutterjunction.co
flutterjunction.co
Advantages of Bottom up approach
Incremental development: The bottom-up approach allows for incremental development, with each
component being developed and tested individually before being integrated into the overall system.
Improved focus: The bottom-up approach encourages a focus on individual components, making it
easier to identify and address problems in a specific area of the system.
Better code reuse: The bottom-up approach makes it easier to reuse existing code, as components
can be developed and tested independently and then used in multiple systems.
Improved modularity: The bottom-up approach results in more modular code, with each component
having a well-defined purpose and clear inputs and outputs.
Enhanced debugging: The bottom-up approach makes debugging easier, as individual components
can be tested and debugged independently, before being integrated into the overall system.
flutterjunction.co
Disadvantages of Bottom up approach
Increased development time: The bottom-up approach can take longer to implement, as each component
must be designed, developed, and tested individually before being integrated into the overall system.
Increased complexity: The bottom-up approach can lead to increased complexity, as the relationships
between components can be difficult to understand and manage.
Inflexibility: The bottom-up approach can lead to inflexibility, as changes in requirements or the
environment can be difficult to accommodate.
Increased risk: The bottom-up approach increases the risk of errors and oversights, as it can be difficult to
ensure that all components are working correctly and integrated correctly into the overall system.
Lack of design: The bottom-up approach can result in a lack of design, as the overall design and structure of
the system may not be well understood or well-planned until the components have been developed.
flutterjunction.co
flutterjunction.co
flutterjunction.co
Procedural Approach
Procedural programming is a programming paradigm that is based on the concept of
procedures or functions. In procedural programming, programs are broken down into small,
manageable procedures or functions.It follows a top-down approach.
These functions are designed to perform a specific task, and they can be called upon by other
parts of the program whenever that task needs to be performed.
Procedural programming uses the concept of procedure abstraction.In procedural
programming, there is no concept of data hiding and inheritance.
In procedural programming, the function is more important than the data.
Procedural approach is a useful programming paradigm for simple programs.
Examples: FORTRAN, Pascal, COBOL, etc.
flutterjunction.co
Advantages of Procedural Approach
Easy to understand: Procedural programming is often considered to be easier to
understand, as it follows a clear and well-defined structure.
Reusable code: Procedures can be reused throughout the program, making it easier to write
efficient and modular code.
Improved debugging: The modular structure of procedural programming makes it easier to
debug and identify problems in the code.
Increased efficiency: Procedures can be optimized for speed and efficiency, making the
program as a whole more efficient.
Clear hierarchy: Procedures provide a clear hierarchy for the code, making it easier to
understand and maintain the program.
flutterjunction.co
Example
void
get_rectangle_dimensions(float
*length, float *width) {
printf("Enter the length of the
rectangle: ");
scanf("%f", length);
printf("Enter the width of the
rectangle: ");
scanf("%f", width);
}
float calculate_area(float length,
float width) {
float area = length * width;
return area;
}
// Step 3: Output
void display_result(float area) {
printf("The area of the rectangle
is: %.2f square unitsn", area);
}
int main() {
// Step 1: Input
float length, width;
get_rectangle_dimensions(&length,
&width);
// Step 2: Process
float area = calculate_area(length,
width);
// Step 3: Output
display_result(area);
return 0;
}
flutterjunction.co
Disadvantages of Procedural Approach
Inflexibility: The strict procedural structure can make it difficult to adapt the program to changing
requirements or the environment.
Increased complexity: Large programs can become complex and difficult to manage, as the number
of procedures and interactions between procedures increase.
Limited object-oriented features: Procedural programming lacks some of the features of object-
oriented programming, such as encapsulation and inheritance, making it less suitable for some
applications.
Less efficient memory usage: Procedural programming can lead to less efficient memory usage, as
data is often passed between procedures rather than being encapsulated within objects.
Limited scope for reuse: Reuse of procedures is limited to within the program, as procedures cannot
be easily shared between programs.
flutterjunction.co
Structured Approach
Structured programming is a programming paradigm that emphasizes
breaking a program down into smaller, manageable parts and organizing
them in a clear and organized manner. It is based on top down methodology.
The goal of structured programming is to make the program easier to
understand, modify, and maintain by breaking it down into smaller, logically
related parts. The goal of structured programming is to make the program
easier to understand, modify, and maintain.
eg.ALGOL, Pascal, Pl/I, C , Ada
flutterjunction.co
Advantages Structured Approach
Clarity and Readability: Programs written using structured programming are typically easier to
understand and follow, making them easier to maintain and modify.
Modularity: Structured programming encourages breaking a program down into smaller,
manageable parts, making it easier to identify and fix bugs, or add new features.
Reusability: By breaking a program down into smaller, reusable parts, structured programming
makes it easier to reuse code in other programs.
Debugging: Programs written using structured programming are typically easier to debug, as bugs
are easier to locate and isolate when the program is broken down into smaller, manageable parts.
Testing: Structured programming makes it easier to test individual parts of a program, making it
easier to ensure that each part works as expected before moving on to the next part.
flutterjunction.co
Disadvantages Structured Approach
Rigidity: It can sometimes be too rigid, making it difficult to accommodate changes or unexpected
requirements.
Complexity: It can sometimes result in overly complex programs, as the focus on breaking a program down
into smaller parts can lead to over-engineered solutions.
Lack of Flexibility: Programs written using structured approach may be less flexible than those written
using other programming paradigms, as the focus on structure can limit the ability to make changes or
accommodate new requirements.
Performance: Programs written using structured approach may be less efficient than those written using
other programming paradigms, as the focus on structure can result in additional overhead or inefficiencies.
Limitations: Structured programming may not be well-suited for certain types of problems or projects, as
the focus on structure can limit the ability to solve more complex or abstract problems.
flutterjunction.co
Object Oriented Approach
Object-oriented approach is a way of writing computer programs that uses "objects"
to represent data and the actions that can be performed on that data. These objects
are like real-world objects, as they have both properties (data) and behaviors
(functions that operate on that data).
Object-oriented programming follows a bottom-up approach. It has access specifiers
like private, public, protected, etc.It provides data hiding so it is more secure. In this
approach, data is more important than function. It is based on the real world.
It is used for designing large and complex programs.
Eg. Java, C++, Dart
flutterjunction.com
Advantages of Object Oriented
Encapsulation: Objects can hide their data from other parts of the program, making it easier to
change the implementation of an object without affecting other parts of the program.
Reusability: Objects can be easily reused in other parts of the program, making it easier to write new
applications and faster development time.
Modularity: Programs can be broken down into smaller, self-contained objects that can be developed
and tested independently.
Abstraction: Object-oriented programming provides a way to represent complex systems as a set of
objects that represent real-world entities. This makes it easier to understand and maintain the code.
Inheritance: Object-oriented programming provides a way for new objects to inherit properties and
behaviors from existing objects, reducing the amount of code that needs to be written.
flutterjunction.co
Disadvantages of Object Oriented
Complexity: Object-oriented programming can lead to more complex programs than
procedural programming, making it harder to understand, debug and maintain.
Overhead: Object-oriented programming can be slower than procedural programming
because of the extra overhead of managing the objects.
Rigidity: The strict structure of object-oriented programming can make it difficult to adapt to
changing requirements.
Steep Learning Curve: Object-oriented programming can be harder to learn than procedural
programming, especially for people with little or no programming experience.
Lack of Flexibility: Object-oriented programming can be inflexible, as objects are defined with
specific properties and behaviors that cannot be easily changed.
flutterjunction.co
flutterjunction.co
flutterjunction.co
Program/Software Development Model
Software Development Life Cycle (SDLC) is a process used by the software industry to design, develop and test high
quality softwares. The SDLC aims to produce a high-quality software that meets or exceeds customer expectations,
reaches completion within times and cost estimates.
SDLC is a process followed for a software project, within a software organization. It consists of a detailed plan
describing how to develop, maintain, replace and alter or enhance specific software. The life cycle defines a
methodology for improving the quality of software and the overall development process.
1) Waterfall Model/ Traditional Model
2) Prototype/ Transformation Model
3) Spiral Model
4) Iterative Model
5) V-model
6) RAD Model
7) Big Bang Model
8) Evolutionary Model
flutterjunction.co
Program/Software Development Model/ Lifecycle
flutterjunction.co
Waterfall model
The Waterfall Model was the first Process Model to be introduced. It is also referred to as a linear-
sequential life cycle model. It is very simple to understand and use. In a waterfall model, each phase
must be completed before the next phase can begin and there is no overlapping in the phases.
The Waterfall model is the earliest SDLC approach that was used for software development.
The waterfall Model illustrates the software development process in a linear sequential flow. This
means that any phase in the development process begins only if the previous phase is complete. In
this waterfall model, the phases do not overlap.
Waterfall approach was first SDLC Model to be used widely in Software Engineering to ensure success
of the project. In "The Waterfall" approach, the whole process of software development is divided into
separate phases. In this Waterfall model, typically, the outcome of one phase acts as the input for the
next phase sequentially.
flutterjunction.co
Waterfall model
flutterjunction.co
Advantages of Waterfall model
1. This model is very simple and is easy to understand.
2. Phases in this model are processed one at a time.
3. Each stage in the model is clearly defined.
4. This model has very clear and well-understood milestones.
5. Process, actions and results are very well documented.
6. Reinforces good habits: define-before- design, design-before-code.
7. This model works well for smaller projects and projects where
requirements are well understood.
flutterjunction.co
Disadvantages of Waterfall model
No feedback path: In the classical waterfall model evolution of software from one phase to another phase is
like a waterfall. It assumes that no error is ever committed by developers during any phase. Therefore, it does
not incorporate any mechanism for error correction.
Difficult to accommodate change requests: This model assumes that all the customer requirements can be
completely and correctly defined at the beginning of the project, but actually customers’ requirements keep
on changing with time. It is difficult to accommodate any change requests after the requirements
specification phase is complete.
No overlapping of phases: This model recommends that a new phase can start only after the completion of
the previous phase. But in real projects, this can’t be maintained. To increase efficiency and reduce cost,
phases may overlap.
flutterjunction.co
Prototyping Model
The Prototyping refers to building software application/program prototypes which displays the functionality
of the product under development, but may not actually hold the exact logic of the original software.
Prototyping is becoming very popular as a software development model, as it enables to understand
customer requirements at an early stage of development. It helps get valuable feedback from the customer
and helps software designers and developers understand about what exactly is expected from the product
under development.
Prototype is a working model of software with some limited functionality. The prototype does not always
hold the exact logic used in the actual software application and is an extra effort to be considered under
effort estimation.
Prototyping is used to allow the users evaluate developer proposals and try them out before
implementation. It also helps understand the requirements which are user specific and may not have been
considered by the developer during product design.
flutterjunction.co
Prototyping Model
flutterjunction.co
Types of Prototyping Model
1) Rapid Throwaway Prototyping
2) Evolutionary Prototyping
3) Incremental Prototyping
4) Extreme Prototyping
flutterjunction.co
Types of Prototyping Model
1) Rapid Throwaway Prototyping
This technique offers a useful method of exploring ideas and getting
customer feedback for each of them. In this method, a developed
prototype need not necessarily be a part of the ultimately accepted
prototype. Customer feedback helps in preventing unnecessary design
faults and hence, the final prototype developed is of better quality.
flutterjunction.co
Rapid Throwaway Prototyping
flutterjunction.co
Types of Prototyping Model
2) Evolutionary Prototyping
In this method, the prototype developed initially is incrementally refined
on the basis of customer feedback till it finally gets accepted. In
comparison to Rapid Throwaway Prototyping, it offers a better approach
which saves time as well as effort. This is because developing a prototype
from scratch for every iteration of the process can sometimes be very
frustrating for the developers.
flutterjunction.co
Evolutionary Prototyping
flutterjunction.co
flutterjunction.co
Types of Prototyping Model
3) Incremental Prototyping
In this type of incremental Prototyping, the final expected product is broken into different
small pieces of prototypes and being developed individually. In the end, when all individual
pieces are properly developed, then the different prototypes are collectively merged into a
single final product in their predefined order. It’s a very efficient approach that reduces the
complexity of the development process, where the goal is divided into sub-parts and each
sub-part is developed individually. The time interval between the project’s beginning and
final delivery is substantially reduced because all parts of the system are prototyped and
tested simultaneously. Of course, there might be the possibility that the pieces just do not
fit together due to some lack of ness in the development phase – this can only be fixed by
careful and complete plotting of the entire system before prototyping starts.
flutterjunction.co
flutterjunction.co
Types of Prototyping Model
4) Extreme Prototyping – This method is mainly used for web development. It
is consists of three sequential independent phases:
a ) In this phase a basic prototype with all the existing static pages are
presented in the HTML format.
b) In the 2nd phase, Functional screens are made with a simulated data
process using a prototype services layer.
c) This is the final step where all the services are implemented and associated
with the final prototype.
flutterjunction.co
Advantages of Prototyping Model
1. Increased user involvement in the product even before its
implementation.
2. Since a working model of the system is displayed, the users get a better
understanding of the system being developed.
3. Reduces time and cost as the defects can be detected much earlier.
4. Quicker user feedback is available leading to better solutions.
5. Missing functionality can be identified easily.
6. Confusing or difficult functions can be identified.
flutterjunction.co
Disadvantages of Prototyping Model
1. Risk of insufficient requirement analysis owing to too much dependency on the prototype.
2. Users may get confused in the prototypes and actual systems.
3. Practically, this methodology may increase the complexity of the system as scope of the system may expand
beyond original plans.
4. Developers may try to reuse the existing prototypes to build the actual system, even when it is not technically
feasible.
5. The effort invested in building prototypes may be too much if it is not monitored properly.
flutterjunction.co
Spiral Model
Spiral model is one of the most important Software Development Life Cycle
models, which provides support for Risk Handling.The spiral model combines the
idea of iterative development with the systematic, controlled aspects of the
waterfall model. This Spiral model is a combination of iterative development
process model and sequential linear development model i.e. the waterfall model
with a very high emphasis on risk analysis. It allows incremental releases of the
product or incremental refinement through each iteration around the spiral.
The exact number of loops of the spiral is unknown and can vary from project to
project. Each loop of the spiral is called a Phase of the software development
process.
flutterjunction.co
Spiral Model
Based on the customer evaluation, the software development process enters
the next iteration and subsequently follows the linear approach to implement
the feedback suggested by the customer. The process of iterations along the
spiral continues throughout the life of the software.
The Radius of the spiral at any point represents the expenses(cost) of the
project so far, and the angular dimension represents the progress made so
far in the current phase.
It is also called meta model(model about model) as it contains all the life cycle
method.
flutterjunction.co
Spiral Model
A business analyst is required to reduce the risk with the help of developer
and client then we can say how much cost it will take to develop.
flutterjunction.co
Spiral Model
flutterjunction.co
Phases of Spiral Model
Objectives determination and identify alternative solutions
Requirements are gathered from the customers and the objectives are identified,
elaborated, and analyzed at the start of every phase. Then alternative solutions
possible for the phase are proposed in this quadrant.
Identify and resolve Risks
During the second quadrant, all the possible solutions are evaluated to select the
best possible solution. Then the risks associated with that solution are identified
and the risks are resolved using the best possible strategy. At the end of this
quadrant, the Prototype is built for the best possible solution.
flutterjunction.co
Phases of Spiral Model
Develop next version of the Product
During the third quadrant, the identified features are developed and verified
through testing. At the end of the third quadrant, the next version of the
software is available.
Review and plan for the next Phase
In the fourth quadrant, the Customers evaluate the so far developed version
of the software. In the end, planning for the next phase is started.
flutterjunction.co
Advantages of Spiral Model
Risk Handling: The projects with many unknown risks that occur as the development
proceeds, in that case, Spiral Model is the best development model to follow due to the
risk analysis and risk handling at every phase.
Good for large projects: It is recommended to use the Spiral Model in large and complex
projects.
Flexibility in Requirements: Change requests in the Requirements at later phase can be
incorporated accurately by using this model.
Customer Satisfaction: Customer can see the development of the product at the early
phase of the software development and thus, they habituated with the system by using it
before completion of the total product.
flutterjunction.co
Disadvantages of Spiral Model
Complex: The Spiral Model is much more complex than other SDLC models.
Expensive: Spiral Model is not suitable for small projects as it is expensive.
Too much dependability on Risk Analysis: The successful completion of the
project is very much dependent on Risk Analysis. Without very highly
experienced experts, it is going to be a failure to develop a project using this
model.
Difficulty in time management: As the number of phases is unknown at the
start of the project, so time estimation is very difficult.
flutterjunction.co
Iterative Model
In the Iterative model, iterative process starts with a simple implementation of
a small set of the software requirements and iteratively enhances the evolving
versions until the complete system is implemented and ready to be deployed.
An iterative life cycle model does not attempt to start with a full specification of
requirements. Instead, development begins by specifying and implementing
just part of the software, which is then reviewed to identify further
requirements. This process is then repeated, producing a new version of the
software at the end of each iteration of the model.
flutterjunction.co
Iterative Model
flutterjunction.co
Advantages
● Base Model
● Simple and Easy
● Small Projects
● Feedbacks
flutterjunction.com
Disadvantages
● No Phase Overlapping
● No Intermediate Delivery
● Rigid (No changes)
● Less Customer Interaction
flutterjunction.co
Big Bang Model
The Big Bang model is an SDLC model where we do not follow any specific
process. The development just starts with the required money and efforts as
the input, and the output is the software developed which may or may not be
as per customer requirement.
It does not follow a process/procedure and there is a very little planning
required. Even the customer is not sure about what exactly he wants and the
requirements are implemented on the fly without much analysis.
flutterjunction.co
Big Bang Model
The Big Bang Model comprises of focusing all the possible resources in the
software development and coding, with very little or no planning. The
requirements are understood and implemented as they come. Any changes
required may or may not need to revamp the complete software.
This model is ideal for small projects with one or two developers working
together and is also useful for academic or practice projects. It is an ideal
model for the product where requirements are not well understood and the
final release date is not given.
flutterjunction.co
Big Bang Model
flutterjunction.co
Advantages
● No formality
● Small team is required
● Delivery date not defined
● Flexible because requirements are not in clear in start
flutterjunction.co
Disadvantages
● Not a good model for complex and high-risk prone models
● Not suitable for large projects
● Budget wasted model
flutterjunction.co
V Model
The V-model is an SDLC model where execution of processes happens in a
sequential manner in a V-shape. It is also known as Verification and
Validation model.
The V-Model is an extension of the waterfall model and is based on the
association of a testing phase for each corresponding development stage.
This means that for every single phase in the development cycle, there is a
directly associated testing phase. This is a highly-disciplined model and the
next phase starts only after completion of the previous phase.
flutterjunction.co
V Model
flutterjunction.co
RAD Model
The RAD (Rapid Application Development) model is based on prototyping and iterative
development with no specific planning involved. The process of writing the software itself
involves the planning required for developing the product.
Rapid Application Development focuses on gathering customer requirements through
workshops or focus groups, early testing of the prototypes by the customer using iterative
concept, reuse of the existing prototypes (components), continuous integration and rapid
delivery.
Rapid application development is a software development methodology that uses minimal
planning in favor of rapid prototyping. A prototype is a working model that is functionally
equivalent to a component of the product.
flutterjunction.co
RAD Model
flutterjunction.co
Evolutionary Model
Evolutionary model is a combination of Iterative and Incremental model of software
development life cycle. Delivering your system in a big bang release, delivering it in
incremental process over time is the action done in this model. Some initial requirements and
architecture envisioning need to be done.
It is better for software products that have their feature sets redefined during development
because of user feedback and other factors.
The Evolutionary development model divides the development cycle into smaller, incremental
waterfall models in which users are able to get access to the product at the end of each cycle.
Feedback is provided by the users on the product for the planning stage of the next cycle and
the development team responds, often by changing the product, plan or process. Therefore,
the software product evolves with time.
flutterjunction.co
Evolutionary Model
flutterjunction.co
Cohesion and Coupling
Cohesion and Coupling are two key concepts in software engineering that
are used to measure the quality of a software system’s design.
Cohesion refers to the degree to which the elements within a single module
or component are related and work together to achieve a single purpose.
High cohesion means that the elements within a module are closely related
and work together to achieve a single, well-defined purpose. Low cohesion
means that the elements within a module are not closely related, and the
module may be performing multiple unrelated tasks.
flutterjunction.co
Cohesion and Coupling
Coupling refers to the degree to which one module or component relies on another
module or component. High coupling means that one module is highly dependent on
another module and requires a lot of interaction between them. Low coupling means
that modules or components are relatively independent of each other and can
function independently.
Both coupling and cohesion are important factors in determining the maintainability,
scalability, and reliability of a software system.
Low cohesion and high coupling can make a system difficult to change and test, while
high cohesion and low coupling make a system easier to maintain and improve.
flutterjunction.co
Types of Cohesion
1) Functional Cohesion: Functional Cohesion is said to exist if the different elements of a module,
cooperate to achieve a single function. In this type of cohesion, the elements inside a module work
together to achieve one common goal. The elements work in coordination with the main aim of
staying focused on the task assigned. They perform only the activities which are necessary to the
assigned work.
2) Sequential Cohesion
An element outputs some data that becomes the input for other element, i.e., data flow between the
parts. It occurs naturally in functional programming languages. Eg Sort->Search->Display
3) Communicational Cohesion:
It is when parts of a module are grouped because they operate on the same data.Example- update
record in the database and send it to the printer.
flutterjunction.co
Types of Cohesion
4) Procedural Cohesion : It is when parts of module are grouped as they follow a certain
sequence of execution. E.g a function which checks file permissions and then opens a file.A
set of instructions that must be completed in a specific order, such as a recipe for baking a
cake. Other is algorithm to decode message
5) Logical cohesion: This occurs when the elements of a module are related by a common
logical function or objective. This type of cohesion is considered to be stronger than
coincidental cohesion. An example of logical cohesion would be a module that contains
functions for processing data.A collection of tools that are used for gardening, such as a rake,
shovel, and gloves, all grouped together in a garden shed. Other is error handling, data input
and data output.
flutterjunction.co
flutterjunction.co
Types of Coupling
1) Content Coupling(Pathological coupling)
In a content coupling, one module can modify the data of another
module, or control flow is passed from one module to the other module.
This is the worst form of coupling and should be avoided. A change in
module will apply changes in depending module.
2) Common Coupling(Global Coupling)
It is when two modules share the same global data/variable. Changing
the shared resource implies changing all modules using it.
flutterjunction.co
Types of Coupling
3 ) External Coupling
External Coupling arises when two modules share an externally imposed data format,
communication protocols, or device interface. This is related to communication to
external tools and devices. With the help of external device two modules
communicate with each other.
4) Control Coupling
This occurs when one module passes control information to another module, such as
a flag or a command. An example of control coupling would be a function in module
A that calls a function in module B and passes a control flag as an argument. Here a
component passes parameters to control the activity of other component.
flutterjunction.co
Types of Coupling
5) Message Coupling
This occurs when two modules communicate with each other through message passing,
such as through a message queue or a socket. An example of message coupling would
be two modules communicating through a socket to exchange data. It can be achieved by
the state decentralisation.
6) Data Coupling
This occurs when two modules share data through parameters or arguments, and they
have no other dependency on each other. An example of data coupling would be a
function in module A that takes input parameters from module B and returns the results
to module B. If occur only when data can be passed between them.
flutterjunction.co
Types of Coupling
7) Stamp Coupling
This occurs when data is passed between modules in a composite data
structure. An example of stamp coupling would be a function in module A
that passes a complex data structure to a function in module B.
flutterjunction.co
flutterjunction.co
flutterjunction.co
Logics of Program Development
Logic refers to the process of reasoning and making sense of things. It
involves using a systematic approach to identify and solve problems, and to
make decisions based on evidence and facts. In computer programming,
logic is used to create algorithms and code that perform specific tasks or
solve particular problems. This involves breaking down complex problems
into smaller, more manageable components, and using logical steps to
design and implement a solution. The goal of using logic in programming is
to create software that is reliable, efficient, and easy to maintain.
flutterjunction.co
Types of Logics
1) Sequential
In this logic, the order of execution is always in sequence. It typically
refers to the order in which the code is executed. Normally, the code will
execute line by line or in a sequence, starting with lying 2 and three and so
on. The execution of each statement depends on the outcome of the previous
statement, and the program must follow a specific sequence of steps to
achieve the desired result.
flutterjunction.co
Types of Logics
1) Sequential
flutterjunction.co
Types of Logics
2) Selection Logic
Selection logic is a type of logic used in program development to make
decisions based on conditions. It involves evaluating one or more conditions
and performing different actions based on the result.
Selection logic is commonly implemented using conditional statements, such
as "if-else" or "switch-case" statements. These statements allow the program
to choose between different options based on the value of one or more
variables or expressions.
flutterjunction.co
Types of Logics
2) Selection Logic
flutterjunction.co
Types of Logics
3) Iterative Logic
Iterative logic is a type of logic used in programming that involves repeating
a set of instructions multiple times until a certain condition is met. It is also
commonly known as iterative control structures or looping constructs.
In iterative logic, a loop is used to execute a block of code repeatedly. The
loop continues to execute until a specified condition is met. Iterative logic is
commonly used in programs that require repetitive tasks, such as searching,
sorting, or processing large amounts of data.
flutterjunction.com
Iterative Logic
There are three types of iterative control structures in programming:
● For loop: The for loop is used to execute a block of code a fixed number of
times. It is commonly used when you know how many times you need to
execute a loop.
● While loop: The while loop is used to execute a block of code as long as a
specified condition is true. It is commonly used when you don't know how
many times you need to execute a loop.
● Do-while loop: The do-while loop is similar to the while loop, but it always
executes the code at least once before checking the condition. It is commonly
used when you want to ensure that a block of code executes at least once.
flutterjunction.co
Types of Logics
3) Recursive Logic
Recursive logic is a programming technique that involves defining a function in terms of itself. In
other words, a function calls itself to solve a problem by breaking it down into smaller sub-
problems. Recursive logic is often used to solve problems that have a recursive structure, such as
searching trees or traversing graphs.
The basic idea behind recursive logic is to divide a problem into smaller sub-problems that can
be solved more easily, and then combine the results to obtain the final solution. Each sub-
problem is solved by calling the same function recursively with a smaller input. This process
continues until the sub-problem is small enough to be solved directly, at which point the
recursion stops and the results are combined.
flutterjunction.co
Communication between the Modules
Communication between modules refers to the ways in which different parts of a program
interact and exchange information with each other. Modules are self-contained units of code
that perform specific functions or tasks, and communication between them is essential for
creating complex programs that can perform a wide variety of tasks. There are several ways in
which modules can communicate with each other, such as calling functions in other modules,
sharing variables, sending messages, or using APIs. Proper communication between modules is
important for building a program that is easy to understand, maintain, and extend.
Modular communication is characterized by the following relationship between the modules.
1) USES Relation
2) IS_COMPONENT_OF Relation
flutterjunction.co
Communication between the Modules
The "uses" relation refers to the relationship between two modules or components where one
module or component depends on the other to function correctly. In other words, a module or
component "uses" another module or component to accomplish its tasks. For example, a
payroll module might "use" a database module to store and retrieve employee information.
The "is_component_of" relation, on the other hand, refers to the relationship between a larger
system and its individual components or modules. It describes how the components or
modules fit together to form the larger system. For example, a payroll system might be
composed of several components or modules, such as a user interface module, a database
module, and a computation module. Each of these components or modules is a "component
of" the larger payroll system.
flutterjunction.co