There are many sources of nondeterminism in code such as randomness, IO, environment variables, databases and many more. Nondeterminism is a source of confusion, and it makes testing difficult. One way to control nondeterminism is using the dependency injection pattern. In this talk I'll guide you through a series of problems that demonstrate how nondeterminism can pose incredible challenges even in simple code. Tackling one problem after another, we'll gradually integrate dependency injection into the code to address these challenges! After attending this talk you will hopefully understand: - The challenges nondeterminism poses - How to identify nondeterminism in code - What dependency injection is, and how it addresses challenge related to nondeterminism - How to implement and integrate dependency injection into Python code |