BIT302 Software Engineering

Software EngineeringUnit 1211 min read

Open-Source Dev & Context Modeling: Licenses, Models, and Real-World Impact

Unit 12 of Software Engineering: Explores open-source development principles, licensing, collaboration models, and context modeling techniques to design software aligned with real-world needs, with practical examples from Nepal’s tech ecosystem.

TAKEAWAYS:

  • Open-source software (OSS) relies on licenses (MIT, GPL, Apache) to define usage, modification, and distribution rights, balancing innovation and legal protection.
  • Collaboration models like GitHub, GitLab, and SourceForge enable distributed teams to contribute code, review changes, and manage versions efficiently.
  • Context modeling (e.g., UML context diagrams) maps software boundaries, actors, and dependencies to clarify system scope and interactions.
  • Real-world impact: eSewa’s open-source payment SDK, Daraz’s inventory management tools, and NTC’s open Wi-Fi routers use OSS principles to reduce costs and accelerate development.
  • Worked example: Analyzing how Khalti’s API (used by Pathao) leverages open-source libraries to handle payment gateways securely.
  • Exam focus: Compare OSS licenses, draw context diagrams, and explain how open-source tools (e.g., Linux, WordPress) solve real problems in Nepal.

1. Introduction to Open-Source Development

Open-source software (OSS) is freely available source code that anyone can inspect, modify, and distribute under permissive or restrictive licenses. It fosters collaboration, transparency, and innovation by allowing global communities to contribute.

Why Open-Source Matters in Nepal

  • Cost savings: Government projects (e.g., Nepal’s Digital Nepal Initiative) use OSS to avoid licensing fees.
  • Local adaptation: Developers in Nepal contribute to OSS projects like Nepali language support for Linux or open-source ERP systems for SMEs.
  • Job opportunities: Companies like Pathao and Daraz hire developers skilled in OSS tools (e.g., Docker, Kubernetes).

Core Principles of Open-Source

mindmap
  root((Open-Source Principles))
    FreeRedistribution[Free Redistribution]
    SourceAvailability[Source Code Availability]
    DerivedWorks[Derived Works Allowed]
    IntegrityOfTheAuthor[Author’s Integrity]
    NoDiscrimination[No Discrimination Against Persons/Groups]
    NoRestrictionOnUse[No Restriction on Use]

2. Open-Source Licenses: A Comparison

Licenses define how OSS can be used, modified, and shared. Below is a comparison of the most common licenses:

MITPermissive (no copyleft)GPLCopyleft (strong)Apache 2.0Permissive (patent protection)AGPLCopyleft (network services)BSDPermissive (with attribution)
Comparison of common open-source licenses used in Nepalese projects
License Permissive Copyleft Viral Key Terms
MIT ✅ Yes ❌ No ❌ No Allows commercial use; no liability.
Apache 2.0 ✅ Yes ❌ No ❌ No Permissive but requires attribution; includes patent grants.
GPL (v2/v3) ❌ No ✅ Yes ✅ Yes Requires derived works to also be open-source ("copyleft").
LGPL ❌ No ✅ Yes ❌ No Allows linking with proprietary software (e.g., Linux kernel modules).
BSD ✅ Yes ❌ No ❌ No Minimal restrictions; often used in embedded systems.

Worked Example: eSewa’s Open-Source SDK

eSewa, Nepal’s leading digital payment platform, uses an open-source SDK (Software Development Kit) to allow merchants to integrate payment gateways. The SDK is licensed under MIT, meaning:

  • Developers can modify and redistribute it without restrictions.
  • Businesses (e.g., Daraz, Swaasthya Ghar) can embed eSewa payments into their apps without licensing fees.
  • Security: The open nature allows community audits (e.g., checking for vulnerabilities in transaction handling).

Why MIT?

  • Flexibility: Merchants can customize the SDK for niche use cases (e.g., micro-payments for rural health clinics).
  • Trust: Transparency reduces risks of hidden backdoors.

3. Open-Source Collaboration Models

OSS thrives on distributed collaboration. Key platforms include:

A. Version Control Systems (VCS)

  • Git (most popular) + GitHub/GitLab enable:
    • Branching: Developers work on features without disrupting the main codebase.
    • Pull Requests (PRs): Code reviews ensure quality (e.g., Linux kernel contributions).
    • Merge Conflicts: Tools like GitHub’s conflict resolution help teams sync changes.
sequenceDiagram
    participant Developer as Developer
    participant GitHub as GitHub
    participant MainBranch as Main Branch

    Developer->>GitHub: Pushes changes to feature/bugfix
    GitHub->>MainBranch: Detects merge conflict
    GitHub-->>Developer: Notifies via email/PR
    Developer->>GitHub: Resolves conflict locally
    Developer->>GitHub: Commits resolved changes
    GitHub->>MainBranch: Merges PR after approval

B. Issue Tracking & Project Management

  • Jira (used by NTC for network maintenance) tracks bugs and features.
  • Trello (used by Pathao for driver scheduling) visualizes workflows.
  • GitHub Issues links bugs directly to code (e.g., WordPress core development).

