MacroMath
Architecture

Testing and validation

Unit test coverage and functional validation of the critical flows.

The app's stability was assessed with two complementary methodologies: manual functional testing of the critical flows and an automated unit-test suite in the flutter_test framework, which shields the algorithmic logic against regressions.

Unit test suite

TargetWhat it validates
FoodItemModelNutritional proportion when weights change, JSON serialization and structural equality.
MealModel / MealEntryAggregation and cumulative sum of macros per meal.
PortugueseFoodsDatabaseEfficiency of lexical-relevance search in the national catalog.

Result

Running flutter test resulted in the full suite passing:

  • 17/17tests passing

This gives a high degree of reliability to the mathematical calculation mechanisms — in particular the macro calculation and the AI normalization pipeline.

Non-functional requirements

The non-functional requirements recorded full compliance:

RequirementHow it was ensured
Load times < 3 sInstant read from the local cache (Hive).
Performance at high volumeRelational indexing in PostgreSQL.
Data protectionTLS 1.3, AES-256 and RLS.
Contained install sizeCompressed package within Flutter standards.
Scalable architectureLayered pattern (presentation/data/core).

Future work

Plans are in place to extend coverage with end-to-end (E2E) integration tests and widget tests, complementing the current unit suite.

On this page