Open bw4sz opened 7 years ago
@@ master #11 diff @@
==========================================
Files 16 18 +2
Lines 377 537 +160
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 135 162 +27
- Misses 242 375 +133
Partials 0 0
Powered by Codecov. Last update c7cc5d3...426be82
@bw4sz this needs to be tested before merging.
@tpoisot
Can you provide a bit more detail? When it says the code coverage has decreased, does it mean that some dependencies are undefined, or that there are global variables missing? I'm not totally following what is being evaluated.
As an example I add a test for OccupancyToJags in the previous commit ! I simply test that the file is indeed created.
@bw4sz sure -- it's counting the number of lines that are executed when you run the tests. It's expected that every possible situation is tested. For example the test by @KevCaz is one, but it's not sufficient since it's not telling anything about whether the file is correct.
Tim is right, what I have done is not enough. I guess the best is to apply your models (which requires jags files) on simple cases for which results are known.
The test implemented by @KevCaz for the functions (binomialToJags
, interceptToJags
, multinomialToJags
, poissonToJags
, OccupancyToJags
) are fine. These functions are supposed to create files.
@bw4sz, is there a way to send a fake dat
object to your fit_bayesreg
function and know (a priori) the expected results/values (or at least the range) of this function? In that case, you compare the output of the function fit_bayesreg
with the expected result.
If you need further details or examples have a look at http://r-pkgs.had.co.nz/tests.html. We know that implementing unit tests is more jobs but that practice is well suitable to prevent bugs and errors in the code.
Looking at the names of these functions, I wonder: shall we start the name by a lowercase letter or a uppercase one?
@KevCaz, lower !
Looks like steve updated the camelCase, and the namespace will need to be rebuilt. I will not get to testing these functions this week, i suggest we move forward with getting functions together.
Ben, I have stried to solve the issues, can you check if everything is Ok on your side??
@KevCaz , i pulled, merged, and pushed, everything looks okay on first pass. Will run my vignette in a sec.