adolgert / UnitTestDesign.jl

Increases unit test coverage with fewer test cases using all-pairs and other covering arrays.

Home Page:http://computingkitchen.com/UnitTestDesign.jl/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnitTestDesign

Stable Dev Build Status Coverage

Chooses function arguments to make unit testing faster and more effective.

This package generates parameter values for unit tests, chooses software configurations for integration testing, or generates test datasets. If the system-under-test takes a long time to run or has many possible parameters or many possible values each parameter can take, this library chooses combinations of parameters that are more likely to find faults in the code. It assumes that code will break when there are interactions between different parameter choices, so it generates test data that covers all possible interactions among two parameters, the all-pairs algorithm, or three parameters, the all-triples algorithm, or higher-order combinatorial interactions.

Installation

pkg> add UnitTestDesign

Example

test_set = all_pairs(
    [1, 2, 3], ["low", "mid" ,"high"], [1.0, 3.7, 4.9], [:greedy, :relax, :optim]
    )
for test_case in test_set
    test_result = function_under_test(test_case...)
    @test test_result == known_result(test_case)
end

About

Increases unit test coverage with fewer test cases using all-pairs and other covering arrays.

http://computingkitchen.com/UnitTestDesign.jl/stable/

License:MIT License


Languages

Language:TeX 50.8%Language:Julia 48.3%Language:Ruby 0.9%Language:Makefile 0.1%