CACS203 System Analysis And Design

System Analysis And DesignUnit 57 min read

Software Testing & QA: Types, Phases, Tools & Real-World Impact

Unit 5 of System Analysis and Design covers software testing methodologies (unit, integration, system, acceptance), quality assurance frameworks (ISO/IEC 9126, CMMI), test case design (equivalence partitioning, boundary value analysis), defect tracking, and automation tools—with Nepalese examples like eSewa’s transacti

Core Concepts: Why Testing Matters

What is Software Testing?

Software testing is the process of verifying and validating that a software product meets its requirements and functions as intended. It identifies defects, ensures reliability, and confirms compliance with standards.

stateDiagram-v2
    [*] --> Testing_Starts: Requirement Analysis
    Testing_Starts --> Unit_Test: Code-Level Checks
    Unit_Test --> Integration_Test: Component Interaction
    Integration_Test --> System_Test: Full System Validation
    System_Test --> Acceptance_Test: User Approval
    Acceptance_Test --> [*]: Deployment

Key Definitions:

  • Verification: Are we building the product right? (e.g., code reviews, walkthroughs)
  • Validation: Are we building the right product? (e.g., user acceptance testing)
  • Defect: Any discrepancy between expected and actual behavior.

Types of Software Testing

1. Unit Testing

Tests individual components (functions, methods, classes) in isolation. Example: Testing a single function in eSewa’s payment gateway to ensure it correctly processes a Rs. 500 transaction.

```mermaid

figure: Unit Testing Example ``` Function: calculateDiscount(price, discountRate) Input: (500, 0.10) → Output: 450


Techniques:

  • Equivalence Partitioning: Divide input data into classes (e.g., valid/invalid amounts).
  • Boundary Value Analysis: Test edge cases (e.g., minimum/maximum transaction limits).

2. Integration Testing

Tests interactions between integrated units (e.g., Daraz’s order processing system linking inventory and payment modules).

```mermaid

figure: Integration Testing Layers ``` [User Interface] --> [Order Module] --> [Payment Gateway] --> [Inventory DB]


Types:

Type Description Example (Nepal)
Big Bang All modules tested at once NTC’s new billing system (high risk)
Incremental Modules tested step-by-step Ncell’s app updates (phased rollout)
Top-Down Start from high-level modules Bank loan approval system (manager → clerk)

3. System Testing

Validates the complete system against functional/non-functional requirements. Example: Testing NEPSE’s trading platform under 10,000 concurrent users.

Type Focus Example (Nepal)
Functional Business requirements eSewa’s transaction success rate
Performance Speed, scalability Pathao’s ride-matching latency
Security Vulnerability protection Bank ATM PIN brute-force tests
Usability User experience Khalti’s mobile app navigation

Quality Assurance (QA) vs. Testing

Quality Assurance Software Testing
Prevents defects (proactive) Finds defects (reactive)
Includes reviews, metrics, audits Focuses on execution
Example: ISO 9126 standards for eSewa’s security Example: Manual testing of Daraz’s checkout flow

Real-World Applications in Nepal

1. eSewa’s Transaction Validation

  • Idea Used: Unit Testing + Integration Testing
  • How? Each payment API (e.g., credit card, mobile wallet) is unit-tested. Integration tests ensure the gateway correctly routes Rs. 1,000 from a user’s Khalti account to a merchant.
  • Worked Example:
    # Pseudocode for eSewa’s discount validation
    def validate_discount(user_tier, amount):
        if user_tier == "premium" and amount > 5000:
            return amount * 0.95  # 5% discount
        else:
            return amount
    
    Test Case: Input (premium, 6000) → Expected Output: 5700.

2. Daraz’s Order Fulfillment Queue

  • Idea Used: System Testing (Performance + Load Testing)
  • How? Daraz tests its order processing system with simulated traffic (e.g., 10,000 orders/hour during sales) to ensure no crashes.
  • Visual: [User Order] --> [Load Balancer] --> [Order DB] --> [Warehouse]

3. Ncell’s App Updates

  • Idea Used: Regression Testing
  • How? After fixing a bug in Ncell’s recharge feature, QA runs regression tests to ensure no new issues arise in call-drop functionality.

Test Case Design Techniques

1. Equivalence Partitioning

Divide input data into valid/invalid partitions. Example: For a login system:

  • Valid: Correct username/password.
  • Invalid: Empty fields, wrong password.

2. Boundary Value Analysis

Test minimum, maximum, and just-outside boundaries. Example: For a bank loan interest calculator:

  • Input: Loan amount (Rs. 10,000 to Rs. 10,000,000).
  • Test Cases: 9999, 10000, 10001, 10000001.

Defect Tracking and Metrics

Defect Life Cycle

stateDiagram-v2
    New --> Assigned: QA Team
    Assigned --> Fixed: Developer
    Fixed --> Retest: QA
    Retest --> Reopened: If Defect Persists
    Reopened --> Fixed: Developer
    Fixed --> Closed: Verified

Key Metrics

Metric Formula Example (Nepal)
Defect Density #Defects / Size (LOC) eSewa: 2 defects per 1000 lines
Defect Slip-Through #Defects in Production / Total Defects Ncell: 5% slipped to live app

Automation Tools (Nepal Context)

Tool Use Case Nepalese Example
Selenium UI Testing Daraz’s website compatibility checks
JUnit Unit Testing (Java) NTC’s billing system validation
Postman API Testing eSewa’s payment gateway tests
JIRA Defect Tracking Bank of Kathmandu’s QA team

Common Pitfalls in Testing

  1. Skipping Test Cases: Leads to undetected defects (e.g., NEPSE’s 2021 crash due to untested load).
  2. Over-Reliance on Automation: Manual testing catches usability issues (e.g., Khalti’s OTP flow).
  3. Ignoring Non-Functional Tests: Performance bugs (e.g., Pathao’s app freezing during peak hours).

Exam Tip

  1. Define Clearly: Start answers with precise definitions (e.g., "Software testing is the process of...").
  2. Use Nepalese Examples: Link concepts to eSewa, Daraz, or NTC for full marks.
    • Example Answer Snippet:

      "In Daraz’s order system, integration testing ensures the inventory module correctly updates stock levels when a user checks out, while system testing validates the entire workflow under 5,000 concurrent users during Diwali sales."

  3. Diagrams = Marks: Draw state diagrams for test phases or sequence diagrams for protocol testing (e.g., HTTP request flows).
  4. Compare Tables: For questions on test types, use a 2-column table (e.g., Unit vs. Integration Testing).
  5. Metrics Matter: Memorize defect density and slip-through rate formulas for numerical questions.

Based on the TU BCA syllabus for System Analysis And Design (CACS203), unit 5.

Discussion

Loading…