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

Module4 Software Engineering and Databases

Uploaded by

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

Module4 Software Engineering and Databases

Uploaded by

tlmanjula25
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 4

Software Engineering
& Database Systems
Essentials of Information Technology (1BESC104E/204E)

1st Year B.E | Semester I/II

Topics: Software Life Cycle • Methodologies • Modularity • UML • Database Fundamentals • Relational Model
• SQL
Module 4 — Topics at a Glance

Software Engineering Discipline Modularity


7.1 7.4
What is software engineering? Challenges in building large Coupling, Cohesion, Information Hiding, Structure Charts,
systems. UML.

Software Life Cycle Database Fundamentals


7.2 9.1
Requirements → Design → Implementa2on → Tes2ng. The 4
DBMS, Schemas, layers of database implementation.
stages.

Methodologies Relational Model


7.3 9.2
Waterfall, Incremental, Agile, Prototyping — how software is Relations, Tuples, SELECT, PROJECT, JOIN operations and
built. SQL.
7.1 — The Software Engineering Discipline

What is Software Engineering?


Software Engineering is the application of engineering principles, methods and tools to the development and
maintenance of high-quality software systems.

Why Software Engineering is needed?


Large software systems are complex. Software Engineering provides a systematic approach to planning, designing,
developing, testing and maintaining software. Without engineering practices, projects often exceed budget, miss
deadlines and contain defects.

During the 1960s and 1970s many software projects failed due to poor planning, cost overruns, unreliable software
and maintenance difficulties. This led to the birth of Software Engineering as a discipline.
7.1 — The Software Engineering Discipline

Objectives of Software Engineering


Produce reliable software Reduce development cost
Software should perform its An online banking system Software should be developed Developing the software
intended functions consistently should process transactions using efficient methods & correctly the first time reduces
without failures. accurately every time. resources to minimize expenses. the cost of fixing errors later.

Improve maintainability Deliver software on time


A college management
Software should be easy to WhatsApp regularly releases Software projects should be system must be ready before
modify, update and fix after updates to add features and completed & delivered according the start of the academic
deployment. correct bugs. to the planned schedule. year.

Meet customer requirements


Software should satisfy the needs A hospital management system should include
and expectations specified by the patient records, billing and appointment
customer. scheduling if requested by the client.

Key takeaway: Software engineering includes both technical AND management challenges — unlike traditional engineering.
7.2 — The Software Life Cycle

The software life cycle:

Development Use Maintenance

↺ Cycle continues for the life of the software

The 4 Stages of Development:

1 Requirements Analysis 2 Design 3 Implementation 4 Testing

Identify what the system must Create a plan for how to build Actual coding, database creation
Verify the software meets
do. Produce a Software the system. Define internal and file development.
requirements. Check each step,
Requirements Specification structure, blueprints and Programmers convert design
not just the final product.
(SRS). Involves all stakeholders. architecture. into working programs.
7.2 — The Software Life Cycle

Example: College Library Management System

1 Requirements Analysis 2 Design 3 Implementation 4 Testing

What should the library How will the software be Build the software through Check whether the
software do? built? coding. software works correctly.

• Librarian wants to store book • Design database tables:


• Programmers write the code. • Check whether books can be
details. • Books searched correctly.
• Students
• Students should be able to • Faculties • Create the database.
• Verify issue and return
search books. • Issue Records
• Develop the user interface. operations.
• System should record issue • Design screens:
• Connect screens with the • Test fine calculation.
and return of books. • Login Screen
• Search Book Screen database.
• Ensure student records are
• Fine should be calculated for • Issue/Return Screen stored properly.
late returns. • Fine screen
7.2 — The Software Life Cycle

Comparison: Civil Engineering vs Software engineering

1 Requirements Analysis 2 Design 3 Implementation 4 Testing

Civil Engineering Civil Engineering Civil Engineering Civil Engineering


