1. Introduction to Software Design (1)
1. Introduction to Software Design (1)
Computer programs and related documentation such as requirements, design models and
user manuals.
Engineering is the application of scientific and practical knowledge to invent, design, build,
maintain, and improve frameworks, processes, etc.
https://www.javatpoint.com/software-engineering
https://www.geeksforgeeks.org/software-engineering-introduction-to-software-engineering/
Running
Software development life cycle (SDLC) is a structured process that is used to design,
develop, and test good-quality software. SDLC, or software development life cycle, is
a methodology that defines the entire procedure of software development step-by-step.
The goal of the SDLC life cycle model is to deliver high-quality, maintainable software
that meets the user’s requirements. SDLC in software engineering models outlines the
plan for each stage so that each stage of the software development model can perform
its task efficiently to deliver the software at a low cost within a given time frame that
meets users requirements. In this article we will see Software Development Life Cycle
(SDLC) in detail.
The SDLC Model involves six phases or stages while developing any software.
Stage-1: Planning and Requirement Analysis
Planning is a crucial step in everything, just as in software development. In this same
stage, requirement analysis is also performed by the developers of the organization. This
is attained from customer inputs, and sales department/market surveys.
The information from this analysis forms the building blocks of a basic project. The quality
of the project is a result of planning. Thus, in this stage, the basic project is designed with
all the available information.
Stage 4: Development
Stage 5: Testing
Spiral Model: One of the most flexible of the SDLC models is the spiral model. It
resembles the iterative model in its emphasis on repetition. Even this model goes through
the planning, design, build and test phases again and again, with gradual improvements
at each stage.
Wrapping-up SDLC
SDLC can be a great tool that can help us with the highest level
of documentation and management control. But failure to consider customer’s
requirements, users or stakeholders can lead to project failure.
Note:
Waterfall: Best for clear, stable projects with minimal changes.
V-Model: Good for projects with clear requirements and a strong focus on
testing.
Agile/Scrum: Ideal for projects with changing requirements and frequent client
interaction.
Spiral: Suitable for high-risk projects with evolving requirements.
RAD(Rapid Application Development) : Useful for projects needing rapid
development.
DevOps: Best for continuous integration and ongoing support
Role: Converts requirements gathered during the analysis phase into a structured design
document.
Details:
o Defines the architecture, components, modules, and data structures.
o Ensures that the design aligns with the business and technical requirements.
Role: Serves as a roadmap for developers to follow during the coding phase.
Details:
o Specifies how the system will be implemented, including coding standards and
technologies.
o Reduces ambiguity and ensures consistency across the development team.
Role: Ensures the system meets desired quality attributes such as performance, scalability, and
reliability.
Details:
o Promotes modularity, allowing easier maintenance and upgrades.
o Facilitates error detection and prevention during the design phase.
4. Supporting Reusability
Role: Identifies potential risks and challenges early in the development cycle.
Details:
o Provides a framework to assess feasibility, identify bottlenecks, and mitigate risks.
o Prevents costly changes by addressing issues before implementation.
Role: Makes testing more systematic by defining clear module boundaries and interactions.
Details:
o Promotes unit testing through modular design.
o Aids debugging by isolating issues to specific modules or layers.
Role: Acts as a medium to communicate the system structure and behavior to stakeholders.
Details:
o Uses diagrams and models (e.g., UML diagrams) to present the system visually.
o Helps non-technical stakeholders understand the system’s design.
Role: Lays the groundwork for maintaining and scaling the software post-deployment.
Details:
o Incorporates flexibility to accommodate future changes.
o Promotes documentation for easier understanding by new developers.
Role: Keeps the project aligned with its goals by providing a clear framework.
Details:
o Helps estimate development time and resource allocation accurately.
o Reduces delays by minimizing rework during later phases.
Definition:
Encapsulation is the process of bundling data (attributes) and methods (functions) that operate on the
data into a single unit, usually a class. It also involves restricting direct access to some components of the
object to enforce controlled interaction.
Key Characteristics:
Data Hiding: Protects the internal state of an object from unauthorized access.
Access Control: Uses access specifiers like private, protected, and public to control how data and
methods are accessed.
Modularity: Encapsulation groups related data and behavior, making the system easier to
understand and modify.
Encapsulated Classes: Often provide getter and setter methods to access or modify private
attributes indirectly.
Example (Encapsulation in Python):
class BankAccount:
def __init__(self, balance):
self.__balance = balance # Private attribute
def get_balance(self):
return self.__balance # Controlled access
Real-World Analogy:
Think of a capsule—it hides its contents and provides a controlled way to interact with them (e.g.,
ingesting it).
2. Abstraction
Definition:
Abstraction is the process of highlighting essential features and hiding unnecessary details. It focuses on
what an object does rather than how it does it.
Key Characteristics:
Essential Information Only: Users interact with high-level functionalities without worrying about
the underlying complexity.
Implementation Hiding: Details about how methods or systems work are abstracted away.
Interfaces and Abstract Classes: Abstraction is often achieved using these constructs, which
define what functionalities a class must implement.
class Vehicle(ABC):
@abstractmethod
def start(self):
pass
@abstractmethod
def stop(self):
pass
class Car(Vehicle):
def start(self):
print("Car starting with a key")
def stop(self):
print("Car stopping with brakes")
class Bike(Vehicle):
def start(self):
print("Bike starting with a button")
def stop(self):
print("Bike stopping with disc brakes")
Real-World Analogy:
Consider a car's dashboard—you know how to drive the car using the steering wheel, accelerator, and
brake, but you don’t need to understand the mechanics of the engine.
Key Differences
Aspect Encapsulation Abstraction
Hides data through controlled access (e.g., Hides implementation details from the
Visibility
private variables). user.
Aspect Encapsulation Abstraction
Encapsulation is about protecting data and ensuring controlled access, while abstraction is about
hiding implementation details and exposing only essential functionalities.
Encapsulation is often used to implement abstraction in object-oriented design. For example,
you might encapsulate the details of an abstract method within a derived class.
1. Loose Coupling
Definition:
Loose coupling occurs when modules or components have minimal dependencies on one another. They
interact through well-defined interfaces, reducing the impact of changes in one module on others.
Characteristics:
Independent Modules: Each module can function independently and requires minimal information
about others.
Clear Interfaces: Communication between modules is done via standardized interfaces or APIs.
Flexibility: Changes in one module typically do not affect others, making the system more
adaptable to modifications.
High Maintainability: Easier to update, replace, or scale individual components.
Reusability: Components can often be reused in different systems or contexts.
Example:
A REST API interacting with a frontend application. The frontend does not need to know the
backend’s implementation details as long as it adheres to the API contract.
Advantages:
Disadvantages:
Definition:
Tight coupling occurs when modules or components are highly dependent on each other's implementation
details. A change in one module often necessitates changes in others.
Characteristics:
Interconnected Modules: Modules have a high level of dependency and knowledge about each
other's internal workings.
Direct Interaction: Communication may occur directly without abstraction or standardization.
Limited Flexibility: Modifications in one module often lead to cascading changes.
Low Maintainability: More challenging to maintain or refactor as systems evolve.
Reduced Reusability: Components are less portable due to dependencies.
Example:
A frontend directly calling backend functions or relying on specific database structures instead of
an API layer.
Advantages:
Disadvantages:
Key Differences
Aspect Loose Coupling Tight Coupling
Maintainability Easier to maintain and refactor Challenging to maintain as the system evolves
Performance May involve performance overhead Often more efficient due to direct interactions
Loose Coupling: Preferred in large, scalable, and maintainable systems where future changes or
integrations are expected (e.g., microservices architecture).
Tight Coupling: Suitable for small systems where simplicity and performance are prioritized over
scalability.
Similarly, Cohesion refers to the degree to which elements within a module work together to fulfill a single,
well-defined purpose. High cohesion means that elements are closely related and focused on a single
purpose, while low cohesion means that elements are loosely related and serve multiple purposes.
1. Low Cohesion
Definition:
Low cohesion occurs when a module or component performs multiple, unrelated tasks or has
responsibilities that are not well-aligned with its purpose.
Characteristics:
Unfocused Functionality: The module tries to do too much, often leading to unrelated
responsibilities being grouped together.
Difficult to Understand: Understanding the module's purpose becomes challenging due to its
diverse tasks.
Hard to Maintain: Changes in one functionality can inadvertently affect others.
Reduced Reusability: The module cannot easily be reused in different contexts due to its lack of
focus.
Example:
A single class in an e-commerce system that handles user authentication, product inventory management,
and order processing all at once.
Advantages:
Disadvantages:
2. High Cohesion
Definition:
High cohesion occurs when a module or component performs a specific, well-defined task and all its
responsibilities are closely related to that task.
Characteristics:
A class in the e-commerce system that only handles user authentication, while other classes handle
inventory management and order processing.
Advantages:
Disadvantages:
Key Differences
Aspect Low Cohesion High Cohesion
Low, as changes in one part may affect High, with minimal impact on unrelated
Flexibility
others parts
Object-Oriented Design: Use classes that encapsulate specific responsibilities (e.g., single
responsibility principle).
Modular Systems: In large systems, modules or services should be cohesive to allow for easier
updates and scaling.
Microservices Architecture: Each service should perform a single, well-defined role.
Here while designing principles it is to make sure that coupling should be loose and
cohesion should be high while designing flexible systems. With loose coupling, we are
reducing dependencies between components by minimizing direct communication
between them and especially relying on interfaces. Now with high cohesion, the
functionality is confined within a module which ensures that components work together
for a common goal ensuring reusability and understandability.
4. Scalability and Performance
Building systems that are intended to manage increasing workloads or vast amounts of
data requires careful consideration of scalability and performance. System designers
should take into account both horizontal scaling (adding more instances or nodes) and
vertical scaling (raising the resources of a single node) to accomplish scalability. The
workload can also be distributed and system responsiveness increased by using
strategies like load balancing, caching, and asynchronous processing. To achieve
optimum performance, it’s critical to spot possible bottlenecks early in the design phase
and execute the necessary optimizations.
1. Performance
Definition:
Performance refers to how efficiently a system operates under a specific workload. It measures the
system's ability to process requests, execute tasks, and deliver results in a timely manner.
Key Characteristics:
Speed: How quickly the system processes tasks (e.g., response time, latency).
Throughput: The number of tasks or requests the system can handle in a given timeframe.
Resource Utilization: Efficiency in using CPU, memory, disk, and network resources.
Reliability: Consistency in delivering results within expected performance levels.
Performance Metrics:
Examples:
Goal:
Optimize speed, efficiency, and resource utilization for the current workload.
2. Scalability
Definition:
Scalability refers to a system's ability to handle increasing workloads by adding resources (hardware,
software, or both) without sacrificing performance.
Key Characteristics:
Horizontal Scalability: Adding more machines or instances to distribute the workload (e.g.,
scaling out).
Vertical Scalability: Upgrading the capacity of existing machines (e.g., scaling up by adding more
CPU or RAM).
Elasticity: Ability to dynamically scale resources up or down based on demand.
Graceful Degradation: Maintaining partial functionality under extreme loads.
Types of Scalability:
A cloud-based e-commerce platform scaling its infrastructure during Black Friday sales.
A database cluster adding more nodes to handle increasing query volume.
Goal:
Key Differences
Aspect Performance Scalability
Efficiency of the system under a given Ability to grow and handle increasing
Definition
workload. workloads.
A system can have high performance but low scalability, meaning it works well under current
conditions but cannot handle increased demand.
A scalable system is designed to maintain or improve performance as workload increases, but it
might not always be optimized for maximum performance at a smaller scale.
1. Performance:
o The application responds to user requests in under 200 milliseconds with current traffic
levels.
o Optimizations such as caching and database indexing improve speed.
2. Scalability:
o As traffic increases from 1,000 to 100,000 users, the application uses load balancing and
adds more servers to maintain the same response time.
Optimizing Both Performance and Scalability
Definition:
Fault tolerance refers to a system's ability to continue operating correctly even when one or more of its
components fail. It is a proactive approach to handling failures by incorporating redundancy and error-
handling mechanisms.
Key Characteristics:
Examples:
RAID Storage: Uses data redundancy across multiple disks to prevent data loss from a single disk
failure.
Failover Systems: Automatically switch to a backup server if the primary server goes down.
Error-Correcting Code (ECC) Memory: Detects and corrects data corruption in real-time.
Limitations:
2. Resilience
Definition:
Resilience is a broader concept that encompasses fault tolerance and focuses on the system's ability to
adapt, recover, and continue functioning under a wide range of disruptions, including unforeseen or
unpredictable events.
Key Characteristics:
Focus on Recovery and Adaptation: Addresses the ability to return to normal operations after
disruptions.
Flexibility: Adapts to both expected and unexpected failures or changes in conditions.
Holistic Approach: Considers the entire system, including infrastructure, processes, and people.
Proactive and Reactive: Incorporates fault tolerance but also emphasizes monitoring, learning,
and improving from disruptions.
Examples:
Cloud Computing: Automatically scales resources during a sudden spike in demand or after a
hardware failure.
Distributed Systems: Systems like blockchain networks that continue to function despite the
failure of individual nodes.
Disaster Recovery Plans: Organizational strategies to restore operations after natural disasters or
cyberattacks.
Advantages:
Key Differences
Aspect Fault Tolerance Resilience
Objective Prevents failures from interrupting operations. Recovers and adapts to disruptions.
Complexity Focused on specific fault scenarios. Considers the entire system’s robustness.
May involve higher resource costs for Balances resource costs with recovery
Cost
redundancy. strategies.
Complementary Nature
Fault Tolerance: A cloud provider ensures that if one server fails, traffic is automatically routed to
a redundant server without service interruption.
Resilience: The provider not only handles server failures but also adapts to large-scale disruptions
(e.g., data center outages, cyberattacks) by dynamically scaling resources, notifying affected
users, and improving system design to prevent future issues.
1. Privacy
Definition:
Privacy refers to the right of individuals or entities to control access to their personal information and how
it is collected, stored, shared, and used.
Key Characteristics:
Data Control: Users have the right to decide who can access their information.
Transparency: Organizations must inform users how their data is collected and used.
Compliance: Governed by laws and regulations, such as GDPR (General Data Protection
Regulation) and CCPA (California Consumer Privacy Act).
Minimization: Collecting only the necessary data to perform a specific function.
Examples:
A social media platform allowing users to set their profile visibility to "private."
Websites requesting user consent before tracking cookies.
Encryption of personal messages to prevent unauthorized access.
Threats to Privacy:
Real-World Analogy:
Think of privacy as curtains on a window—you control who can see into your house.
2. Security
Definition:
Security refers to the measures taken to protect systems, networks, and data from unauthorized access,
attacks, or damage.
Key Characteristics:
Access Control: Ensures that only authorized users or systems can access resources.
Confidentiality: Protects sensitive information from unauthorized disclosure.
Integrity: Ensures that data is accurate and not tampered with.
Availability: Keeps systems and data accessible to authorized users when needed.
Examples:
Threats to Security:
Real-World Analogy:
Key Differences
Aspect Privacy Security
Ensuring users' right to decide how Ensuring the confidentiality, integrity, and
Goal
their data is used. availability of systems and data.
Concerned with the who, what, and Concerned with the how of protecting data and
Scope
why of data access. systems.
Laws and
GDPR, HIPAA, CCPA. ISO 27001, NIST, PCI DSS.
Standards
Privacy depends on security: Without robust security measures, privacy cannot be ensured. For
example, a data breach can compromise both security and user privacy.
Security is broader: Security protects systems, while privacy focuses specifically on protecting
individual rights and data.
Complementary Goals: Privacy is about what to protect, and security is about how to protect it.
Practical Example: Online Banking
1. Privacy:
o Ensuring that users' account details and transactions are not shared with third parties
without consent.
2. Security:
o Protecting users' accounts with encryption, firewalls, and multi-factor authentication to
prevent unauthorized access.
Encryption: Ensures that sensitive data remains confidential (privacy) and inaccessible to
attackers (security).
Access Controls: Allow users to control data visibility (privacy) and restrict unauthorized access
(security).
Transparency: Informing users how their data is protected while implementing robust defenses.
Reference Links:
“What Is the Software Development Life Cycle (SDLC)? – Definition from
Techopedia.” Techopedia.com, www.techopedia.com/definition/22193/software-development-life-cycle-sdlc.
“SDLC (Software Development Life Cycle) Tutorial: What Is, Phases, Model.” Meet Guru99 – Free Training
Tutorials & Video for IT Courses, www.guru99.com/software-development-life-cycle-tutorial.html.
“What Is SDLC? Understand the Software Development Life Cycle.” Stackify, 12 Dec. 2017, stackify.com/what-
is-sdlc/.
https://www.geeksforgeeks.org/