C. Community-Driven Development

  • Linux Kernel: Over 20,000 contributors (including Nepali developers like Sagar Arju).
  • WordPress: Powering 43% of all websites, with Nepali translators contributing to multilingual support.
  • Khalti’s Open-Source Tools: Uses Python libraries (e.g., PyCryptodome) for secure payment processing, which are open-source and auditable.

4. Context Modeling in Software Engineering

Context modeling defines what a system interacts with and how it fits into the larger environment. Key techniques:

  • UML Context Diagrams (show system boundaries).
  • Use Case Diagrams (identify actors and interactions).
  • Domain Analysis (understand business rules).

Worked Example: NTC’s Open Wi-Fi Router Deployment

Problem: NTC (Nepal Telecom) needs to deploy open Wi-Fi hotspots in rural areas without proprietary software costs.

Context Model:

erDiagram
    NTC ||--o{ Router : "deploys"
    Router ||--o{ User : "serves"
    Router ||--|| Hotspot : "configures"
    Hotspot ||--o{ Device : "connects"
    Router ||--|| Location : "located_in"
    Location ||--o{ Router : "has"
    Router ||--|| License : "uses"
    License ||--o{ Router : "applies_to"

Key Components:

  1. NTC (actor): Manages Wi-Fi networks.
  2. Router (system): Runs open-source firmware (e.g., OpenWRT).
  3. Users (actors): Connect via smartphones.
  4. Hotspot (subsystem): Authenticates users via RADIUS servers.

Why Open-Source?

  • Cost: OpenWRT is free, reducing hardware licensing costs.
  • Customization: NTC can modify firmware to block malicious traffic or prioritize government services.
  • Security: Community audits (e.g., CVE databases) help patch vulnerabilities faster.

5. Open-Source in Nepal: Real-World Cases

Company/Product OSS Idea Used How It Helps
eSewa MIT-licensed SDK Merchants integrate payments without fees; developers audit security.
Daraz Open-source inventory tools Uses Python + PostgreSQL for stock management, reducing cloud costs.
Pathao Open-source maps (OpenStreetMap) Real-time navigation without Google Maps API fees; supports Nepali road data.
NTC OpenWRT firmware Deploy cheap, secure Wi-Fi routers in rural areas.
Ncell Open-source VoIP tools Uses Asterisk PBX for call routing, reducing proprietary software costs.
NEPSE Open-source trading platforms Some brokers use open-source trading APIs for low-latency order execution.

6. Challenges of Open-Source Development

Challenge Impact Solution
Lack of Documentation New contributors struggle. Use wiki pages (e.g., Linux Documentation Project).
Security Risks Vulnerabilities if unpatched. Regular audits (e.g., OpenSSL Heartbleed fix).
Legal Ambiguities GPL violations in proprietary forks. Clear licensing clauses (e.g., LGPL for libraries).
Community Burnout Maintainers quit, projects stall. Sponsorships (e.g., Nepal’s Open Source Society funding projects).

7. Exam Tip: How to Score Full Marks

  1. Licenses:

    • Compare MIT vs. GPL in a table (as above).
    • Explain copyleft with an example: "GPL forces derived works to remain open-source, like Linux kernel modules."
  2. Context Modeling:

    • Draw a UML context diagram for a real system (e.g., Khalti’s payment gateway).
    • Label:
      • Actors: Merchant, User, Bank.
      • System Boundary: Khalti API.
      • Dependencies: Payment Gateway, Logging Service.
  3. Real-World Application:

    • Link to Nepal’s tech scene:
      • "Pathao uses OpenStreetMap to reduce GPS costs in rural areas."
      • "NTC’s open Wi-Fi routers save millions in licensing fees."
  4. Collaboration Models:

    • Describe Git workflows with a sequence diagram (as above).
    • Mention pull requests and code reviews (e.g., Linux kernel contributions).
  5. Avoid:

    • Vague answers like "Open-source is good." Instead, say: "Open-source reduces costs for NTC by 30% via OpenWRT, while proprietary routers would cost ₹500K per deployment."

Sample Exam Answer (Full Marks)

Question: "Explain how open-source licenses impact software development in Nepal, using eSewa as an example."

Answer: Open-source licenses define usage rights, directly affecting development in Nepal. The MIT license (used by eSewa’s SDK) allows:

  1. Merchants to integrate payments without fees, lowering Daraz’s transaction costs.
  2. Developers to modify the SDK for Nepali language support or offline payment modes.
  3. Security: Transparent code allows community audits (e.g., checking for SQL injection flaws).

Comparison with GPL:

Aspect MIT (eSewa) GPL (Linux Kernel)
Modification Allowed, even in proprietary software. Derived works must be open-source.
Use Case Merchant APIs (eSewa). Kernel modules (e.g., Wi-Fi drivers).

Impact in Nepal:

  • Cost savings: NTC uses OpenWRT (GPL) to deploy 10,000+ routers without vendor lock-in.
  • Local innovation: Nepali developers contribute to open-source ERP tools for SMEs.

Visual Summary for Quick Revision

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

Discussion

Loading…