Client meeting with Prepares architectural Starts the construction Quality inspection of the
requirements on site area, drawings, 3D elevations, using the approved building if it can take loads,
planning, number of Interior design etc. drawings if it is waterproof etc.
rooms, details of kitchen,
washrooms etc.

Software Engineering Software Engineering Software Engineering Software Engineering


Identify what the system Create a plan for how to Actual coding, database Verify the software meets
must do. Produce a build the system. Define creation and file requirements. Check each
Software Requirements internal structure, development. Programmers step, not just the final
Specification (SRS). Involves blueprints and convert design into working product.
all stakeholders. architecture. programs.
7.3 — Software Engineering Methodologies

• Early approaches to software engineering insisted on performing requirements analysis, design,


implementation, and testing in a strictly sequential manner.
• The belief was that too much was at risk during the development of a large software system to allow
for variations.
• As a result, software engineers insisted that the entire requirements specification of the system be
completed before beginning the design and, likewise, that the design be completed before beginning
implementation.
• In recent years, software engineering techniques have changed to trial-and-error process that is
often vital to creative problem solving.
• This gave rise to other methodologies of software engineering
7.3 — Software Engineering Methodologies
Waterfall Model Spiral Model
• Combines iterative development with risk analysis. Suitable for large
• A sequential model where each phase must be completed before the
and complex projects.
next begins. Suitable when requirements are stable.
• Planning → Risk Analysis → Engineering → Evalua2on. The cycle
• Each phase must complete before next begins. Traditional, rigid, no
repeats until completion.
going back.
• Each cycle (spiral) produces an improved version of the software.
• Advantage: Simple, easy to manage, clear milestones and well-
• Advantage: Spiral model effectively identifies and manages risks at
documented process.
every stage of development.
• Disadvantage: Difficult to incorporate changes, customer feedback
• Disadvantage: Spiral model is expensive and complex to implement
arrives late and risk of discovering issues late.
due to repeated risk analysis and iterations.
• Ex: Building construction follows a similar sequence. Foundation must
• Banking software and aircraft control systems use the Spiral Model
be completed before upper floors are built.
because they require extensive risk analysis and high reliability.

Agile / XP Prototyping
• A working model (prototype) of the system is developed before creating
• Agile is an iterative development approach where software is the final software which is shown to users to gather feedback and clarify
developed in small increments with continuous customer feedback. requirements.
• Work is divided into short cycles called sprints, usually lasting 1–4 • Based on user suggestions, the prototype is refined until the final
weeks. requirements are understood.
• Advantage: Flexibility, rapid delivery, customer involvement and • Advantage: Prototype model helps in understanding and refining user
easier adaptation to changing requirements. requirements at an early stage.
• Disadvantage: Agile model requires active customer involvement • Disadvantage: Users may mistake the prototype for the final product,
throughout the development process. leading to unrealistic expectations.
• Ex: Food delivery apps frequently update features based on user • Ex: An online shopping website may first develop a prototype showing the
feedback, making Agile highly suitable. homepage, product catalog, and shopping cart to gather customer
feedback before full development.
7.3 — Software Engineering Methodologies
Waterfall Model Spiral Model

Fixed requirements Risk management

Agile / XP Prototyping

Frequent changes Requirement clarification


7.4 — Modularity
Modularity is the division of software into manageable units, called modules, each of which deals with only a part of
the software’s overall responsibility. Each module performs a specific function and interacts with other modules
through well-defined interfaces.
Ex: In a hospital management system - Patient records, Pharmacy, Billing, ICU data, Laboratory management are all
separate modules which can be handled separately.

Without modularity With modularity

Difficult to understand Easy to understand


Difficult to test Easy to debug
Difficult to find errors Easy to modify
Difficult to modify Multiple programmers can work
7.4 — Modularity
Consider an example of college management software. It contains following modules
Student Module | Faculty Module | Examination Module | Fee Module | Library Module

How it facilitates understanding


