SmallAmp is an open-source test amplification tool in Pharo Smalltalk. It transforms existing test methods to generate a set of new test methods, then it filters all tests that increase the coverage. The selected tests then are provided for the developer to be revised and merge in the code base. SmallAmp uses mutation testing as the default coverage metric. For more information check [Advanced topics](## Advanced topics).
In a nutshell: Developers can use SmallAmp on their projects to generate new test methods which increase the coverage. However, it is important to be an existing test suite with an acceptable test coverage.
You can use it in two ways:
- Using SmallAmpCI to integrate it in GitHub-Actions. ([how to](## Using SmallAmpCI))
- Run it locally on a Pharo image. ([how to](## Loading SmallAmp into a local image))
Metacello new
baseline: 'SmallAmp';
repository: 'github://mabdi/small-amp/src';
load.
SmallAmp can be used as a plugin for DrTest. More informaion here.
| result |
result := SmallAmp initializeDefault
testCase: SmallBankTest targets: {SmallBank};
testCase: SmallBank2Test targets: {SmallBank2};
amplifyAll.
result inspect.
You can find the generated testcases in SmallAmpTempClasses
package.
You can also ask SmallAmp to generate assertions for you:
Add this line to your test method: SmallAmp assertionsHere: self for: anObject
(replace anObject
with a object from your test method).
And run the test. Test will refactor itself and add new assertions.