Mocking is catching

Click for: original source

When writing unit tests for a package in R, you might find yourself wondering about how to best test the behavior of your package or you might even wonder how to test at least part of that package of yours that calls a web API or local database without accessing the web API or local database during testing. By R-hub blog.

In this post authors shall offer a round-up of resources around mocking, or not mocking, when unit testing an R package.

The article then deals with:

  • Packages for mocking
  • Web mocking
  • Temporarily modify the global state
  • To mock or… not to mock
  • Stored data from a web API / a database
  • Different operating systems

In this post authors offered a round-up of resources around mocking when unit testing R packages, as well as around not mocking. Good read for anybody in big data business.

[Read More]

Tags programming tdd big-data data-science