Testicle
Extract tests from your project source using simple and flexible rules.
This project was developed to easy the stress of manually writing test for every functions, classes, methods e.t.c in projects which is manage by a small or indie team which has less resources and time to manually write test.
The project generates tests for various programming language using Rules. The rules are defined instruction the program follows in order to generate tests. The rules differs by programming languages as their are different testing frameworks for the languages.
Tests generated by this program can be run by the various languages test runner such as JUnit for java, pytest for pyhton e.t.c sometimes, most time, every time the test should still be reviewed by real human. TDD is currently not valued in this context.
Table of content
Usage
Building and Installing
This program was written in simple-lang so you need to have simple-lang installed on your system
before building the project from source. Follow the instruction below to build an executable on your system. Supply the bake configuration
flag base on your build type. debug, release, distributable
. The distributable flag generates executables that can be archived and shared
to be executed on other system.
cd testicles
simple bake conf.sim debug
This will generates appropriates binaries in the build folder. The bake build instructions is defined in the conf.sim file.
To Install the program from source as a simple-lang environment app add the flag --install
to the second command.
cd testicles
simple bake conf.sim release --install
It will be installed as a simple-lang environment and can be executed like simple testicles [testicles..arguments]
.
Writing Rules
Example
Generating the test for this project
cd testicles/test/
testicles Sample.sim --test_build_folder=/test/
The test file TestSample.sim
will be generated at tests as set in the conf.sim. The following test will be generated
from simple.core.Object
from simple.core.Assertion
class TestSample
var TestSample1
block BeforeTest()
TestSample1 = new Sample()
end
block TestDisplayName()
Assert(IsString(TestSample1.DisplayName()))
AssertNotEquals("SampleTest Not", TestSample1.DisplayName())
end
end