Suppose there is a new engineer is hired to handle software maintenance & there is a change in library module

Without modularity With modularity Therefore……..

Only needs to understand • Developers can focus on one


Program would be the functions related to module at a time.
difficult to understand examinations, such as marks
• Learning and maintenance become
because all functions and entry, result processing, and
easier.
data would be mixed report generation. There is
no need to study the Fee • Overall readability of the software
together
Module or Library Module. improves.
7.4 — Modularity
Consider an example of college management software. It contains following modules
Student Module | Faculty Module | Examination Module | Fee Module | Library Module

How it facilitates debugging


Assume IA marks are not displayed properly

Without modularity With modularity Therefore……..

• Error location becomes easier.


Entire software code Directly inspect
• Less time is required for debugging.
must be checked. Examination Module. • Reliability improves.
7.4 — Modularity
Consider an example of college management software. It contains following modules
Student Module | Faculty Module | Examination Module | Fee Module | Library Module

How it facilitates modification


Suppose college introduces "Online Fee Payment"

Without modularity With modularity Therefore……..

• Maintenance becomes easier.


Entire software code Only Fee Module needs
• Cost of software development
might need editing. modification. reduces.
Structure Chart

A Structure Chart shows FUNCTIONS (modules) and their dependencies (who calls who). It represents
• Hierarchy of modules
• Relationship among modules
• Flow of control between modules

Advantages of structure chart


• Easy understanding of software hierarchy.
• Shows relationships among modules.
• Helps in program design.
• Simplifies testing and debugging.
• Supports modular programming.
Structure Chart — Tennis Game Example

Arrows in a structure chart = function calls. The top module controls all lower ones. This is the IMPERATIVE (procedural) paradigm approach.
Structure Chart — College management software example

Arrows in a structure chart = function calls. The top module controls all lower ones. This is the IMPERATIVE (procedural) paradigm approach.
7.4 — Modularity

Coupling Cohesion Information Hiding


Connection between modules Internal unity of a module Restrict internal details

Control coupling: function Logical cohesion: module Each module hides its
calls between modules does related tasks internal workings
7.4 — Modularity

Coupling Cohesion Information Hiding


Goal: MINIMIZE Goal: MAXIMIZE Goal: RESTRICT

Coupling is the degree of dependency Cohesion measures how closely related the Hide the internal working of a module and
between modules. functions inside a module are. expose only necessary functionality.

"If one module changes, will other modules be "Are all functions inside the module doing the “Is this information required to be shown
affected?" same kind of work?" here?"

Example: Whatsapp has chat module, calling module, Example: Amazon shopping cart module
Example: Amazon payment module.
status module, payment module.
Imagine the Shopping cart Module has Add Item,
When we buy a product, we only see ‘Buy now’ button,
Imagine the Chat Module directly depends on the Remove Item, Update Quantity, View Cart – High
‘Enter card details’ and ‘Payment successful’
Status Module. cohesion.
We should not see ‘Bank server communication’, ‘Fraud
If the Status Module crashes, chat may stop working Imagine the Shopping cart Module has Add Item,
detection code’, ‘Database transactions’.
and messages may not be delivered. Remove Item, Product Review, Customer Support,
Payment Processing – Low cohesion

High coupling – Bad software High cohesion – Good software A good software hides internal
Low coupling – Good software Low cohesion – Bad software implementation details
7.5 — Tools of trade

CASE Tools
Project Planning Tools
Project Management Tools
Documentation Tools
Prototyping Tools
Interface Design Tools
Programming Tools
IDEs

Unified Modeling Language


Standard graphical modeling language
Used for visualization, design and documentation
Includes Use Case, Class, Sequence and Activity diagrams
7.5 — Unified Modeling Language (UML)
Unified Modelling Language (UML) is a standardized graphical language used for visualizing, specifying, constructing,
and documenting software systems. It provides a common language that can be understood by software developers,
analysts, designers, managers, and customers.

