TDD with LiveView: Simpler Than You Imagine! - Gustavo Oliveira - Elixir Meetup #6

Article autor
August 11, 2025
TDD with LiveView: Simpler Than You Imagine! - Gustavo Oliveira - Elixir Meetup #6
Elixir Newsletter
Join Elixir newsletter

Subscribe to receive Elixir news to your inbox every two weeks.

Oops! Something went wrong while submitting the form.
Elixir Newsletter
Expand your skills

Download free e-books, watch expert tech talks, and explore open-source projects. Everything you need to grow as a developer - completely free.

Table of contents

It's insightful session on Test-Driven Development (TDD) with LiveView. Gustavo shared practical techniques for using TDD to build reliable and efficient applications in Elixir, demonstrating how TDD can be simpler than you might imagine.

About Gustavo Oliveira

Gustavo Oliveira is the owner of the YouTube channels ELXPRO BR and ELX PRO, focused on teaching Elixir from basic to advanced levels. He mentors and trains programmers through his ELXPRO program, aiming to develop specialized professionals for the Elixir market.

The Importance of TDD

Why TDD Matters

Gustavo began by highlighting the importance of TDD in maintaining code quality and ensuring reliable applications. TDD helps developers catch errors early, reduce bugs, and create a robust codebase.

Key Benefits:

Setting Up TDD with LiveView

Initial Setup

Gustavo demonstrated the initial setup for TDD with LiveView. He created a new Phoenix application and set up the necessary dependencies for running tests. He emphasized the use of mix phx.new for creating a Phoenix application with LiveView support.

Steps:

Writing Your First Test

Creating Test Files

Gustavo walked through the process of creating test files for LiveView components. He stressed the importance of starting with tests before writing any code, following the TDD approach.

Steps:

Implementing TDD in LiveView

Developing with TDD

Gustavo shared practical examples of implementing TDD in LiveView. He demonstrated how to write tests for various LiveView components, handle events, and update state, all without opening the browser.

Key Techniques:

Advanced TDD Techniques

Using Test Watchers

Gustavo introduced the use of test watchers to automate test execution. He explained how tools like mix test.watch can monitor file changes and automatically run tests, improving efficiency.

Benefits:

Real-World Applications

Building a Counter with TDD

Gustavo provided a real-world example by building a simple counter application using TDD. He showed how to define tests for the counter's increment and decrement functionality, ensuring the application behaves as expected.

Example Highlights:

Benefits of TDD with LiveView

Enhanced Development Workflow

Gustavo emphasized the benefits of using TDD with LiveView, including a more structured development workflow, improved code quality, and faster development cycles.

Key Benefits:

Conclusion

Gustavo Oliveira's presentation at Elixir Meetup #6 provided valuable insights into using TDD with LiveView. By following the TDD approach, developers can build reliable and efficient applications in Elixir, ensuring high code quality and robust functionality.

Join the Community

projects with TDD?
Register for the next

Join our community of

Prefer watching the presentation?

Related posts

Dive deeper into this topic with these related posts

No items found.

You might also like

Discover more content from this category

A framework for unified authorization in Elixir - Michał Buszkiewicz - Elixir Meetup #5

Learn about the limitations of existing authorization libraries and presented a more flexible and comprehensive solution designed to integrate seamlessly with Plug, LiveView, and other frameworks.

Enhancing LiveView Development with Periscope - Caleb Beers - Elixir Meetup #12

In Elixir Meetup #12, Caleb Beers introduces Periscope, a powerful open-source tool designed to enhance debugging and introspection in Phoenix LiveView apps. It's essential for developers looking to improve their workflow and efficiency.

A Walk-Through of a Full Nerves Application - Rob Raisch - Elixir Meetup #3

Explore the session on developing IoT apps using Nerves and Elixir. He walked the audience through a full Nerves application, showcasing its capabilities and providing insights into building robust, fault-tolerant, and maintainable embedded systems.