Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing with probabilistic failure of components in Akka (Scala)

I've started using Akka with Scala to develop a set of interacting components in a bus-oriented architecture. I need to test the fault-tolerance of the system, and for that I was wondering if there is any way to use a probabilistic model of failure (i.e., set some failure parameters for each Actor) within a Scala test framework. Any ideas? Any framework out there that already implements this?

like image 729
Hugo Sereno Ferreira Avatar asked Dec 10 '11 20:12

Hugo Sereno Ferreira


1 Answers

I assume you know thinks like Testkit and read the documentation at http://akka.io/docs/akka/1.3/scala/testing.html#akka-testkit (see also http://roestenburg.agilesquad.com/2011/02/unit-testing-akka-actors-with-testkit_12.html )

You don't need Akka in the test setup, if I understood your problem right. Assume that Akka itself is tested and works OK. Now you only have to test your code. Since you didn't show code it's hard to give advice, but I will try:

you can test your method calls in different sequences, and assert the results. I would hardcode the sequences, but you can also randomize that.

show some code and I will clarify what I mean. I also could be wrong, if I understood your question wrong.

like image 91
Jörg Beyer Avatar answered Nov 15 '22 18:11

Jörg Beyer