Taming Nondeterminism with Dependency Injection

Take back control of your code!

Haki Benita

Development Programming Software Design Testing

See in schedule: Wed, Jul 28, 10:00-10:30 CEST (30 min)

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

Type: Talk (30 mins); Python level: Intermediate; Domain level: Intermediate


Haki Benita

Haki Benita

Haki is a software developer and a technical lead. He takes special interest in databases, web development, software design and performance tuning. Haki also writes about development and performance in his blog hakibenita.com.