JeremyWildsmith / bazaarbot-java

Reimplementation of bazaarbot, translated from the dotnet translation https://github.com/Vibr8gKiwi/bazaarBot2 ; originally implementation was in haxe by @larsiusprime (https://github.com/Vibr8gKiwi/bazaarBot2)
MIT License
5 stars 2 forks source link

Unit and JMH Testing #4

Open JeremyWildsmith opened 5 years ago

JeremyWildsmith commented 5 years ago

Going forward, I think it would be a good idea to implement unit testing.

We can do this by seeding the random number generator and comparing market reports to the expected values? Or maybe we can drill in deeper, but I think that is the simplest unit test to start with.

It will allow us to identify potential issues encountered due to refactoring.

JeremyWildsmith commented 5 years ago

I've introduced a general black box unit test on the ExampleEconomy - which I know isn't ideal but its better than nothing while we refactor the code.

DigitalSmile commented 5 years ago

I would say we need to move "examples" package from main to test. IMHO examples are best unit tests ever :)

JeremyWildsmith commented 5 years ago

I've integrated Travis CI to monitor the master branch build status and build statuses for PRs.

I think with the current unit tests, they should always pass until we decide to make behaviour inducing changes (which we should avoid if possible when in the refactoring stage.)

JeremyWildsmith commented 5 years ago

Due to the use of non-deterministic collections (ie, Set, HashMap) Currently the simulation is not deterministic enough to do a broad black box test and we will need to find a new approach or attempt to make the entire system more deterministic.