Skip to content

What to mock and what to fake #284

@ivmarkov

Description

@ivmarkov

rs-matter does contain code that depends on OS services which might be difficult to bring up for unit / integration testing.

Some examples, where rs-matter already does have either mocks, or fakes:

  • UDP; The e2e (= end-to-end) framework fakes UDP with a zerocopy channel and enables unit-tests-as-integration-tests where two instances of rs-matter can talk to each other over the faked UDP for testing purposes
  • BTP; The BTP protocol is using a manually-crafted GattPeripheral mock for testing

Places we might or might not need to fill-in with tests:

mDNS

  • The built-in mDNS responder. I would say, rather unit tests here, for the mDNS packet parsing and assembly logic
  • External mDNS providers (zeroconf, avahi-over-zbus, resolved-over-zbus). Questionable. The logic to be tested with mocks is maybe a bit too simple?

BT/BlueZ over zbus

  • ? ~ 1000LOCs, relatively non-trivial but then most of the logic is around the complicated "register your own objects in dBus" that BlueZ wants from us

Wifi/WPA Supplicant over zbus

  • ? ~ 500 LOCs

Wifi/Network Manager over zbus

  • ? ~ 500 LOCs

===

Utility/system clusters and the overall logic of farics, ACLs etc., which is not covered with unit tests or the e2e tests:

CC @gmarcosb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions