phyloref / jphyloref

MIT License
0 stars 0 forks source link

Add basic test suite #30

Closed gaurav closed 5 years ago

gaurav commented 5 years ago

This PR creates a very basic test suite using JUnit 5, including tests for the main program (JPhyloRef) and the three backend classes (OWLHelper, PhylorefHelper and ReasonerHelper), and adds a code coverage tool for highlighting untested code (JaCoCo). This PR upgrades the testing infrastructure from JUnit 3 to JUnit 5 and removes several System.exit() calls so that methods can be tested without exiting the test suite.

None of the commands (ReasonCommand, TestCommand and WebserverCommand) have been tested yet, as this code is complicated and should be refactored to facilitate testing first. It therefore only partially closes #3, which will be left open until all the code has been comprehensively tested.

gaurav commented 5 years ago

But in general, it's always a flag if a code change requires a test change (as opposed to an additional test) to go along with it in order to still pass, because that suggests there's an API or behavior change that may affect downstream users.

Agreed! I think there would have been less need for that if I had designed clearer interfaces from the start. I'll try to do that better in the future!

hlapp commented 5 years ago

Nice clarifications, much easier to understand now!