Software Design and DevelopmentUnit 111 min read
Software Engineering: Definitions, Challenges & Principles
Unit 1 of Software Design and Development introduces core concepts of software engineering, including its definition, characteristics, challenges, and fundamental principles like abstraction, modularity, and reusability, with real-world applications and exam-focused insights.
What is Software Engineering?
Software engineering is the application of systematic, disciplined, and quantifiable approaches to the development, operation, and maintenance of software. It bridges the gap between raw programming and large-scale, reliable software systems.
Key Characteristics of Software Engineering
mindmap
root((Software Engineering))
Characteristics
Intangible: No physical form, exists as code/data
Complexity: High logical complexity (e.g., Facebook’s codebase: ~62 million lines)
Changeability: Requirements evolve (e.g., WhatsApp’s frequent updates)
Invisibility: Hard to visualize (unlike hardware)
Non-linear development: Iterative, not sequentialWhy is it different from programming?
| Aspect | Programming | Software Engineering |
|---|---|---|
| Focus | Writing code | Entire lifecycle (design, testing, maintenance) |
| Scale | Small scripts | Large systems (e.g., Ncell’s billing software) |
| Reliability | Trial-and-error | Systematic quality assurance |
| Team Size | Solo or small teams | Cross-functional teams (e.g., Daraz’s dev teams) |
Challenges in Software Development
Software projects face unique hurdles that traditional engineering doesn’t. Visualize the top 5 challenges in a layered model:
1. Changing Requirements
- Example: NTC’s online payment system (eSewa integration) required mid-project changes due to new government policies.
- Impact: Leads to scope creep (uncontrolled growth in project requirements).
- Solution: Use agile methodologies (iterative development).
2. Complexity
- Example: Pathao’s ride-matching algorithm involves real-time GPS, user preferences, and driver availability.
- Visualization: A spaghetti code vs. modular code comparison:
flowchart LR A["Spaghetti Code\n(Monolithic)"] B["Modular Code\n(Functions/Classes)"] C["Maintainable\nScalable"] A -->|"Hard to debug"| D["Unmaintainable"] B --> C
3. Maintenance
- Example: Banks (e.g., NMB) spend 60-80% of software budget on maintaining legacy systems.
- Types of Maintenance:
- Corrective (fixing bugs)
- Adaptive (updating for new OS)
- Perfective (adding features)
- Preventive (refactoring code)
Fundamental Principles of Software Engineering
1. Abstraction
- Definition: Hiding complex details while exposing essential features.
- Example: When you use
Math.sqrt()in Python, you don’t know the underlying algorithm—just the result. - Visual:
flowchart TD A["User\n(Calls sqrt(25))"] -->|"Abstraction"| B["Python Library\n(Hides algorithm)"] B --> C["Compiler\n(Optimizes code)"] C --> D["CPU\n(Executes assembly)"]
2. Modularity
- Definition: Breaking software into independent, interchangeable modules.
- Example: Daraz’s order processing system has modules for:
- User authentication
- Inventory management
- Payment gateway
- Benefits:
- Easier debugging (isolate modules).
- Reusability (e.g., login module used across apps).
3. Reusability
- Definition: Using existing components to build new systems.
- Example: Google uses open-source libraries (e.g., TensorFlow for AI) instead of writing everything from scratch.
- Techniques:
- Functions (procedural)
- Classes (OOP)
- APIs (e.g., WhatsApp’s business API for merchants)
4. Scalability
- Definition: Ability to handle growth in users/data without performance loss.
- Example: NEPSE’s trading platform must scale during high-volume days (e.g., Dashain sales).
- Approaches:
- Horizontal scaling (add more servers).
- Vertical scaling (upgrade hardware).
Software vs. Traditional Engineering
Compare software engineering to civil engineering (building bridges) and mechanical engineering (designing cars):
| Aspect | Software Engineering | Civil/Mechanical Engineering |
|---|---|---|
| Material | Code, data | Steel, concrete, metal |
| Testing | Unit tests, integration tests | Load tests, stress tests |
| Failure Impact | Data breaches, system crashes | Collapses, safety hazards |
| Versioning | Git, SVN | Blueprints, revisions |
| Physical Constraints | None (except hardware limits) | Physics (gravity, material strength) |
The Software Crisis and Its Solutions
The Software Crisis
- Definition: The gap between growing software needs and the ability to deliver reliable, maintainable systems.
- Causes:
- Poor planning (e.g., failed government e-services in Nepal).
- Lack of standards.
- Unrealistic deadlines.
Solutions: The Birth of Software Engineering
- Structured Programming (1960s): Use of top-down design.
- Object-Oriented Programming (1980s): Modularity via classes.
- Agile Methodologies (2000s): Iterative development (e.g., Scrum in startups).
- DevOps: Combining development and operations for faster releases.
In the Real World
eSewa (Nepal)
- Idea Used: Modularity + Scalability
- How: eSewa’s payment gateway is split into modules:
- User authentication (OAuth)
- Transaction processing (SQL/NoSQL)
- Fraud detection (AI/ML)
- Real Picture:
Pathao (Ride-Hailing App)
- Idea Used: Abstraction + Real-Time Systems
- How: Pathao hides complex algorithms (e.g., dynamic pricing, route optimization) behind a simple UI. Drivers see only "Accept Ride" or "Decline."
- Worked Example:
- A user requests a ride in Kathmandu.
- The app abstracts:
- GPS data → nearest available driver.
- Traffic conditions → optimal route.
- Payment → seamless UPI/Khalti integration.
NTC’s Fiber Optic Network
- Idea Used: Layered Architecture (OSI Model)
- How: NTC’s internet service relies on the 7-layer OSI model to ensure data travels reliably from your device to servers worldwide.
- Visual:
- Real Picture:
Worked Example: Designing a Simple ATM System
Scenario: Design a basic ATM for a Nepalese bank (e.g., NMB) with the following requirements:
- Check balance.
- Withdraw cash.
- Transfer funds.
Step 1: Apply Software Engineering Principles
| Principle | Application in ATM Design |
|---|---|
| Modularity | Separate modules for: UI, account database, security. |
| Abstraction | User sees "Withdraw Cash" button; hides SQL queries. |
| Reusability | Login module reused for mobile banking. |
Step 2: Layered Architecture
Step 3: Workflow (State Diagram)
stateDiagram-v2 [*] --> Idle Idle --> InsertCard["Insert Card"] InsertCard --> EnterPIN["Enter PIN"] EnterPIN --> ValidPIN["PIN Valid"] : Success ValidPIN --> MainMenu["Main Menu\n(Check Balance, Withdraw, Transfer)"] MainMenu --> Withdraw["Withdraw Cash"] Withdraw --> DispenseCash["Dispense Cash\n(If sufficient balance)"] DispenseCash --> [*] EnterPIN --> InvalidPIN["PIN Invalid"] : Failure InvalidPIN --> [*]
Step 4: Handling a Withdrawal Request
- User Action: Selects "Withdraw ₹5000."
- System Response:
- Checks balance (abstraction: hides SQL query).
- Validates amount (modularity: separate validation function).
- Dispenses cash (real-world integration with ATM hardware).
- Error Handling:
- Insufficient funds → "Insufficient Balance" message.
- Wrong PIN → "Card Blocked" (security principle).
Exam Tip
What to Expect in TU/PU Exams
- Definitions: Expect 2-3 marks questions on:
- Software engineering vs. programming.
- Key principles (abstraction, modularity).
- Short Answers (5-10 marks):
- Challenges in software development (explain 3 with examples).
- Differences between software and traditional engineering.
- Long Questions (15-20 marks):
- Design a simple system (e.g., library management, e-commerce cart) using software engineering principles.
- Compare methodologies (e.g., waterfall vs. agile—though this is Unit 2, Unit 1 may ask for early lifecycle phases).
- Case Studies:
- Analyze a real-world failure (e.g., Mars Climate Orbiter crash due to unit mismatch) and apply software engineering solutions.
- Diagrams:
- Draw layered architecture or state diagrams for given scenarios (e.g., traffic light system).
How to Score Full Marks
- Use real-world examples (e.g., eSewa, Pathao) to illustrate principles.
- Draw diagrams for:
- Layered architectures.
- State diagrams (e.g., ATM workflow).
- Compare and contrast (e.g., software vs. civil engineering).
- Explain "why" for every point (e.g., "Modularity helps because...").
Key Formula to Remember: For software complexity estimation, use Halstead’s Software Science: Where:
- = total occurrences of operands.
- = total occurrences of operators.
- = unique operands.
- = unique operators.
Example: For a simple Python function:
def add(a, b):
return a + b
- Operands:
a, b→ , - Operators:
+, return→ , - Program Length =
- Vocabulary =
Based on the TU BITM syllabus for Software Design and Development (IT242), unit 1.
Discussion
Loading…