Systems | Development | Analytics | API | Testing

Elixir

An Introduction to Mocking Tools for Elixir

A well-written test suite is a big part of any successful application. But let's say you rely on an external dependency for some parts of your app (for example, an external API for fetching user information). It then becomes important to mock that dependency in the test suite to prevent external API calls during testing or to test specific behavior. Several frameworks help reduce the boilerplate and make mocking safe for Elixir tests.

An Introduction to Test Factories and Fixtures for Elixir

Writing tests is an essential part of any Elixir developer's routine. We're constantly chasing knowledge on how to write better tests, improving their speed and readability. In this three-part series, we'll explore test data generation in Elixir. Whether you are a mid-level or senior-level Elixir developer, this series will provide valuable insights to help improve the testing process for your projects.

How To Instrument Your Elixir Application with AppSignal

Instrumentation is an essential part of monitoring and operating an application, especially for apps heavily used in production. Even in today's everchanging technology landscape, visibility and observability still challenge developers and system administrators. Metrics and logging are essential for monitoring and operating an application. Metrics measure an application's performance and system health, while logging records system health and application state.

Debugging and Tracing in Erlang

In part one of this series, the debugging tools we used — Elixir's IO.inspect/2, IEx.pry, and dbg/2 — required us to insert changes into code directly. Outside the development environment, you probably won't (and shouldn't) have access to your code. Erlang has a few tools to debug code at runtime: :debugger, :dbg.tracer, and :observer. First, let's look at the:debugger, a graphical debugging tool. Let's get going!

How to Cache Locally in Elixir with Nebulex

In an Elixir application, you might need to access certain data frequently, which can be costly. The access time involved in retrieving data at every step can cause high latency, or even make the application crash (due to an increased workload on the database). Caching is the best technique to store the most frequently accessed data and minimize database data retrieval, improving the overall performance of the application.

Debugging in Elixir and Erlang: An Introduction

Welcome to part one of this two-part series on debugging in Elixir and Erlang. In this post, we'll use several different tools and techniques to debug Elixir code. First, we'll get to know the demo project I created to showcase certain tools: dist_messenger. It's an Elixir project of a distributed messaging system that can be used directly on IEx. It allows users in different nodes to send and receive messages to each other.

Parser Combinators in Elixir: A Deeper Dive

In our last post, we wrote a basic parser for phone numbers using Elixir. It was a bit simplistic since it didn't really respect the format phone numbers are expected to have, but it was a great start. We'll now improve the parser to ensure we only accept phone numbers that fit the spec and make our return type an instance of structured data. Let's dive straight in!