Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Framework or tool for "distributed unit testing"? [closed]

Is there any tool or framework able to make it easier to test distributed software written in Java? My system under test is a peer-to-peer software, and I'd like to perform testing using something like PNUnit, but with Java instead of .Net.

The system under test is a framework I'm developing to build P2P applications. It uses JXTA as a lower subsystem, trying to hide some complexities of it. It's currently an academic project, so I'm pursuing simplicity at this moment.

In my test, I want to demonstrate that a peer (running in its own process, possibly with multiple threads) can discover another one (running in another process or even another machine) and that they can exchange a few messages. I'm not using mocks nor stubs because I need to see both sides working simultaneously. I realize that some kind of coordination mechanism is needed, and PNUnit seems to be able to do that.

I've bumped into some initiatives like Pisces, which "aims to provide a distributed testing environment that extends JUnit, giving the developer/tester an ability to run remote JUnits and create complex test suites that are composed of several remote JUnit tests running in parallel or serially", but this project and a few others I have found seem to be long dead.

like image 511
msugar Avatar asked Apr 20 '10 04:04

msugar


People also ask

Which framework is used for unit testing?

JUnit is an open source framework you can use to write and run tests. It aims to help develop bug-free and reliable code written in Java. JUnit provides test runners that run tests and assertions to test the expected results.

Is unit testing a framework?

What are unit test frameworks and how are they used? Simply stated, they are software tools to support writing and running unit tests, including a foundation on which to build tests and the functionality to execute the tests and report their results.

Is TestNG a unit testing framework?

Features of TestNGIt's an open-source testing framework. It uses more Java features. It supports multiple Before and After test annotations. It supports XML-based test configurations.


1 Answers

Testing distributed software depends greatly on what type of software it is, so for a complete answer I will need to know what your software does. However looking at PNUnit it seams that most of what it does is allow for synchronization, ordering and parallel execution of tests. TestNG also supports this, for instance, you can do:

@Test(threadPoolSize = 3, invocationCount = 10,  timeOut = 10000)
public void testServer() {
   :
}

which will invoke the function testServer ten times from three different threads. The change-log of TestNG 4.5 also hints at the possibility of running remote tests, more info is available in this blog post.

Alternatively you can checkout IBM's ConTest software for testing parallel and distributed software (there is a great description of how to use it here). I have had great success using it to expose bugs in my concurrent applications.

like image 107
Lars Tackmann Avatar answered Sep 18 '22 05:09

Lars Tackmann