[bisq-network/proposals] [WIP] Finding a unified test framework for Bisq (#74)
notifications at github.com
Sun Feb 17 07:01:23 UTC 2019
TestNg is a bit (tiny bit) more powerful than junit, but is less known, so I would stick with junit to keep barrier for new Devs low.
I do not like parameterized tests. The name of the test should tell what scenario it tests.
Unit tests must be dead simple, this short, of they're not, they will not be maintainable and will lose documentation valor.
When parameterized test fails you don't know what the scenario was by looking at test report. You have to inspect the code, which is a pain when tests fail on ci.
As to mocking frameworks, I've used mockito a lot and it has everything needed.
It does not support mocking of static methods, but if you need to mock such methods than your design is wrong IMHO.
We should also consider Arquillian as an integration testing framework. It comes with a lot of plugins, but the most useful for us is the Cube, which allows to spin up docker containers and run tests against them.
I'm using this heavily in the API development and it allows me to run the whole trade flow on regtest with Alice, Bob and arbitrator bisque nodes in separate containers, as well as seednode and bitcoind node.
I bet we could write tests that would work on testnet or even mainnet (that would of course cost is money in terms of transaction and trade fees).
IMHO Arquillian is future for Bisq testing effort, once we get the API running.
Right now for me the biggest problem with unit testing Bisq is the amount of dependencies that need to be mocked. The `given` part takes 20-30 lines, which makes the whole test unreadable, this defeating it's purpose.
Summing up: I'm for junit4 and Arquillian.
Unfortunately Arquillian does not support junit5.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bisq-github