Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop unit tests and indicate test coverage #139

Closed
achubaty opened this Issue Mar 26, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@achubaty
Copy link
Contributor

achubaty commented Mar 26, 2015

The first answer here is great: http://stackoverflow.com/questions/90002/what-is-a-reasonable-code-coverage-for-unit-tests-and-why

  • setup coveralls/travis coverage testing using covr package
  • display code coverage badge in README

Specific code can be excluded from testing: see https://github.com/jimhester/covr#exclusions


Testing graphical/plot outputs: see this StackOverflow question

devtools::install_github("MangoTheCat/visualTest")

Current coverage

Branch Coverage
master Coverage Status
development Coverage Status
## interactive session
library(covr)
library(shiny)
coverage <- package_coverage(type="all")
shine(coverage)
## non-interactive
# NOTE: some code may error due to namespace/environment issues
#             because of this, print more info to help with debugging
Rscript -e 'library(covr); package_coverage(quiet = FALSE); devtools::session_info()'
  • agent.R: 100.00% (#26)
  • check.R: 68.89%
  • checkpoint.R: 90.38% (#27)
  • environment.R: 64.29%
  • initialize.R: 70.79% (#28)
  • load.R: 84.17% (#29) (@eliotmcintire: currently, examples generate errors)
  • mapReduce.R: 100.00%
  • misc-methods.R: 80.16% (#30)
  • module-dependencies-methods.R: 93.07% (with #39)
  • module-repository.R: 77.78%
  • module-template.R: 83.77% (#31)
  • movement.R: 95.00% (#32)
  • neighbourhood.R: 90.18% (#33)
  • numerical-comparisons.R: 100.00%
  • plotting.R: 84.27% (#34) started by @eliotmcintire
  • plotting-classes.R: 75.00% (#34) started by @eliotmcintire
  • plotting-colours.R: 65.19% (#34)
  • plotting-diagrams.R: 0.00% (#34)
  • plotting-helpers.R: 54.08% (#34) started by @eliotmcintire
  • plotting-other.R: 10.98% (#34) started by @eliotmcintire
  • probability.R: 95.45% (#35)
  • progress.R: 15.28% (#36)
  • save.R: 94.74% (#37)
  • SELES.R: 50.94% (#38)
  • simList-accessors.R: 91.82% (with #39)
  • simList-class.R: 100.00% (with #39)
  • simulation.R: 94.63% (#39)
  • splitRaster.R: 100.00%
  • spread-process.R: 79.65% (#40) needs improvements
  • times.R 100.00%
  • zzz.R: 0.00%
  • develop unit tests for local (i.e., non-CRAN) checks that incrementally handle larger data sets / problems to see where things might break. Be sure to use skip_on_cran(). Probably want skip_on_travis() too...

@achubaty achubaty added the meta-issue label Mar 26, 2015

@achubaty achubaty changed the title [meta-issue] develop unit tests develop unit tests Mar 26, 2015

achubaty added a commit that referenced this issue Apr 17, 2015

add `covr` and coveralls to travis build (#139)
evaluate unit test coverage using `covr` package and
[coveralls.io](https://coveralls.io) integration

achubaty added a commit that referenced this issue Apr 17, 2015

achubaty added a commit that referenced this issue Apr 17, 2015

eliotmcintire added a commit that referenced this issue Jun 8, 2015

@achubaty achubaty changed the title develop unit tests develop unit tests and indicate test coverage Jun 10, 2015

achubaty added a commit that referenced this issue Jun 11, 2015

`defineModule` better handles `NA` values (closes #138)
* also checks/enforces types
* added corresponding unit tests (#139)

achubaty added a commit that referenced this issue Jun 15, 2015

achubaty added a commit that referenced this issue Jun 15, 2015

achubaty added a commit that referenced this issue Jun 15, 2015

achubaty added a commit that referenced this issue Jun 17, 2015

achubaty added a commit that referenced this issue Jun 28, 2015

improve simList test coverage (#139)
@eliotmcintire we need fileList tests

fixed `simObjects<-`: requires a named list

achubaty added a commit that referenced this issue Jun 28, 2015

achubaty added a commit that referenced this issue Jul 9, 2015

add test for non-numeric in `inRange`
* numerical comparisons now 100% coverage (#139)
@achubaty

This comment has been minimized.

Copy link
Contributor Author

achubaty commented Dec 30, 2015

@eliotmcintire Our coverage stats need to be updated with the forthcoming 1.1.0 release. Any low hanging fruit here we can quickly deal with to improve our coverage?

@achubaty

This comment has been minimized.

Copy link
Contributor Author

achubaty commented Nov 24, 2016

@eliotmcintire our coverage has dropped a bit because we haven't been adding new tests as we add new code. per above, any low hanging fruit we can go after here to bump our numbers?

@achubaty

This comment has been minimized.

Copy link
Contributor Author

achubaty commented Sep 5, 2017

closing here, but we should spend some time improving coverage in all spinoff packages

@achubaty achubaty closed this Sep 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.