Mobile Application DevelopmentUnit 49 min read
Testing & Publishing Mobile Apps: Tools, Strategies & App Stores
Unit 4 of Mobile Application Development covers testing methodologies (manual, automated, UI, performance, security), publishing workflows (Google Play, Apple App Store), app store optimization (ASO), and post-release analytics—essential for ensuring bug-free, user-friendly, and commercially successful mobile apps.
Key Concepts and Workflow
1. Types of Mobile App Testing
Mobile apps require rigorous testing to ensure functionality, usability, and security. The main categories are:
A. Functional Testing
Verifies that the app works as intended. Subtypes:
- Unit Testing: Tests individual components (e.g., a login button).
- Integration Testing: Checks interactions between modules (e.g., payment gateway + cart).
- System Testing: Validates the entire app against requirements.
B. Non-Functional Testing
Ensures performance, usability, and reliability:
- Performance Testing: Measures speed, scalability, and battery usage.
- Usability Testing: Evaluates UI/UX (e.g., Pathao’s ride-hailing flow).
- Security Testing: Identifies vulnerabilities (e.g., eSewa’s payment data protection).
- Compatibility Testing: Ensures cross-platform/device support (e.g., WhatsApp on Android/iOS).
C. Specialized Testing
- Localization Testing: Checks language, date formats, and cultural nuances (e.g., Daraz’s Nepali UI).
- Automated Testing: Uses tools like Espresso (Android) or XCTest (iOS) to repeat tests efficiently.
2. Testing Tools
| Category | Tools | Use Case |
|---|---|---|
| Automated UI | Espresso, XCTest, Appium | Regression testing |
| Performance | Android Profiler, Xcode Instruments | Battery drain, lag analysis |
| Security | MobSF, Burp Suite | Vulnerability scanning |
| Manual | TestFlight (iOS), Firebase Test Lab | Ad-hoc user feedback |
flowchart TD
A["Espresso"] -->|"Android"| B["Automated UI"]
C["XCTest"] -->|"iOS"| B
D["MobSF"] -->|"Security"| E["Vulnerability Scan"]
F["Firebase Test Lab"] -->|"Cross-Device"| G["Manual/Automated"]
B --> H["Regression Testing"]
E --> H
G --> HTool Classification for Mobile App TestingExample: Testing a Kathmandu traffic app
- Unit Test: Verify the route-calculation algorithm with mock GPS data.
- Performance Test: Simulate 10,000 concurrent users to check server load.
- Security Test: Scan for unencrypted API calls (e.g., Ncell’s SIM verification).
3. Publishing Workflow
A. Pre-Publishing Checklist
- App Store Requirements:
- Google Play: APK/AAB, screenshots, privacy policy, target SDK.
- Apple App Store: App Store Connect account, notarization (for macOS apps).
- Metadata Optimization (ASO):
- Title: Short, keyword-rich (e.g., "Khalti: Digital Wallet for Nepal").
- Description: Highlight features (e.g., "Instant transfers, no fees").
- Keywords: Use tools like App Annie or Sensor Tower.
- Visuals: High-res screenshots, demo video (e.g., YouTube’s app preview).
B. Submission Process
- Google Play:
- Upload APK/AAB → Set pricing → Select countries → Publish.
- Rejection Reasons: Policy violations (e.g., fake reviews), missing metadata.
- Apple App Store:
- Archive via Xcode → Upload to App Store Connect → Wait for review (1–3 days).
- Rejection Reasons: GUI issues, incomplete privacy policy.
4. Post-Publishing: Analytics and Updates
- Google Analytics for Firebase: Track user retention, crashes, and sessions.
- App Store Connect (Apple): Monitor downloads, ratings, and reviews.
- Update Cycle:
- Fix bugs (e.g., NEPSE’s app crashes during trading hours).
- Add features (e.g., Daraz’s "Buy Now, Pay Later").
In the Real World
Khalti (Digital Payments)
- Security Testing: Uses OWASP Mobile Top 10 to audit for SQL injection or session hijacking.
- Performance Testing: Simulates peak load (e.g., Dashain sales) to prevent server crashes.
Pathao (Ride-Hailing)
- Automated Testing: Espresso tests validate driver-passenger matching logic.
- Localization: Supports Nepali, Hindi, and English with region-specific fare rules.
NTC’s Mobile App (Internet Services)
- Compatibility Testing: Ensures the app works on low-end phones (e.g., Xiaomi Redmi) and high-end devices.
- ASO: Uses keywords like "NTC broadband check" to rank higher in searches.
Visualizing Key Ideas
1. Mobile App Testing Pyramid
pie
title Mobile App Testing Distribution
"Unit Tests" : 60
"Integration Tests" : 25
"UI/End-to-End Tests" : 15Why? Unit tests catch 80% of bugs early; UI tests validate user flows.
2. Publishing Workflow (Google Play)
flowchart TD
A["1. Prepare APK/AAB"] --> B["2. Set Metadata (Title, Desc, Icons)"]
B --> C["3. Upload to Google Play Console"]
C --> D["4. Select Countries & Pricing"]
D --> E["5. Review & Publish"]
E --> F["6. Monitor Analytics"]Example: Publishing a Ncell Recharge App:
- Step 3: Upload APK with signed certificate.
- Step 4: Price at NPR 0 (freemium model).
3. State After Each Step: Security Scan (MobSF)
Trace: MobSF flags SharedPreferences storing credit card data → Fixed with Android Keystore.
Worked Example: Testing a Bank Loan App
Scenario: A Nepalese bank’s mobile app calculates EMI (Equated Monthly Installment). Test the EMI calculator for:
- Unit Test: Input = ₹5,00,000, Rate = 8%, Term = 5 years → Expected EMI = ₹10,802.
- Edge Case: Term = 0 → App should show "Invalid input."
- Performance: Simulate 5000 users calculating EMI simultaneously.
Code (Java/Kotlin):
// EMI Calculator Unit Test (JUnit)
@Test
fun testCalculateEMI() {
val loan = Loan(principal = 500000, rate = 8.0, term = 5)
val expectedEMI = 10802.0
assertEquals(expectedEMI, loan.calculateEMI(), 0.01)
}
Trace:
| Step | Input (₹) | Rate (%) | Term (yrs) | Output (EMI) | Status |
|---|---|---|---|---|---|
| 1 | 500,000 | 8.0 | 5 | 10,802.00 | Pass |
| 2 | 0 | 8.0 | 5 | Error | Pass (Edge) |
| 3 | 500,000 | 8.0 | 0 | "Invalid" | Pass |
Comparison: Manual vs. Automated Testing
| Criteria | Manual Testing | Automated Testing |
|---|---|---|
| Speed | Slow (human-dependent) | Fast (runs 1000 tests in minutes) |
| Cost | High (labor-intensive) | Low (one-time script cost) |
| Accuracy | Prone to human error | Consistent, repeatable |
| Use Case | UI exploration, ad-hoc feedback | Regression, load testing |
| Tools | None (or screen recording) | Espresso, Appium, XCTest |
Common Pitfalls and Fixes
- Issue: App crashes on low-end devices (e.g., Xiaomi Redmi). Fix: Use Android Profiler to optimize memory usage.
- Issue: Low App Store rating. Fix: Improve ASO (e.g., add a demo video for NTC’s app).
- Issue: Security vulnerabilities. Fix: Run MobSF before submission (e.g., Khalti’s PCI compliance).
Exam Tip
- For TU/PU Exams:
- Define: Differentiate between functional and non-functional testing.
- Diagram: Draw the testing pyramid or publishing workflow.
- Scenario-Based: Given a case (e.g., "Design tests for a Daraz seller app"), list:
- Unit tests for order processing.
- Performance test for 10,000 concurrent sellers.
- Security test for payment data.
- Tools: Name Espresso (Android) and XCTest (iOS) for automated UI testing.
- For NEB Exams:
- Focus on ASO techniques (keywords, screenshots) and post-publishing analytics.
- Compare Google Play vs. Apple App Store submission steps.
Key Formula: EMI = Where:
- = Principal (loan amount)
- = Monthly interest rate ()
- = Loan term in months
Based on the TU BSc CSIT syllabus for Mobile Application Development, unit 4.
Discussion
Loading…