Software Engineering (Mod 2)
Software Engineering (Mod 2)
Module 2 :
1. Software Life Cycle Models: (a) Waterfall (b) Prototype (c) Spiral Models
and their Comparison.
2. Software Project Management :
(a) Size Estimation- LOC and FP Metrics
(b) Cost Estimation- Delphi and Basic COCOMO
(c) Introduction to Halstead’s Software Science
(d) Staffing Level Estimation- Putnam’s Model.
-----------------------------------------------------------------------------------------------------------
2. System Design
• Create architecture and design based on the requirements.
• Design includes UI/UX design, database structure, class diagrams, etc.
• Tools: UML, ER diagrams, Wireframes.
3. Implementation (Coding)
• Developers write code based on the design.
• Code should follow standards and use version control (e.g., Git).
4. Testing
• Test the application for bugs, errors, and performance.
• Types: Unit Testing, Integration Testing, System Testing, User Acceptance
Testing (UAT).
5. Deployment
Page 2 of 38
• Deploy the application in a live environment for end users.
• May be done in phases (Beta testing, full release).
6. Maintenance
• Fix bugs reported by users.
• Update the system with new features.
• Ensure the app runs smoothly over time.
Summary Table
Phase Purpose
Page 3 of 38
Real-World Example: Food Delivery App
Phase Example
Bugs are fixed, and new features like “Live order tracking” are
Maintenance
added
1. Waterfall Model
• Definition:
A linear and sequential approach where each phase must be completed
before the next starts.
Page 4 of 38
• Phases:
Requirements → Design → Implementation → Testing → Deployment →
Maintenance
• Pros:
o Simple and easy to manage.
o Works well for small projects with clear requirements.
• Cons:
o Difficult to go back to a previous phase once completed.
3. Incremental Model
Page 5 of 38
• Definition:
The software is built and delivered in parts (increments). Each increment
adds functionality.
• Pros:
o Working software is delivered early.
o Easier to test and debug smaller parts.
• Cons:
o Requires good planning and design.
• Example: First version of a chat app sends text only, next versions add
video and file sharing.
4. Iterative Model
• Definition:
Software is developed in repeated cycles (iterations); each version
improves based on feedback.
• Pros:
o Good for large, complex projects.
o Easy to adapt to new changes.
• Cons:
o Requires heavy user involvement.
5. Spiral Model
Page 6 of 38
• Definition:
Combines iterative and waterfall approaches with emphasis on risk
analysis.
• Phases:
Planning → Risk Analysis → Engineering → Evaluation → (repeat)
• Pros:
o Best for high-risk, complex projects.
o Continuous risk management.
• Cons:
o Expensive and complex.
6. Agile Model
• Definition:
A flexible and collaborative approach based on rapid delivery, continuous
feedback, and customer involvement.
• Popular Methodologies:
Scrum, Kanban, XP (Extreme Programming).
• Pros:
o Fast delivery.
o Highly flexible to change.
• Cons:
o Requires active customer engagement.
Page 7 of 38
7. Prototype Model
• Definition:
A quick working prototype is built to understand requirements, which is
then refined based on user feedback.
• Pros:
o Clear understanding of user needs.
o Early detection of misunderstandings.
• Cons:
o Might increase overall development cost if not managed well.
Summary Table
Page 9 of 38
2. System Design
• Plan how to create the software based on requirements.
• Prepare design documents (architecture, database design, UI/UX).
3. Implementation (Coding)
• Developers write actual code based on the system design.
• Each module is developed and tested independently (unit testing).
5. Deployment
• Release the software to the client or the public.
6. Maintenance
• Handle any issues that come up after deployment.
• Fix bugs, make updates if needed.
Page 10 of 38
• Example: Fixing bugs if students are not able to submit answers.
Page 11 of 38
Scenario Description
1. Requirement Gathering
• Collect initial requirements from the client.
• Focus only on the important features to start with.
• Example: Client says they want a mobile app for booking hotel rooms.
2. Quick Design
• Make a basic design (rough version) with major screens/features.
• No full system yet, just rough screens, menus, and flows.
4. Customer Evaluation
• Show the prototype to the client/user.
• Gather feedback: What they like, dislike, what needs to change.
5. Refine Prototype
• Based on feedback, update and improve the prototype.
• Repeat the build-show-feedback cycle multiple times.
Page 13 of 38
When to Use the Prototype Model
• Requirements are not clear at the start.
• There is high user interaction (UI/UX heavy projects).
• Complex systems where visuals matter a lot (e.g., websites, apps).
• Projects where risk reduction is important.
Scenario Description
1. Planning Phase
• Define objectives, alternatives, and constraints.
• Identify requirements for the part being developed.
3. Engineering Phase
• Build and test the software (small part).
• Develop a prototype or part of the full system.
• Example: Implement and test the basic login form and database
connection.
Page 15 of 38
4. Evaluation Phase
• Get feedback from the customer/user.
• Evaluate the product and plan the next phase.
• Example: User tests the login, gives feedback like "add forgot password
feature."
Page 16 of 38
• Expensive (requires highly skilled people for risk analysis).
• Complicated to manage (needs proper documentation at every cycle).
• Not ideal for small, simple projects (overkill).
Scenario Description
Waterfall Model
• Linear and sequential development process.
• Move to next phase only after completing the current phase.
• No going back once a phase is completed.
• Low customer interaction during development.
• No risk analysis is done.
• Best suited for simple, stable, and clear requirement projects.
• Late error detection (only at testing phase).
Prototype Model
• Build a quick working model (prototype) first.
• Get customer feedback early and frequently.
Page 17 of 38
• Frequent updates and improvements based on feedback.
• Useful when requirements are not clear.
• No major risk analysis (only changes after feedback).
• Best suited for UI/UX focused and dynamic requirement projects.
• Can become costly if too many changes happen.
Spiral Model
• Iterative development combined with risk analysis.
• Development happens in loops (spirals).
• Each spiral has Planning → Risk Analysis → Engineering → Evaluation
phases.
• High customer involvement and frequent releases.
• Best for large, complex, and high-risk projects.
• Can be costly and complex to manage.
Tabular Comparison:
Page 18 of 38
Feature/Aspect Waterfall Model Prototype Model Spiral Model
Small to
Small to Medium Large and Complex
Project Size Medium
(user-driven apps) projects
projects
Key Takeaway:
• Use Waterfall when requirements are fixed and clear.
• Use Prototype when requirements are unclear and need lots of user
feedback.
• Use Spiral when the project is huge, complex, risky, and requires careful
planning.
Definition:
• LOC measures the total number of lines in a program's source code
(excluding comments and blank lines).
• It is a physical measure of the software's size.
Key Features:
• Simple and easy to calculate.
• Language-dependent (differs for C, Java, Python, etc.).
• Used in models like COCOMO for effort estimation.
Types of LOC:
• Physical LOC: Count of all code lines in the file.
• Logical LOC: Count of actual statements (e.g., if-else, loops, etc.).
Example:
java
Copy code
public class HelloWorld {
Page 20 of 38
public static void main(String[] args) {
System.out.println("Hello, World!"); // 1 statement
}
}
• Physical LOC = 4 (including class and method lines)
• Logical LOC = 1 (only the print statement)
Limitations:
• Doesn't measure functionality — just quantity.
• Discourages reuse (more code = higher LOC).
• Cannot compare projects written in different languages easily.
Definition:
• Function Point (FP) measures functionality provided to the user —
independent of the programming language.
• It is a logical measure of size.
Example:
If your system has:
• 3 External Inputs = 3 × 4 = 12
• 2 External Outputs = 2 × 5 = 10
• 1 External Inquiry = 1 × 4 = 4
UFP = 12 + 10 + 4 = 26
If CAF = 1.1
FP = 26 × 1.1 = 28.6
Advantages:
• Language independent.
• Focuses on user functionality.
• Encourages better design and reuse.
Page 22 of 38
Limitations:
• Complex to calculate compared to LOC.
• Needs trained professionals to estimate accurately.
• Still somewhat subjective in rating components.
Comparison: LOC vs FP
LOC (Lines of
Feature FP (Function Point)
Code)
Large or business-oriented
Better for Small systems
systems
Summary
• LOC is best for code-based size estimation, quick and easy to use.
• FP is better for user functionality-based estimation and multi-language
projects.
• Use FP for early-stage planning, and LOC once coding starts.
Technique Purpose
1. Delphi Technique
Definition:
• The Delphi Technique is a group decision-making method where multiple
experts estimate cost/effort independently and iteratively refine their
answers until a consensus is reached.
Page 24 of 38
Steps Involved:
1. Coordinator selects a group of experienced experts.
2. Each expert gives an independent estimate for cost/effort.
3. Coordinator summarizes all estimates and shares the summary
anonymously.
4. Experts revise their estimates based on feedback.
5. Repeat steps 3-4 until consensus is achieved.
Example:
• 5 software engineers independently estimate project effort:
o Estimates: 500 hours, 550 hours, 530 hours, 520 hours, 510 hours.
• After 2-3 rounds of discussion and refinement, they agree on 525 hours.
Advantages:
• Reduces bias (anonymous).
• Useful when historical data is missing.
• Takes multiple expert opinions into account.
• Flexible and adaptable to different projects.
Disadvantages:
• Time-consuming if many rounds are needed.
• Depends heavily on expert availability.
• Not very effective if experts lack experience.
Page 25 of 38
2. COCOMO (Constructive Cost Model)
Definition:
• COCOMO is an algorithmic model for software cost estimation, introduced
by Barry Boehm in 1981.
• It uses mathematical formulas based on project size (LOC) to estimate
effort, cost, and schedule.
Versions of COCOMO:
• COCOMO 81 (original version).
• COCOMO II (updated for modern software like web apps, agile projects).
Page 26 of 38
Project Type Description Examples
Example:
Suppose you have a simple Inventory System project estimated at 10 KLOC.
Constants for Organic type:
• a = 2.4, b = 1.05, c = 2.5, d = 0.38
Advantages:
• Gives quantitative estimates.
• Simple calculations once constants are known.
• Helps early-stage estimation based on LOC.
Disadvantages:
• Needs accurate LOC estimation early (which is hard).
• Ignores modern development practices (COCOMO II improves it).
• Assumes that project size is the only major factor.
Page 27 of 38
Comparison: Delphi vs COCOMO
Quick Summary
• Delphi: Best when you need human expert judgment.
• COCOMO: Best when you have a measurable project size (like KLOC).
Both are often used together — Delphi for refining COCOMO estimates!
Introduction to Halstead’s Software Science
Page 28 of 38
Halstead introduced seven key metrics to measure different aspects of software,
each of which can be used to calculate complexity and effort. These metrics are
derived from the operators and operands in the code.
Operators:
• Operators are the symbols or words that perform operations (e.g., +, -, *,
if, for).
• Example: a = b + c — + is an operator.
Operands:
• Operands are the values or variables that the operators act on (e.g., a, b, c
in the above example).
• Example: a = b + c — a, b, and c are operands.
Page 29 of 38
4. N₂ (Total Number of Operands):
o Total count of all operands in the program.
o Example: In if (x > 5) { x = x + 1; }, operands are x, 5, and 1.
o N₂ = 3 in this case.
5. V (Volume):
o Program volume is the measure of the amount of information in the
program.
o Formula:
V=(n1+n2)×log2(n1+n2)V = (n₁ + n₂) \times \log₂(n₁ + n₂)V=(n1+n2)×log2(n1+n2
)
o Example: If n₁ = 4 and n₂ = 3:
V=(4+3)×log2(4+3)=7×log27≈7×2.807≈19.649V = (4 + 3) \times \log₂(4 + 3) =
7 \times \log₂7 ≈ 7 \times 2.807 ≈ 19.649V=(4+3)×log2(4+3)=7×log2
7≈7×2.807≈19.649
o So, V ≈ 19.649.
6. D (Difficulty):
o Program difficulty measures how difficult it is to understand the
program.
o Formula:
D=n12×N2n2D = \frac{n₁}{2} \times \frac{N₂}{n₂}D=2n1×n2N2
o Example: If n₁ = 4 and n₂ = 3, and N₂ = 3:
D=42×33=2×1=2D = \frac{4}{2} \times \frac{3}{3} = 2 \times 1 = 2D=24×33
=2×1=2
o So, D = 2.
7. E (Effort):
Page 30 of 38
o Effort measures the total mental effort required to develop the
program.
o Formula:
E=D×VE = D \times VE=D×V
o Example: If D = 2 and V ≈ 19.649:
E=2×19.649≈39.298E = 2 \times 19.649 ≈ 39.298E=2×19.649≈39.298
o So, E ≈ 39.298.
Page 32 of 38
Advantages of Halstead’s Software Science:
1. Quantitative: Provides a numerical measure for complexity, effort, and
size.
2. Language Independent: Can be used across different programming
languages.
3. Easy to Calculate: Once you know the operators and operands, it’s simple
to compute the metrics.
4. Helps with Project Estimation: Helps in predicting the effort, time, and
resources required for a project.
Limitations:
1. Doesn’t Measure Quality: Measures quantity but doesn't account for code
quality or design.
2. Over-simplified for Complex Systems: Does not capture higher-level
complexities such as design intricacies.
3. Depends on LOC: Relies on line of code, which may not always reflect the
true complexity of the codebase.
Summary
• Halstead’s Software Science provides an algorithmic way to measure the
complexity and effort required to develop software.
• It calculates various metrics like volume, difficulty, effort, and time to help
estimate the cost and resources for a project.
• Useful for software quality management and project estimation.
Page 33 of 38
What is Putnam’s Model?
Putnam's model, also known as Putnam's Software Productivity Model, is a
mathematical model used to estimate the staffing requirements for a software
development project. It relates the effort (or size) of a project to the time and
number of developers (staff) required for completing the project.
• Developed by: Larry Putnam in 1978.
• Used for: Estimating the required staffing levels and effort needed to
complete a software project.
Page 34 of 38
Key Variables in Putnam’s Model:
1. K (Total Effort):
o The total effort required for the project, measured in person-
months.
2. T (Development Time):
o The development time for the project, in months.
3. S (Staffing Level):
o The staffing level or the number of people working on the project.
4. M (Total Person-Months):
o The total manpower effort (number of developers multiplied by the
time they work on the project).
Page 35 of 38
• The model assumes that the effort for completing the project follows a
non-linear relationship with time and staffing.
• It shows that:
o Small teams of developers working for long periods can still achieve
a large effort.
o Large teams working for short periods can also complete the project
with the desired effort, but it’s important to find the right balance
between time and staffing.
Page 37 of 38
o The model assumes a constant productivity rate over the entire
project, which may not be the case, especially if the team
composition changes.
2. Project-Specific Constants:
o The constants (a and b) need to be adjusted based on historical data,
which may not always be available for every project.
3. Complexity with Large Projects:
o The model becomes less accurate when estimating very large
projects, as it oversimplifies the relationship between effort, staffing,
and time.
4. Human and Organizational Factors:
o The model doesn't take into account human and organizational
factors, such as team dynamics, experience levels, and
communication issues.
Page 38 of 38