开发者

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

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Improve this question

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'开发者_如何学Pythonm 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.


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.


Well, there is a way which is very simple and does not require to learn any new framework. You can test the logs produced by the applications across your distributed environment using grep4j. Have a look here and here for more info.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