Subscribe to our Erlang Factory newsletter to receive the latest updates and news

Evan Miller
Creator of Chicago Boss
University of Chicago

After graduating from Williams College with a bachelor's degree in physics, Evan moved to California where he slung a pager for, devised monitoring systems for IMVU, and moonlighted as an Nginx module developer for 2 years. The experiences led him to believe in the importance of reliable systems and the power of non-blocking I/O, and hence, to Erlang.

Evan is currently the maintainer of the ErlyDTL template compiler and is the author of Chicago Boss, a full-stack Erlang web framework. Since 2008 Evan has been pursuing a Ph.D. in economics at the University of Chicago, where he specializes in econometric computational methods. Most recently he released Wizard, a desktop program that makes it easy to perform sophisticated statistical analyses on your Mac.

Evan Miller is Giving the Following Talks
Deep Dish - Chicago-Style Functional Testing

Unit testing is easy, especially in a functional language like Erlang that minimizes side effects. But what about applications where you *want* side effects --  such as delivering information or writing data to disk -- and need to test multi-step workflows effectively? Test code quickly becomes littered with set-up code, teardown routines, and mock objects, and as the application complexity grows, the test suite runs slower, and slower, and slowwwwwer, and…

In this talk, I will introduce an approach to functional testing that makes the developer's life easier by maintaining a *stack of state*. Here's how it works. Say you have a 10-step workflow and want to test two mutually exclusive transactions in step 10 (say, "Complete Checkout" and "Cancel Order"). Instead of executing steps 1-9 twice, you execute them once, but keep around an "undo button" so that after you've tested the first path in step 10, you can retrace your steps and try another path. The result? Cleaner code, faster tests, and happier developers!

After laying out the basic ideas, I'll discuss how to implement this approach with in-memory data (such as gen_server data), file systems, and popular databases. I'll also explain why the approach works particularly well with Erlang code. For reference, I'll show how the Chicago Boss web framework uses these ideas with its one-of-a-kind Deep Dish module, which can -- and should -- be integrated into other projects.

After attending, you'll have everything you'll need to build your very own Chicago-style test framework. But bring some salt, because the talk will be peppered with Erlang!

Talk objectives: The goal of the talk is to educate Erlang developers about the hows and whys of "Chicago-style" testing, and help them see that functional tests of large projects can be fast, simple, and clean.

Target audience: The talk will appeal to anyone who writes or maintains software with complex, multi-step interactions. Whether you're struggling under the weight of a monolithic test suite, or thinking "Tests? Yeah we should probably have a few of those…", you'll come away from the talk with a new perspective on functional testing.