BIT302 Software Engineering

Software EngineeringUnit 98 min read

Software Estimation & Project Mgmt: Cost, Risk, Scheduling

Unit 9 of Software Engineering: Covers estimation techniques (COCOMO, function points), project management frameworks (Agile, Waterfall), risk analysis, scheduling tools, and real-world cost drivers in apps like eSewa and Daraz.

TAKEAWAYS:

  • Learn COCOMO and function-point analysis to estimate effort and cost for projects.
  • Understand critical path method (CPM) and Gantt charts for scheduling dependencies.
  • Identify risks (technical, organizational) and apply mitigation strategies.
  • Compare Agile vs. Waterfall for project flexibility and control.
  • Apply Earned Value Management (EVM) to track project performance.
  • Use Pareto principle to prioritize high-impact risks in Daraz-like e-commerce.

1. Software Estimation Techniques

Estimating software effort, cost, and schedule is critical for feasibility and budgeting. Two dominant methods are algorithmic cost models (COCOMO) and function-point analysis.

1.1 Algorithmic Cost Modeling (COCOMO)

COCOMO (Constructive Cost Model) by Boehm divides projects into three modes:

Simple projects (<2000 lines)OrganicModerate complexity (2000–5000 lines)Semi-DetachedHighly complex (>5000 lines)EmbeddedCOCOMO
Hierarchy of COCOMO project modes with line-of-code thresholds

COCOMO Formula:

Effort (person-months) = a × (KLOC)^b × EF
  • KLOC: Thousands of lines of code
  • EF: Effort multipliers (e.g., RELY, DATA, CPLX)
  • a, b: Constants (e.g., for Organic: a=2.4, b=1.05)

Worked Example: eSewa Payment Gateway Assume eSewa’s backend team estimates 15,000 lines of code for a new feature.

  • Organic mode: E = 2.4 × (15)^1.05 × EF
  • If EF = 1.2 (moderate risk), then E ≈ 45 person-months.
  • Cost: ₹45,000 × ₹100,000 (avg. dev salary) = ₹45M.

Advantages:

  • Quantifies effort mathematically.
  • Adjusts for project size and complexity.

Disadvantages:

  • Requires accurate KLOC estimates.
  • Ignores non-technical factors (e.g., team morale).

1.2 Function-Point Analysis (FPA)

FPA measures software size by user functionality (inputs, outputs, queries, files, interfaces). Steps:

  1. Count unadjusted function points (UFP).
  2. Apply complexity weights (simple=3, average=4, complex=6).
  3. Adjust for 14 environmental factors (e.g., TECN for tech experience).
  4. Calculate adjusted function points (AFP):
    AFP = UFP × (0.65 + Σ weights)
    
05.51116.522Input15Output22Queries8Files5Interfaces10
Example function-point breakdown (total = 60)

Example: Pathao Driver App

Function Type Count Weight Score (Count × Weight)
External Inputs 5 3 15
External Outputs 8 4 32
Total UFP 13 47
  • If TECN = 1.3 (moderate tech experience), then:
    AFP = 13 × (0.65 + 0.95) ≈ 22.5
    
  • Cost: ₹22.5 × ₹50,000 (per AFP) = ₹1.125M.

Advantages:

  • Focuses on user value, not code lines.
  • Works for legacy systems (no source code).

Disadvantages:

  • Subjective weighting.
  • Requires domain expertise.

2. Project Management Frameworks

Project management structures define how work is organized, scheduled, and monitored.

2.1 Waterfall Model

Sequential phases: requirements → design → implementation → testing → deployment → maintenance.

Use Case: NTC’s fiber-optic network rollout (phased deployment in rural areas).

  • Advantages: Clear milestones, easy documentation.
  • Disadvantages: Inflexible; late changes costly.

2.2 Agile Model

Iterative cycles (sprints) of 2–4 weeks, with continuous feedback.

flowchart TD
  A["Sprint 1"] --> B["Backlog Refinement"]
  B --> C["Sprint Planning"]
  C --> D["Development"]
  D --> E["Daily Standups"]
  E --> F["Sprint Review"]
  F --> G["Retrospective"]
  G --> H["Adapt Backlog"]
  H --> A
Agile sprint cycle with key activities (development and standups highlighted)

