This diagrams below shows a summary of the application architecture. The rest of this document goes into more details to describe these modules
Prototyping
We include prototype code as part of the Scenarios module and make them available in the Scenarios app, with confidence that they will not affect the Production app.
We produce two separate apps from this codebase.
The “Production” app is the app that is uploaded to App Store, and is always only configured for production. For example, there are no testing features, insecure logging, or internal assets.
The “Scenarios” app is used internally by developers and other members of the team. It provides additional features that are useful for testing, such as mock and non-production environments.
Scenarios also offer a way for the development team as well as the stakeholders a way to easily go through design and various flows.
Sidenote
Currently there is one violation of the separation of the modules. Specifically, Domain
module has a dependency on Localisation
.
We consider this an acceptable as it does not stop us from providing the level of testing we need. However, we aim to fix this and return to the target architecture when possible.
Contains common code available to all other packages.
- Logic is unit tested (
CommonTests
)
A small package focuses on localisation.
- App tests ensure all necessary localised assets (such as texts) are specified (
AppTests
)
The app “frontend” logic. It depends on Localization
package. It should be possible to “use” all of the UI with mocks.
- State management, such as in presenters, are unit tested (
InterfaceTests
) - Layout of individual screens / components are snapshot tested (TODO)
- Interactions, localisation, and accessibility are tested with UI tests (
UITests
). These are further divided into these categories. - Screen tests ensure internal interactions in a single screen are correct (for example, that a form validation errors are displayed).
- Flow tests ensure a group of screens work together as expected (for example, that a popover screen is shown at the right time).
- Journey tests ensure a complete user journey works (for example, that the user can go through onboarding).
Choosing the correct strategy for a given feature is often a judgement call. As a general rule, try to use earlier strategies in this list where possible to speedup testing.
The app “backend” logic. This includes IO (networking, storage, etc.) as well as business logic (non-UI state management).
- Majority of the code is unit tested (
DomainTests
). - Where testing an individual unit is is not possible, the subsystem will be tested with integration tests internal to the module (
DomainTests
).
This package contains the “glue” that connects the app’s UI to its core logic.
- Where possible, the code is unit tested (
IntegrationTests
). - Where testing an individual unit is not possible, the subsystem will be tested with integration tests internal to the module (
IntegrationTests
). - Where integration affects UI, this is tested via “Journey” tests (
UITests
).
This module contains code to set up internal app, with additional functionality to help development and the rest of the team.
This is also used heavily to drive the UI tests.