Software Engineering
Subject: Software Engineering
Complete Software Engineering syllabus covering SDLC Models, SPM, Estimation (COCOMO, FP), Requirement Analysis, DFDs, Software Design, Coupling & Cohesion, OOAD, and UML Diagrams.
Concept Summary
# Software Engineering - Complete Theory & Master Revision Guide
A comprehensive, exam-oriented reference guide covering all 5 core units of Software Engineering for undergraduate computer science and competitive exams.
---
## Unit 1: Introduction, SDLC Models, SRS, Formal Specification, V&V
### 1.1 Software Development Life Cycle (SDLC) Models
- **Waterfall Model**: Sequential phase-driven model (Requirements -> Design -> Implementation -> Testing -> Maintenance). Best for stable, well-understood requirements. High risk for dynamic projects.
- **Prototyping Model**: Builds a working mock-up early to elicit customer requirements. Useful when user requirements are ambiguous.
- **Rapid Application Development (RAD)**: High-speed adaptation of Waterfall using component-based construction and prototyping. Project must be modularized into 60-90 day cycles.
- **Spiral Model (Boehm)**: Risk-driven iterative model combining Waterfall rigidity with Prototyping iteration. 4 quadrants: (1) Objective setting, (2) Risk assessment & reduction, (3) Development & validation, (4) Planning.
- **Agile Methodology & Scrum**: Iterative/incremental approach prioritizing working software and customer collaboration. Uses short Sprints (2-4 weeks), Daily Standups, Product Backlog, and Scrum Master.
### 1.2 Software Requirements Specification (SRS)
- Standardized by **IEEE 830 standard**.
- **Characteristics of Good SRS**: Correct, Unambiguous, Complete, Consistent, Ranked for importance/stability, Verifiable, Modifiable, Traceable.
- SRS documents **functional requirements** (what system should do) and **non-functional requirements** (performance, security, usability, reliability).
### 1.3 Formal Requirements Specification & Verification/Validation
- **Formal Specifications**: Uses mathematical notation (set theory, predicate calculus, logic) to define state and behavior without ambiguity (e.g., Z, VDM, Larch).
- **Verification vs Validation**:
- *Verification*: "Are we building the product right?" (Reviews, walkthroughs, inspections - Static testing).
- *Validation*: "Are we building the right product?" (Testing against actual user requirements - Dynamic testing).
---
## Unit 2: Software Project Management & Estimation
### 2.1 Project Estimation Techniques (LOC & Function Points)
- **Lines of Code (LOC)**: Direct size metric. Dependent on programming language syntax.
- **Function Point (FP) Analysis (Albrecht)**: Language-independent size estimation based on 5 Information Domain Characteristics:
1. External Inputs (EI)
2. External Outputs (EO)
3. External Inquiries (EQ)
4. Internal Logical Files (ILF)
5. External Interface Files (EIF)
- **FP Formula**: $FP = UFP \times [0.65 + 0.01 \times \sum EDI]$ where $UFP$ is Unadjusted Function Points and $EDI$ (or $CAF$) is Value Adjustment Factor based on 14 General System Characteristics (complexity range 0 to 5).
### 2.2 COCOMO Estimation Model (Boehm)
- **Basic COCOMO**: Effort $E = a \times (KLOC)^b$ person-months; Duration $D = c \times (E)^d$ months.
- *Organic*: $a = 2.4, b = 1.05, c = 2.5, d = 0.38$ (Small team, stable environment)
- *Semi-detached*: $a = 3.0, b = 1.12, c = 2.5, d = 0.35$ (Medium team, mixed experience)
- *Embedded*: $a = 3.6, b = 1.20, c = 2.5, d = 0.32$ (Strict hardware/software constraints)
- **Intermediate COCOMO**: Incorporates 15 Cost Drivers (Effort Multipliers $EAF$). $E = a \times (KLOC)^b \times EAF$.
- **Detailed COCOMO**: Applies phase-sensitive effort multipliers across subsystem components.
### 2.3 Risk Management & Project Scheduling
- **RMMM Plan**: Risk Mitigation, Monitoring, and Management.
- **Scheduling Tools**:
- **Gantt Chart**: Visual timeline of task schedules, dependencies, and progress.
- **PERT / CPM**: Network-based scheduling identifying **Critical Path** (longest path through network with 0 float/slack time).
- **PERT Expected Duration**: $T_e = \frac{a + 4m + b}{6}$ where $a$ = optimistic time, $m$ = most likely time, $b$ = pessimistic time.
---
## Unit 3: Requirement Analysis & Structured Analysis
### 3.1 Requirement Analysis & Specification
- **Analysis Tasks**: Problem recognition, Evaluation & synthesis, Modeling, Specification, Review.
- **Data Dictionary**: Centralized repository containing definitions of all data elements, data structures, data flows, and data stores used in analysis models.
### 3.2 Structured Analysis & Flow Diagrams
- **Data Flow Diagram (DFD)**: Graph showing data flow through a system.
- *Symbols*: Process (Circle/Bubble), Data Flow (Arrow), Data Store (Open rectangle/Parallel lines), External Entity (Square/Rectangle).
- *Levels*: Level 0 (Context Diagram - single process block representing entire system), Level 1 (Major subsystems), Level 2 (Detailed process breakdown).
- **Control Flow Diagram (CFD)** & **Process Specification (PSEC)**: Describes control signals and algorithmic step-by-step detail using Structured English, Decision Tables, or Decision Trees.
- **Behavioral Modeling & Finite State Machine (FSM)**: State Transition Diagrams (STD) showing system states, events, and transitions.
---
## Unit 4: Software Design & Modularity
### 4.1 Fundamentals of Software Design
- **Abstractions**, **Refinement**, **Modularity**, **Software Architecture**, **Information Hiding** (Parnas Principle).
### 4.2 Modular Design Metrics: Cohesion & Coupling
- **Cohesion** (Internal strength within a single module - Higher is Better):
1. *Functional* (Best/Highest): Module performs exactly one single targeted function.
2. *Sequential*: Output of one element is input to next.
3. *Communicational*: Elements operate on same input/output data.
4. *Procedural*: Elements execute in a specific sequence.
5. *Temporal*: Elements executed at same time (e.g., initialization).
6. *Logical*: Elements logically related but perform different actions.
7. *Coincidental* (Worst/Lowest): Elements combined randomly without meaningful relationship.
- **Coupling** (Interdependence between modules - Lower is Better):
1. *Data Coupling* (Best/Lowest): Modules communicate via simple scalar data parameters.
2. *Stamp (Data-Structure) Coupling*: Modules pass entire data structures (composite data).
3. *Control Coupling*: One module passes control flags/signals to influence execution flow of another.
4. *External Coupling*: Modules share external protocol/hardware interface.
5. *Common Coupling*: Modules share global variables/data structures.
6. *Content Coupling* (Worst/Highest): One module directly accesses/modifies internal data/code of another.
### 4.3 Cyclomatic Complexity (McCabe)
- Metric measuring logical complexity of a control flow graph $G$.
- Formulas:
1. $V(G) = E - N + 2P$ (where $E$ = edges, $N$ = nodes, $P$ = connected components, usually $P=1$).
2. $V(G) = P_{pred} + 1$ (where $P_{pred}$ = number of predicate/decision nodes).
3. $V(G) = \text{Number of enclosed bounded regions} + 1$.
---
## Unit 5: Object-Oriented Analysis & Design (OOAD) & UML
### 5.1 OOAD Concepts & Principles
- **Class & Object Modeling**: Mapping real-world domain entities to classes and objects.
- **Relationships**:
- *Association*: General semantic link between two classes.
- *Aggregation*: Weak "has-a" relationship (independent lifecycle).
- *Composition*: Strong "part-of" relationship (bound lifecycle).
- *Generalization/Inheritance*: "is-a" taxonomy hierarchy.
### 5.2 Introduction to Unified Modeling Language (UML)
- **Structural Diagrams**:
- **Class Diagram**: Static structure showing classes, attributes, operations, and relationships.
- **Object Diagram**: Snapshot of instances at runtime.
- **Behavioral Diagrams**:
- **Use Case Diagram**: System boundaries, Actors, Use Cases, `<<include>>` (mandatory dependency), `<<extend>>` (optional/conditional dependency).
- **Sequence Diagram**: Interaction diagram emphasizing time ordering of messages exchanged between lifelines.
- **Activity Diagram**: Dynamic flow of control/activities (similar to flowchart with parallel forks and joins).
- **State Machine / Statechart Diagram**: States, state transitions, and events for a single object state machine.
Key Revision Rules & Formulas
- Waterfall model is sequential; Spiral model is risk-driven; Agile Scrum is sprint-driven.
- IEEE 830 specifies standard guidelines for Software Requirements Specification (SRS).
- Verification checks product development against specifications ('Building right product?'); Validation checks against customer needs ('Building the right product?').
- Function Points (FP) measure software size independently of programming language syntax.
- Basic COCOMO effort formula is Effort = a * (KLOC)^b person-months.
- COCOMO software modes are Organic (small team), Semi-detached (medium team), and Embedded (tight constraints).
- Critical Path in PERT/CPM scheduling is the longest path with zero float/slack time.
- PERT Expected Time formula is Te = (a + 4m + b) / 6.
- Data Flow Diagrams (DFDs) use circles for processes, arrows for flows, rectangles for entities, and parallel lines for data stores.
- Cohesion measures internal module strength (Functional Cohesion is highest/best; Coincidental is lowest/worst).
- Coupling measures module interdependence (Data Coupling is lowest/best; Content Coupling is highest/worst).
- McCabe Cyclomatic Complexity formula is V(G) = E - N + 2P or V(G) = Predicates + 1.
Common Exam Pitfalls
- Confusing Verification (reviews/inspections without code execution) with Validation (running tests on software).
- Assuming Function Points (FP) depend on programming language syntax; FPs are strictly language-independent.
- Swapping the effort exponent b in COCOMO modes: Organic has b=1.05, Semi-detached b=1.12, Embedded b=1.20.
- Forgetting that the Critical Path in PERT/CPM has ZERO slack/float time and determines minimum project duration.
- Assuming high coupling is desirable; good modular design requires HIGH cohesion and LOW coupling.
- Confusing Functional Cohesion (best, single targeted task) with Coincidental Cohesion (worst, random grouping).
- Misinterpreting DFD symbols: processes are bubbles/circles, while external entities are rectangles.
- Confusing UML <<include>> (mandatory step executed every time) with <<extend>> (optional/conditional step).
- Calculating Cyclomatic Complexity V(G) without counting predicate decision nodes properly (forgetting to add 1).
- Confusing Aggregation (weak 'has-a', independent life) with Composition (strong 'part-of', bound life).