[erlang-questions] Testing a large, heterogeneous system
Wed Jul 31 12:40:36 CEST 2013
On Wed, Jul 31, 2013 at 11:55 AM, David Welton <davidnwelton@REDACTED> wrote:
>> Without knowing the internals of your system it's hard to give specific
>> advice, but if you have a bunch of state-full stuff proper 
>> has some very powerful tools for testing states and reasoning about what
>> should be valid before and after state transitions. Checkout proper_statem
>>  and this  example of a very useful test implementing the
>> proper_statem callbacks.
> Looks interesting - are there any examples? It looks a bit ...
> abstract. With limited time and Erlang abilities, we need to aim for
> stuff that gets the most coverage with the least amount of work.
PropEr (and quickcheck, and all the property based testing) is
certainly not easy, but really, really pays off. Check out the
paper (it's an easy read) and tutorials. I've been working on
putting all I can find projects that use PropEr to a single place for
kind-of CI tests. Still in progress..
For instance, we tested our distributed CRUD system. PropEr interacts
with it (mess with the database, add/remove nodes), and checks whether
our postconditions hold (for instance, you get back what you have
written). We have found numerous cache coherency issues, race
conditions. The fun really started when we started turning on/off the
worker nodes during the test.
Hope that helps.
More information about the erlang-questions