There are many sources of nondeterminism in code such randomness, IO, environment variables, databases and many more. One way to control nondeterminism in tests, is using dependency injection.Dependency injection is a pattern that provides a good way to control nondeterminism in code, and makes it easier to write tests.In this talk I'll demonstrate how nondeterminism can pose incredible challenges even in simple functions, and how to implement dependency injection to address these problems!