Home / Blog / App Development

    Testing Strategy for Web and Mobile Apps: Unit, Integration and End-to-End

    By Softworth Solutions · · 4 min read · For readers in UK, US, India

    Source code on a laptop screen while a developer works

    In short: A sound testing strategy uses many fast unit tests for logic, a solid layer of integration tests against real databases and APIs, and a small set of end-to-end tests for the journeys that matter most. Test each behaviour at the lowest level that can catch the bug, and keep the suite reliable enough that every failure means something.

    Most teams do not lack tests so much as the right tests. Either everything is a slow, flaky UI script, or the unit tests pass happily while the app breaks in production. Here is how we think about getting the balance right.

    What is the difference between unit, integration and end-to-end tests?

    They differ in scope and cost. Unit tests check one function or component in isolation and run in milliseconds. Integration tests check that pieces work together, such as an API endpoint with its database. End-to-end tests drive the whole app like a user would, through a real browser or device.

    The three layers compared
    LayerSpeedCatchesHow many
    UnitMillisecondsLogic and edge-case bugsMany
    IntegrationSecondsWiring, query and contract bugsA solid layer
    End-to-endSeconds to minutesBroken user journeysFive to fifteen key flows

    Whether you prefer the classic test pyramid or the testing trophy, which puts more weight on integration tests, both agree on one thing: never build your strategy mainly on end-to-end tests.

    How do you decide what to test where?

    Start with what would really hurt if it broke: payments, login, data loss and the core workflow customers pay for. Pricing rules, tax and validation logic belong in unit tests, where edge cases are cheap. Queries, permissions and API contracts belong in integration tests against real or containerised dependencies. Only the critical journeys need end-to-end coverage.

    Test behaviour, not implementation details. Tests that check which internal method was called break on every refactor without catching real bugs.

    An illustrative example

    Consider a London fintech start-up whose React web app and Flutter mobile app share one API. Its release checklist was a two-day manual test, and bugs still slipped through. The team adds unit tests for fee calculations, Testcontainers-based integration tests for the API, and eight Playwright and Flutter integration tests for sign-up, payments and statements. Releases move from fortnightly to weekly, and the manual effort shifts to exploratory testing of new features.

    Which tools work well for web and mobile?

    For web front ends, Vitest or Jest with Testing Library cover units and components, and Mock Service Worker handles network mocking. On the back end, use your language's standard framework with Testcontainers for real databases. For end-to-end, Playwright and Cypress lead, ideally with test IDs or accessible roles as selectors.

    Mobile adds device fragmentation, OS versions and store review delays. Use XCTest, JUnit or Flutter's test package for units, Compose or widget tests for screens, and Espresso, XCUITest, Maestro, Detox or Appium on devices. Test offline and patchy networks too, which are common for users across India. Our post on Flutter for enterprise apps covers its testing tools.

    Source code on a laptop screen while a developer works

    How should tests run in CI/CD?

    1. On every push: linting, type checks and unit tests, finishing in a few minutes.
    2. On every pull request: integration tests.
    3. Before merge or release: end-to-end tests against a staging or preview environment.
    4. For mobile release candidates: the full device matrix, often on a cloud device farm.

    Fail the build on any failure and keep traces, screenshots or videos from failed runs. Fix or quarantine flaky tests immediately, because a suite nobody trusts is worse than a smaller one they do. Our CI/CD setup for small teams shows the pipeline in practice.

    What about accessibility, cost and market differences?

    Add automated accessibility checks to your component and end-to-end tests. UK public-sector bodies must meet accessibility regulations, US organisations face ADA-related claims, and India's Rights of Persons with Disabilities Act sets expectations too, with WCAG as the usual benchmark everywhere.

    Expect automated testing to add roughly 20 to 40 percent to initial build effort, repaid through fewer regressions and faster releases. For an untested app, start with end-to-end tests on critical journeys as a safety net, then add lower-level tests as you touch each area.

    Key facts

    • Playwright supports testing across Chromium, WebKit and Firefox from a single API. (Playwright)
    • WCAG 2.2 became a W3C Recommendation in October 2023. (W3C Web Accessibility Initiative)
    • Testcontainers provides lightweight, throwaway instances of databases and other services in Docker containers for tests. (Testcontainers)

    Key takeaways

    • Test each behaviour at the lowest level that can catch the bug.
    • Keep end-to-end tests for a handful of critical journeys.
    • Run fast tests on every push and broader ones before release.
    • Treat flaky tests as bugs and include accessibility checks.

    SWS AI builds web, mobile and Teams apps with automated testing from the first sprint, and can help audit the test suite on an existing product.

    Frequently asked questions

    What code coverage should we aim for?

    There is no universal number. Many teams find 70 to 80 percent coverage of business logic healthy, with critical modules higher. What matters more is that the riskiest paths are tested meaningfully.

    Do we still need manual testing if we automate?

    Yes, but less and of a different kind. Exploratory testing finds usability issues and surprises that scripts miss. Automation removes repetitive regression checks so people can focus there.

    Do UK apps need accessibility testing?

    UK public-sector websites and apps must meet accessibility regulations, and private companies have duties under the Equality Act. Automated checks catch many issues, but manual testing with assistive technology is still needed.

    How do we test AI features in an app?

    Unit test the deterministic parts such as prompt assembly and parsing, and mock the model in integration tests. Evaluate AI behaviour separately with a curated evaluation set and scoring, since outputs vary.


    Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.

    Previous: AI Vendor Due Diligence: Security, Data and IP Questions to Ask
    Next: Kubernetes in Production: Lessons on Cost and Reliability

    Keep reading