Unified Modelling Language (UML) is a graphical modelling language used to represent the structure and behavior of a
software system before it is actually developed.

UML is NOT a Software like Powerpoint, AutoCAD, Whatsapp


UML is NOT a programming language like C++, Java, Python.

UML (Unified Modelling Language) is a graphical modelling language. Using this, diagrams are drawn which help
developers understand the software before coding starts.

Software tools used to create UML are StarUML, Visual Paradigm, Lucidchart etc.
7.5 — Unified Modeling Language (UML)

WHY UML IS NEEDED?


• When developing large software systems, it is difficult to understand the entire system using only text descriptions.
UML helps in creating graphical models that simplify system understanding.

• UML is used to:


• Visualize software systems
• Understand user requirements
• Design software architecture
• Improve communication among stakeholders
• Document software projects
7.5 — Unified Modeling Language (UML)

Role of UML in Software Engineering


1. UML for VISUALIZATION
Consider an example of Online Shopping System.

Without UML With UML

Customer says: Customer



"I want login, cart, payment, ──────────────────────────────────
tracking and review features." │ │ │
Login Add to Cart Make Payment
Developer imagines one thing. │
Tester imagines another thing. ▼
Track Order
7.5 — Unified Modeling Language (UML)

Role of UML in Software Engineering


2. UML for Communication
Consider an example of Food Delivery App

Without UML With UML

Customer says:
"I want order tracking." Customer ----------------> Place Order

Developer thinks: Customer ----------------> Track Delivery


Track restaurant status.
Customer ----------------> Make Payment
Customer actually means:
Track delivery boy location. Delivery Partner --------> Update Location

Miscommunication occurs.
7.5 — Unified Modeling Language (UML)

Role of UML in Software Engineering


3. UML for Documentation
Consider an example of WhatsApp

Without UML With UML

After 5 years:

Original developers leave. ┌──────────────────────────────┐
│ │ │
New developers join.
Chat Calling Status
No documentation exists. │

Payment
Nobody understands the system structure.
7.5 — Unified Modeling Language (UML)

Role of UML in Software Engineering


4. UML for Analysis and Design
Consider an example of Amazon

Without UML With UML

• Developers start coding directly.


Customer
• Later they realize:

No Wishlist feature. ┌──────────────────────────┐
│ │ │ │ │
No Return Product feature.
▼ ▼ ▼ ▼ ▼
Search Cart Wishlist Payment Return
Requirements were missed.
7.5 — Unified Modeling Language (UML)

Role of UML in Software Engineering


5. UML for Maintenance
Consider an example of Instagram

Without UML With UML

INSTAGRAM
• Need to add:
Reels Download Feature │
┌─────────────────────────────┐
│ │ │
Developers search through thousands of lines of Upload Photo Upload Reel Send Message

code.

Difficult and time-consuming. Download Reel
7.5 — Unified Modeling Language (UML)

UML consists of several diagrams used for different purposes.

Use Case Diagram Class Diagram Sequence Diagram Activity Diagram

Shows the sequence of


Shows the interaction between Represents classes, attributes, Represents workflow or sequence
interactions between objects over
users (actors) and the system. methods, and relationships. of activities.
time.
7.5 — Unified Modeling Language (UML)

A use case diagram depicts the proposed


system as a large rectangle in which
interactions (called use cases) between the
system and its users are represented
as ovals and users of the system (called actors)
are represented as stick figures. Commonly
used during requirement analysis to identify
user needs and system functionalities.
7.5 — Unified Modeling Language (UML)

A diagram which is a
notational system
for representing the structure
of classes and relationships
between classes.
Classes are represented by
rectangles and associations
are represented by lines.
Class diagrams are commonly
used during the design phase
of software development.
7.5 — Unified Modeling Language (UML)

A Sequence Diagram is a UML


