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

Joseph DeVivo
Engineer at Basho, Writing Code That Tests Riak
Basho Technologies

Speaker
Joe has been a professional software engineer for over 10 years. Most of that was writing server side Java, but he's dabbled in all sorts of things from front end javascript to SQL query optimization. He's been toying with Erlang for years and even used it professionally a few years back. Joe has been developing mainly in Erlang for over a year since starting at Basho, and have worked in both Professional Services and Engineering roles in that time.

Joseph DeVivo is Giving the Following Talks
Beating the No-Win Scenario: Testing a Distributed System

Testing distributed systems is hard. Testing is hard, but we've been given tools like EUnit and common_test to make it easier. Where is this toolkit for distributed systems? I'm not going to claim that I have all the answers or even that I have a framework you can use to solve your problem. What I do have is an idea and a solution to MY problem, which is ""How do we test Riak?"

Come with me on an adventure of design decisions, tradeoffs and deep dark corners of Erlang. We'll go from group leaders to lager and port commands to cookies. By journey's end you'll have an understand of how we're able to test riak, how you may be able to build off what we've done to test your distributed system, and hopefully ideas on how we might, together, make riak_test generic enough to be that distributed testing tool we've been looking for.

Talk objectives:

Riak_test is not a conventional Erlang application. It doesn't use supervisors and is at its core, an escript. This talk hopes to bring attention to features of Erlang and how they can be used to test an Erlang application. This talk hopes to explore corner cases of Erlang features, that are most likely not being used as intended to test an erlang application. Some of the more interesting things I'll show off are:

* How we simulate a network partition
* How we are able to test console interaction
* Using group_leader to capture all kinds of output
* Using a custom lager backend for keeping logs in memory
* Using module attributes to check for test prerequisites

I also hope to drum up more interest in riak_test from outside of Basho, in an effort to make it a more generic framework for testing distributed systems.

Target audience: I think even people with a lot of Erlang experience will be able to get something out of this talk, even if that is just a new perspective on old material. New users will get to see some of these features explored, giving them something else to think about besides list comprehensions, gen_servers and supervision trees. Developers new and old alike will be exposed to the issues faced in testing a distributed system, and will hopefully consider those in the future as they write code that will, one day, need testing.