Nairametrics Platform Evolution - Roadmap Proposal

Testing Strategy and Quality Assurance

This document defines the testing approach, tools, coverage targets, environments, and checklists for each phase.

Test Pyramid

           ┌─────────────┐
          │   E2E Tests  │ (10% - Critical user flows)
         └──────────────┘
        ┌──────────────────┐
       │ Integration Tests │ (30% - API contracts, DB queries)
      └────────────────────┘
    ┌───────────────────────────┐
   │      Unit Tests           │ (60% - Business logic, helpers)
  └─────────────────────────────┘

Coverage Targets

Layer Target Tools
Unit 80% PHPUnit (Laravel), Jest (Next.js), Dart test (Expo/React Native: jest/react-native-testing-library)
Integration 70% PHPUnit + DB, Playwright/Cypress (web), React Testing Library
E2E Critical paths Playwright/Cypress for web; Detox (mobile)

Environments

  • Local development
  • CI (on every PR)
  • Staging (prod-like)
  • Production monitoring (synthetic checks)

Phase A: WordPress Theme

What to test

  • Templates render correctly with real content
  • Navigation and search work across devices
  • Performance budgets (PSI 90+ mobile)
  • Accessibility (WCAG 2.1 AA)

Tools

  • Lighthouse CI, Axe (accessibility), Browserstack (cross-browser)

Checklist

  • Homepage, article, category, search, 404, author pages
  • Mobile nav, header/footer interactions
  • Image lazy-loading and responsive sizes
  • SEO meta, OG, Twitter cards

Phase B: Laravel API + Next.js + Expo

Laravel API

  • Unit: Services (WordPress API adapter, analytics, recommendations)
  • Feature: Controllers, auth, rate limits
  • Contract: OpenAPI spec validation

Next.js Web

  • Unit: Components, hooks
  • Integration: SSR/SSG pages, API client
  • E2E: Core flows (browse → article → search → share → bookmark)

Expo Mobile

  • Unit: UI components, hooks
  • Integration: Navigation flows
  • E2E: Detox core flows (auth, browse, read, bookmark, notifications)

Performance

  • API p95 < 200ms under expected load (k6/Artillery)
  • Web LCP < 2s on 4G/slow CPU profile
  • Mobile TTI < 3s cold start

Phase C: Full Laravel Platform

  • Admin flows (Filament): CRUD, roles/permissions, media
  • Migration validation: 100% content parity, URL redirects
  • SEO preservation tests (crawl, sitemaps)
  • Load & failover tests

Performance Baseline Script

A lightweight script is provided to capture curl-based metrics (TTFB, total time) and optionally Lighthouse if available.

Usage examples:

BASE_URL=http://localhost:8000 URLS="/ /wp" ./scripts/perf_baseline.sh
OUT_DIR=./reports/performance/myrun ./scripts/perf_baseline.sh

Outputs to ./reports/performance//

See also: Phase A performance targets.


CI/CD Integration

  • Lint → Unit tests → Integration tests → Build → Deploy to staging → E2E → Manual approval → Prod
  • Block merges on failing tests and coverage drops