diagram that shows how
different objects interact with
each other to perform a
specific task. It represents the
sequence of messages
exchanged between objects
over time. It helps developers
understand the flow of
operations in a system.
Sequence diagrams are
commonly used for processes
such as login, online payment,
and appointment booking.
7.5 — Unified Modeling Language (UML)

An Activity Diagram is a UML


diagram that shows the flow of
activities in a process from start to
finish. It helps in understanding the
sequence of actions and decision
points in a system. Activity diagrams
are commonly used to represent
workflows such as online shopping,
ATM transactions, and hospital
appointment booking.
9.1 — Database Fundamentals

A database is an organized collection of related data that can be accessed, managed and
updated efficiently.

USN Name Branch Semester


101 Rahul Civil 1
102 Anita CSE 1
103 Ravi Mechanical 1

Patient ID Name Age Disease Doctor


P101 Rahul 25 Fever Dr. Kumar
P102 Anita 30 Diabetes Dr. Sharma
P103 Ravi 40 Asthma Dr. Kumar
9.1 — Database Fundamentals

Why is it needed?
Example: College management software
College software has three parts let us say
• Accounts Department
• Examination Department
• Library Department

Without database

Accounts Examination Library

Rahul - Civil - Fee Paid Rahul - Civil - Marks Rahul - Civil - Books Issued
9.1 — Database Fundamentals

Why is it needed?
Example: College management software
If Rahul changes branch from Civil to Mechanical

Without database
Accounts Examination Library

Rahul - Mech - Fee Rahul - Mech - Rahul - Civil - Books


Paid Marks Issued

With database

Rahul When his branch is updated in the


┌───────────────────────────┐ database, all departments
│ │ │ automatically access the updated
Accounts Examination Library
information.
9.1 — Database Fundamentals

How Databases Help

Reduce Redundancy Improve Consistency Enable Data Sharing Support Decision Making

A database ensures that all users A database allows multiple users and Databases help organizations generate
A database stores information in a
access the same updated information. departments to access the same data reports and analyze large amounts of
centralized location, avoiding
Any change made to the data is simultaneously. This improves data. These reports assist management
unnecessary duplication of data. This
reflected throughout the system, coordination and communication in making informed decisions.
reduces storage space and makes data
management easier. reducing errors and conflicts. within an organization.

Student Principal can generate


Different reports such as:
information is All departments • Total students in each
stored once departments branch
see the same
instead of access the same • Fee collection status
information.
multiple times. database. • Examination results
• Library usage statistics
9.1 — Database Fundamentals

Flat file system vs database system

Flat file system Problem


A Flat File System stores data in
separate files without relationships Suppose you want to find:"All songs sung by Arijit Singh“
between them. Each department Your phone has to search through hundreds of separate
Music Folder files.
maintains its own files
independently. ├── Song1.mp3 Similarly, if you want: "All romantic songs released after
├── Song2.mp3 2020“
Ex: Suppose your phone contains 500 ├── Song3.mp3 It becomes difficult because the information is scattered
├── Song4.mp3 across many files.
songs stored as MP3 files.
└── ...
This is similar to a Flat File System where data is stored as
Each file stores information such as: separate files.
Song, Name, Singer, Album,
Duration inside the file itself.
9.1 — Database Fundamentals

Flat file system vs database system

Database system
Advantage
A Database System stores all related Song Database
information in a centralized database Now you can instantly search:
SongID | Song Name | Singer | Album | Year
that can be accessed by different
-----------------------------------------------------------------------
users and departments. 101 | Kesariya | Arijit | Brahmastra | 2022
• All songs by Arijit Singh
102 | Apna Bana Le | Arijit | Bhediya | 2022
103 | Heeriye | Arijit | Single | 2023 • Songs released in 2023
Ex: Consider Spotify. The songs are
not searched by opening thousands • Romantic songs
of music files one by one. Instead,
• Top-rated songs
Spotify maintains a database.
9.1 — Database Fundamentals
9.1 — Database Fundamentals

You might also like