u/IndividualSituation8

Correct way to test async code?

Lets say I have async code or some sort of timer or scheduler that calls a lambda later on some event, how do i test this in simple way in existing frameworks?

Is using futures or other sync mechanism the only way? or a simpler runloop/eventloop style facilities exist in test frameworks to simplify things?

For now looks like the test itself has to take on more theeading/orchestration/synchronization responsibilities.

For event driven and interactive apps, async execution would be common.

reddit.com
u/IndividualSituation8 — 4 days ago

Hey all, looking for advice on learning to structure codebase to be testable, typical nuances on interface design, dependency injection, async testing, fuzzing, property based testing, other details like approaches to complex mocking, fixtures, separating side effects and creating effect systems/DSL , designing code in FCIS style, and a lot more about designing for testability?

Willing to pay up for a really good book or course.

reddit.com
u/IndividualSituation8 — 6 months ago