CSC364 Software Engineering

Software EngineeringUnit 19 min read

Software Engineering Basics: Definitions, Models, Ethics & Risks

Unit 1 of Software Engineering introduces core concepts like the software crisis, engineering principles, development models (waterfall, agile), ethics, and risk management—foundational for all later units. Learn definitions, real-world applications, and how to apply COCOMO effort estimation.

TAKEAWAYS:

  • Software engineering is a disciplined approach to building high-quality software using models, metrics, and ethical practices.
  • The COCOMO model quantifies effort (person-months) and time for projects using lines of code (KLOC) and project modes (organic/embedded).
  • Waterfall vs. Agile: Waterfall is linear and document-driven; Agile is iterative and customer-focused.
  • Ethics in software engineering include intellectual property, privacy, and public safety—critical for legal compliance.
  • Risk management identifies threats (technical, project, business) and uses analysis (qualitative/quantitative) to mitigate them.
  • Configuration management tracks software versions, changes, and dependencies to ensure consistency.

Core Concepts: What Is Software Engineering?

Software engineering is not just programming. It is an engineering discipline that applies systematic, disciplined, and quantifiable approaches to develop, operate, and maintain software. The field emerged in the 1960s due to the "software crisis"—projects failing due to poor planning, unclear requirements, and unmanageable complexity.

Why Is It Called "Engineering"?

Engineering follows principles of design, construction, and maintenance to ensure reliability, efficiency, and scalability. Key characteristics:

  • Methodical: Uses models (e.g., waterfall, agile), metrics (e.g., COCOMO), and tools.
  • Iterative: Improves software through feedback (e.g., testing, inspections).
  • Ethical: Balances technical, legal, and societal impacts.


The Software Crisis and Its Solutions

The software crisis was defined by:

  1. Schedule overruns: Projects took years longer than estimated (e.g., IBM’s OS/360 in the 1960s).
  2. Budget failures: Costs exceeded projections by 100–200%.
  3. Poor quality: Bugs caused system failures (e.g., Ariane 5 rocket explosion in 1996 due to a reused software module).

Solutions introduced:

  • Structured methodologies (e.g., waterfall model).
  • Metrics (e.g., COCOMO for effort estimation).
  • Quality assurance (testing, inspections, reviews).
  • Agile and iterative models (e.g., Scrum, Kanban).

Development Models: Waterfall vs. Agile

Software projects use process models to organize work. Two dominant approaches:

1. Waterfall Model (Linear Sequential)

flowchart LR
    A["Requirements"] --> B["Design"] --> C["Implementation"] --> D["Testing"] --> E["Deployment"] --> F["Maintenance"]

Key Features:

  • Phases: Requirements → Design → Implementation → Testing → Deployment → Maintenance.
  • Documentation-heavy: Each phase must be completed before the next begins.
  • Rigid: Changes are difficult after requirements are locked.

Advantages:

  • Simple to understand and manage.
  • Works well for stable, well-understood requirements (e.g., government projects, embedded systems).

Disadvantages:

  • No going back: Late-stage changes are costly.
  • Late testing: Bugs found only after implementation.

Real-World Example:

  • Nepal’s eSewa (for utility payments) likely used a waterfall-like approach for its initial design due to regulatory stability.

2. Agile Model (Iterative and Incremental)

flowchart LR
    A["Plan"] --> B["Develop"] --> C["Test"] --> D["Review"] --> E["Repeat"]

Key Features:

  • Iterations (sprints): Work is divided into small, manageable chunks (2–4 weeks).
  • Customer collaboration: Frequent feedback loops.
  • Flexible: Requirements can evolve.

Advantages:

  • Early delivery: Functional software in weeks, not years.
  • Adaptability: Responds to changing needs (e.g., market trends).

Disadvantages:

  • Requires active customer involvement.
  • Documentation may lag behind code.

Real-World Example:

  • Pathao (ride-hailing app) uses Agile to rapidly iterate based on user feedback (e.g., adding new payment methods like Khalti).

COCOMO Model: Estimating Effort and Time

The Constructive Cost Model (COCOMO) estimates effort (in person-months) and development time based on lines of code (KLOC) and project complexity.

Formula for Effort (E) and Time (T)

For Organic Mode (small teams, experienced developers):

For Embedded Mode (complex, constrained environments):


Worked Example: COCOMO Calculation Problem: A project is estimated at 320 KLOC. Calculate effort and time for:

  1. Organic mode
  2. Embedded mode

Solution:

  1. Organic Mode:

  2. Embedded Mode:

Interpretation:

  • Embedded systems (e.g., NTC’s traffic management software) require 2.4x more effort and 1.3x more time than organic projects.

Software Engineering Ethics

Ethics ensures software is safe, fair, and legally compliant. Key principles:

  1. Public Welfare: Software must not harm users (e.g., WhatsApp’s end-to-end encryption protects privacy).
  2. Client/Employer Rights: Honesty in billing, deadlines, and quality.
  3. Product Responsibility: Fixing vulnerabilities (e.g., Ncell’s SIM card security updates).
  4. Professional Growth: Staying updated with certifications (e.g., ISO/IEC standards).

Example:

  • Google’s AI Ethics Board was dissolved in 2019 after conflicts over bias in facial recognition software. This highlights the need for transparency in algorithmic decisions.

Risk Management in Software Projects

Risks are uncertainties that can impact project success. Types of risks:

Category Examples Mitigation Strategy
Technical Unclear requirements, tech debt Prototyping, pilot testing
Project Team turnover, budget overruns Contingency funds, cross-training
Business Market changes, competitor actions Agile flexibility, market research

Risk Analysis Stages:

  1. Identification: List potential risks (e.g., Daraz’s order queue failing during Diwali sales).
  2. Assessment: Qualitative (low/medium/high impact) or quantitative (probability × cost).
  3. Prioritization: Focus on high-impact, high-probability risks.
  4. Mitigation: Develop response plans (e.g., load testing for NEPSE’s trading platform).

risk management flowchart**Steps from identification to monitoring in a software project (Image: Practicalpm, CC BY-SA 4.0, via Wikimedia Commons)


Software Configuration Management (SCM)

SCM ensures consistency and traceability of software changes. Key activities:

  1. Version Control: Track changes (e.g., Git for Pathao’s app updates).
  2. Change Management: Approve/modify code (e.g., pull requests on GitHub).
  3. Build Management: Compile and deploy versions (e.g., CI/CD pipelines).
  4. Release Management: Distribute updates (e.g., WhatsApp’s phased rollouts).

Why It’s Required:

  • Avoids "DLL hell" (conflicting library versions).
  • Enables rollbacks if a bug is introduced (e.g., Khalti’s payment system updates).

In the Real World

  1. eSewa’s Waterfall Approach:

    • Used a modified waterfall model for its initial design due to regulatory stability (e.g., NPRS compliance). Changes are now handled via Agile for new features like QR code payments.
  2. Pathao’s Agile Iterations:

    • Deploys weekly sprints to add features like Khalti integration or electric vehicle support, based on rider feedback.
  3. NTC’s Traffic Management System:

    • Uses embedded COCOMO for its real-time traffic monitoring software (320+ KLOC), requiring rigorous testing due to safety-critical nature.
  4. NEPSE’s Risk Mitigation:

    • Conducts load testing before T+2 settlement to avoid crashes during high-volume trading (a business risk).
  5. Bank Loan Interest Calculation (COCOMO Analogy):

    • A bank’s loan processing software (organic mode) might handle 50 KLOC with E ≈ 120 person-months, while a trading algorithm (embedded mode) for the same KLOC could take E ≈ 240 person-months due to low-latency requirements.

Exam Tip

  1. COCOMO Questions:

    • Always show all steps in calculations. Use the exact formulas from the question paper.
    • Memorize the exponents (1.05 for organic, 1.20 for embedded).
  2. Model Comparisons:

    • For waterfall vs. agile, compare flexibility, documentation, and use cases (e.g., waterfall for government projects, agile for startups).
  3. Ethics:

    • Link examples to real companies (e.g., Google’s AI ethics, Ncell’s data privacy).
  4. Risk Management:

    • Define technical vs. business risks clearly. Use Nepali examples (e.g., monsoon delays in outdoor ad software).
  5. SCM:

    • Explain version control using Git/GitHub as an example. Mention CI/CD if asked about automation.

Based on the TU BSc CSIT syllabus for Software Engineering (CSC364), unit 1.

Discussion

Loading…