All Projects → brodieG → unitizer

brodieG / unitizer

Licence: other
Easy R Unit Tests

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to unitizer

Electron Vue
An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
Stars: ✭ 14,610 (+38347.37%)
Mutual labels:  unit-testing
Typescript Clean Architecture
It is my attempt to create Clean Architecture based application in Typescript
Stars: ✭ 225 (+492.11%)
Mutual labels:  unit-testing
ttdo
Extend tinytest with diffobj
Stars: ✭ 21 (-44.74%)
Mutual labels:  unit-testing
Dntframeworkcore
Lightweight and Extensible Infrastructure for Building Web Applications - Web Application Framework
Stars: ✭ 208 (+447.37%)
Mutual labels:  unit-testing
Sinon Jest Cheatsheet
Some examples on how to achieve the same goal with either of both libraries: sinon and jest. Also some of those goals achievable only by one of these tools.
Stars: ✭ 226 (+494.74%)
Mutual labels:  unit-testing
Xmlunit
XMLUnit for Java 2.x
Stars: ✭ 232 (+510.53%)
Mutual labels:  unit-testing
Onion Architecture Asp.net Core
WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 5!
Stars: ✭ 196 (+415.79%)
Mutual labels:  unit-testing
tau
A Micro (1k lines of code) Unit Test Framework for C/C++
Stars: ✭ 121 (+218.42%)
Mutual labels:  unit-testing
Camelotia
Cross-platform .NET sample GUI app for cloud file management. Built with ReactiveUI, AvaloniaUI, Universal Windows Platform, Xamarin Forms, and WPF, runs on Windows, Linux, Mac and Android.
Stars: ✭ 221 (+481.58%)
Mutual labels:  unit-testing
Alcotest
A lightweight and colourful test framework
Stars: ✭ 248 (+552.63%)
Mutual labels:  unit-testing
Vue Unit
Component testing utilities for Vue.js
Stars: ✭ 215 (+465.79%)
Mutual labels:  unit-testing
Transport Eta
Twitch streamed 🎥playground repo, README speaks to you.
Stars: ✭ 223 (+486.84%)
Mutual labels:  unit-testing
Alsatian
TypeScript testing framework with test cases
Stars: ✭ 244 (+542.11%)
Mutual labels:  unit-testing
Androidunittest
Save time & clear your unit tests on Android !
Stars: ✭ 205 (+439.47%)
Mutual labels:  unit-testing
Guise
An elegant, flexible, type-safe dependency resolution framework for Swift
Stars: ✭ 53 (+39.47%)
Mutual labels:  unit-testing
Archit Ios
Intelygenz iOS Architecture
Stars: ✭ 203 (+434.21%)
Mutual labels:  unit-testing
Quiz App
A repository reflecting the progress made on the "How to Build iOS Apps with Swift, TDD & Clean Architecture" YouTube series, by Caio & Mike.
Stars: ✭ 230 (+505.26%)
Mutual labels:  unit-testing
bUnit
bUnit is a testing library for Blazor components that make tests look, feel, and runs like regular unit tests. bUnit makes it easy to render and control a component under test’s life-cycle, pass parameter and inject services into it, trigger event handlers, and verify the rendered markup from the component using a built-in semantic HTML comparer.
Stars: ✭ 857 (+2155.26%)
Mutual labels:  unit-testing
utPLSQL-demo-project
Demo project using utPLSQL v3 with Travis as a CI server and SonarCloud for code analysis, coverage and test results
Stars: ✭ 24 (-36.84%)
Mutual labels:  unit-testing
Eosfactory
Python-based EOS smart-contract development & testing framework
Stars: ✭ 247 (+550%)
Mutual labels:  unit-testing

unitizeR - Interactive R Unit Tests

R build status Dependencies direct/recursive Project Status: Active – The project has reached a stable, usable state and is being actively developed.

TL;DR

unitizer simplifies creation, review, and debugging of tests in R. It automatically stores R expressions and the values they produce, so explicit expectations are unnecessary. Every test is easy to write with unitizer because testing and using a function are the same. This encourages non-trivial tests that better represent actual usage.

Tests fail when the value associated with an expression changes. In interactive mode you are dropped directly into the failing test environment so you may debug it.

unitizer is on CRAN:

install.packages('unitizer')

It bakes in a lot of contextual help so you can get started without reading all the documentation. Try the demo to get an idea:

library(unitizer)
demo(unitizer)

Or check out the screencast to see unitizer in action.

Why Another Testing Framework?

Automated Test Formalization

Are you tired of the deparse/dput then copy-paste R objects into test file dance, or do you use testthat::expect_equal_to_reference or other snapshot testing a lot?

With unitizer you interactively review your code as you would when typing it at the R prompt. Then, with a single keystroke, you tell unitizer to store the code, and any values, warnings, or errors it produced, thereby creating a formal regression test.

Streamlined Debugging

Do you wish the nature of a test failure was more immediately obvious?

When tests fail, you are shown a proper diff so you can clearly identify how the test failed:

diff example

Do you wish that you could start debugging your failed tests without additional set-up work?

unitizer drops you in the test environment so you can debug why the test failed without further ado:

review example

Fast Test Updates

Do you avoid improvements to your functions because that would require painstakingly updating many tests?

The diffs for the failed tests let you immediately confirm only what you intended changed. Then you can update each test with a single keystroke.

Usage

unitizer stores R expressions and the result of evaluating them so that it can detect code regressions. This is akin to saving test output to a .Rout.save file as documented in Writing R Extensions, except that we’re storing the actual R objects and it is much easier to review them.

To use unitizer:

  • Write test expressions as you would when informally testing code on the command line, and save them to a file (e.g. “my_file_name.R”).
  • Run unitize("my_file_name.R") and follow the prompts.
  • Continue developing your package.
  • Re-run unitize("my_file_name.R"); if any tests fail you will be able to review and debug them in an interactive prompt.

unitizer can run in a non-interactive mode for use with R CMD check.

Documentation

Related Packages

Acknowledgments

Thank you to:

About the Author

Brodie Gaslam is a hobbyist programmer based in the US East Coast.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].