Use Case: Daraz’s inventory management system.

  • Advantages: Adaptive to changing demands (e.g., festival sales).
  • Disadvantages: Requires active stakeholder involvement.

Comparison Table:

Aspect Waterfall Agile
Flexibility Low High
Documentation Heavy Light
Risk Handling Late Early
Best For Predictable projects Dynamic environments

3. Risk Management

Risks can derail projects. Steps:

  1. Identify: Brainstorm potential risks (technical, organizational, external).
  2. Analyze: Assess likelihood and impact (use risk matrix).
  3. Mitigate: Plan responses (avoid, transfer, accept, reduce).
  4. Monitor: Track risks via risk registers.

Risk Matrix Example:

Likelihood Low Impact High Impact
High Accept Mitigate
Low Monitor Avoid

Worked Example: Ncell 5G Rollout

  • Risk: Delayed spectrum approval (external).
  • Mitigation: Partner with NTC for spectrum sharing.
  • Backup Plan: Use 4G as fallback during transition.

Common Risks in Software:

  • Technical: Overestimated KLOC, poor architecture.
  • Organizational: Unclear requirements, team turnover.
  • External: Regulatory changes (e.g., GDPR for eSewa).

4. Scheduling Techniques

4.1 Critical Path Method (CPM)

Identifies the longest path of tasks (critical path) that determines project duration.

Task 1: RequirementsTask 2: DesignTask 3: DevelopmentTask 4: TestingTask 5: Documentation
Critical path (red) determines project duration

Example: NEPSE Stock Market System Upgrade

  • Critical Path: Design → Development → Testing (12 weeks).
  • Non-critical: Documentation (can slip without delaying project).

4.2 Gantt Charts

Visual timeline of tasks with dependencies.

gantt
    title NEPSE Upgrade Timeline
    dateFormat  YYYY-MM
    section Development
    Backend:2024-01-01,12
    Frontend:2024-01-15,10
    Testing:2024-03-01,8

Advantages:

  • Shows parallel tasks.
  • Helps resource allocation.

Disadvantages:

  • Static; doesn’t account for dynamic changes.

5. Earned Value Management (EVM)

Tracks cost vs. schedule performance using:

  • Planned Value (PV): Budgeted cost for work scheduled.
  • Earned Value (EV): Budgeted cost for work completed.
  • Actual Cost (AC): Real cost incurred.
08162431PV (Planned Value)10 bitsEV (Earned Value)10 bitsAC (Actual Cost)12 bits
EVM key metrics: PV, EV, AC (32-bit example)

Formulas:

Schedule Variance (SV) = EV − PV
Cost Variance (CV) = EV − AC
CPI = EV / AC
SPI = EV / PV

Example: Khalti Wallet Scaling

Metric Planned (PV) Earned (EV) Actual (AC)
Month 1 ₹500,000 ₹450,000 ₹600,000
  • SV = ₹450K − ₹500K = −₹50K (behind schedule).
  • CPI = ₹450K / ₹600K = 0.75 (over budget).

Actions:

  • Reallocate resources to critical tasks.
  • Negotiate with vendors for cost savings.

In the Real World

  1. eSewa’s Cost Estimation:

    • Uses COCOMO to estimate backend costs for new payment gateways.
    • Function-point analysis for mobile app updates (e.g., UPI integration).
  2. Daraz’s Agile Scheduling:

    • Sprints align with festival sales (e.g., Dashain, Tihar).
    • Gantt charts track inventory replenishment vs. demand spikes.
  3. Ncell’s Risk Mitigation:

    • Critical path analysis for 5G tower deployment.
    • Risk registers track delays from land acquisition or regulatory approvals.

Exam Tip

  • Prioritize COCOMO and FPA (high weight in exams).
  • Draw diagrams: CPM, Gantt charts, risk matrices.
  • Compare Waterfall vs. Agile with real examples (e.g., NTC vs. Daraz).
  • Memorize EVM formulas (SV, CV, CPI, SPI).
  • Link risks to Nepalese context (e.g., NEPSE, Ncell).
  • For worked examples, assume:
    • COCOMO: Use Organic mode for small apps (e.g., Pathao driver app).
    • FPA: Count functions for a banking portal (loans, transfers).
    • CPM: Schedule a government e-governance project (e.g., online land records).

Based on the TU BIT syllabus for Software Engineering (BIT302), unit 9.

Discussion

Loading…