Mix for Elixirs
Mix is Elixir's build tool and project manager. It creates projects with mix new, compiles code, fetches dependencies declared in mix.exs from Hex, and runs tasks. Testing uses ExUnit, which Mix runs with mix test, giving every Elixir project the same layout and workflow.
Stage: Tooling and Data · Part of the Elixir roadmap · Last reviewed 19 November 2026
What to learn in Mix
- Create a project with mix new and read the generated mix.exs
- Add a dependency from Hex and fetch it with mix deps.get
- Write ExUnit tests with assert and setup blocks, and run them with mix test
- Use doctests to keep documentation examples correct
- Write a custom Mix task and configure behaviour per environment
Mix interview questions
What is the role of mix.exs?
It is the project definition file, written in Elixir. It declares the project name, version, Elixir requirement, dependencies and the application callback module, so Mix knows how to compile, test and start the project.
How do doctests work?
Examples written in a module's documentation with the iex> prompt can be run as tests by adding doctest ModuleName to an ExUnit test file. Mix then checks that each expression returns the documented value, keeping docs honest.
Where Mix fits in the Elixir roadmap
Mix belongs to the Tooling and Data stage (intermediate level). Real projects.
Other units in this stage
Back to the full Elixir roadmap