How to write Elixir code in a way that makes it easy to refactor, without emulating a type system with unit tests?

Not if you have underspecs on :+1: I’ve just put up a gist with a few pratical errors dialyzer can spot for you dialyzer_example.ex · GitHub

Dialyzer & Elixir experience is getting better over time (specially thanks to dialyxir), but there is still a lot of room for improvement for sure.