BIT302 Software Engineering

Software EngineeringUnit 78 min read

Software Config & Version Mgmt: Tools, Workflows & Control

Unit 7 of Software Engineering: Covers software configuration management (SCM), version control systems (VCS), change management, baseline creation, branch strategies, and real-world tools (Git, SVN) with hands-on workflows, conflict resolution, and integration into CI/CD pipelines—all tied to Nepal’s tech ecosystem (e

Core Concepts: What is Software Configuration Management?

Software Configuration Management (SCM) is the discipline of tracking and controlling changes to software artifacts (code, docs, configs) to ensure consistency, traceability, and reproducibility. It answers:

  • Who changed what?
  • Why was it changed?
  • How do we roll back if needed?

SCM is not just version control—it’s a structured process with four pillars:

graph TD
    A["Software Configuration Management"] --> B["Version Control"]
    A --> C["Change Control"]
    A --> D["Configuration Identification"]
    A --> E["Configuration Auditing"]

Why does Nepal’s tech industry need this?

  • Daraz: Tracks inventory and order changes across warehouses.
  • NTC: Manages network configurations for nationwide fiber rollouts.
  • eSewa/Khalti: Version-controls payment gateway updates to prevent fraud.

1. Version Control Systems (VCS): The Backbone of SCM

VCS tracks changes over time to files (code, configs, docs). Two dominant models:

A. Centralized VCS (e.g., Subversion/SVN)

  • Single central repository holds all versions.
  • All users check out from/commit to this server.
  • Pros: Simple, good for small teams.
  • Cons: Single point of failure; offline work is tricky.

B. Distributed VCS (e.g., Git)

  • Every developer has a full copy of the repo (local + remote).
  • Branching/merging is fast and flexible.
  • Pros: Offline work, atomic commits, branching for features.
  • Cons: Steeper learning curve; conflict resolution needed.

Comparison Table

Feature SVN (Centralized) Git (Distributed)
Repository Structure Single central server Local + remote copies
Offline Work ❌ Limited ✅ Full history locally
Branching ❌ Expensive ✅ Lightweight
Conflict Resolution Manual merge Advanced tools (e.g., git rebase)
Used by NTC (network configs) Daraz (order systems), WhatsApp

2. Key SCM Activities

SCM isn’t just about tools—it’s a structured workflow:

A. Configuration Identification

  • Labeling artifacts (e.g., v1.0, release-2024).
  • Example: Ncell tracks SIM firmware versions (Firmware_v2.3.1).

B. Configuration Control

  • Change requests must go through approval (e.g., GitHub PRs).
  • Worked Example: Pathao’s ride-hailing app:
    • Change: Fix a bug in fare calculation.
    • Workflow:
      1. Developer creates a branch (fix-fare-v2).
      2. PR submitted with a Jira ticket (#1234).
      3. QA tests; merge only after approval.

C. Configuration Status Accounting

  • Track who has what version (e.g., dev, staging, prod).
  • Visual: Environment tags in Git:
Developmentdev (Feature Branches)Stagingstaging (Tested Builds)Productionprod (Live, Immutable)
Git environment tags and their roles in SCM workflows

D. Configuration Auditing

  • Verify compliance (e.g., NEPSE’s trading software must meet SEBI rules).
  • Tool: Git’s git log --oneline to trace changes.

3. Version Control Workflows

A. Linear Workflow (Simple)

  • All changes go through main → release → hotfix.
  • Use case: Small teams (e.g., a university project).

B. GitFlow (Feature Branches)

  • Dedicated branches for features, releases, and hotfixes.
  • Example: eSewa’s payment system:
graph TD
    main["main"] --> feature["feature/secure-payment"]
    main --> release["release/v2.1"]
    release --> hotfix["hotfix/urgent-bug"]
    main --> hotfix
    caption["eSewa’s GitFlow for payment system updates"]

C. Forking Workflow (Open Source)

  • Contributors fork the repo, submit PRs (e.g., GitHub’s open-source projects).
11111122Main RepoContributor AContributor BFork AFork BPR APR B
Forking workflow in open-source projects (e.g., GitHub)

4. Handling Conflicts

When two developers modify the same file, conflicts arise. Solutions:

  1. Merge Conflicts: Git’s merge tool highlights conflicts (e.g., two devs editing login.py).
    sequenceDiagram
        participant Dev1
        participant Dev2
        participant Git
        Dev1->>Git: Edit `login.py`
        Dev2->>Git: Edit `login.py` (same line)
        Git-->>Dev1: Conflict! "Merge conflict in login.py"
  2. Rebase: Replays commits on top of another branch (clean history).
  3. Cherry-Pick: Apply specific commits (e.g., fix a bug in v1.2 but not v2.0).

Worked Example: NTC’s network upgrade:

  • Conflict: Two teams edit the same router config (router1.cfg).
  • Solution: Use git merge --no-ff to preserve history.

5. Integration with CI/CD

SCM feeds into Continuous Integration/Deployment (CI/CD):

  1. CI: Automated builds/tests on every commit (e.g., GitHub Actions).
  2. CD: Deploy to staging/production (e.g., Kubernetes rolls out updates).
  • Example: Daraz’s order system:
Code CommitGit → CI PipelineCI PhaseAutomatedTests ↓ Build ArtifactCD PhaseStagingDeployment ↓ Manual Ap
Daraz’s CI/CD pipeline integration with SCM

6. Real-World Tools in Nepal

Tool Used By Key Feature
Git Daraz, Pathao Branching, PRs, CI/CD hooks
GitHub Open-source Nepalese devs Hosting + issue tracking
SVN NTC (legacy systems) Centralized control for configs
Jira eSewa, Khalti Change requests + workflows

In the Real World

  1. Daraz’s Order Tracking:

    • Idea: SCM tracks inventory changes across warehouses.
    • How: Git branches for each warehouse (warehouse-kathmandu, warehouse-pokhara).
    • Impact: Prevents overselling when stock updates conflict.
  2. NTC’s Network Upgrades:

    • Idea: Version control for router configs.
    • How: SVN tracks changes to router1.cfg; rollback if a config causes outages.
    • Worked Example:
      • Issue: A config change breaks internet in Kathmandu.
      • Fix: Revert to router1.cfg@prev using SVN’s update -r HEAD~1.
  3. Pathao’s Ride-Hailing App:

    • Idea: Feature flags for A/B testing.
    • How: Git branches (feature-new-ui) with canary deployments.

Exam Tip

  • Focus on:
    • Definitions: SCM vs. VCS; centralized vs. distributed.
    • Workflows: GitFlow, linear, forking.
    • Conflict resolution: Merge vs. rebase.
    • Real-world ties: Always link to Nepalese apps (eSewa, Daraz) or global tools (GitHub).
  • Common Pitfalls:
    • ❌ Forgetting to tag releases (e.g., v1.0).
    • ❌ Merging without pull requests (bypasses reviews).
    • ❌ Not using branches for features (leads to messy main).
  • Question Patterns:
    • "Explain how GitFlow works with a diagram."
    • "How would you handle a conflict in NTC’s router configs?"
    • "Compare SVN and Git for a team of 5 developers."

Final Checklist for Full Marks

  • Define SCM and VCS with pillars (identification, control, auditing).
  • Draw a GitFlow diagram or branching model.
  • Explain conflict resolution with a sequence diagram.
  • Tie to Nepalese examples (Daraz, NTC, eSewa).
  • Mention CI/CD integration (GitHub Actions, Kubernetes).

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

Discussion

Loading…