-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Deepika Tiwari edited this page May 31, 2022
·
3 revisions
pankti and rick are test generation tools. They monitor a Java application as it executes, in order collect data. This data is then used to automatically generate tests for the application. Here is a brief overview:
- pankti instruments methods in order to serialize the receiving object, parameters, and returned object when these methods are invoked during the execution of the application. The tests generated by pankti deserialize these objects to recreate the execution context of these methods. The assertion in each generated test verifies that the output returned from a method is equal to the one observed during execution.
- rick instruments methods (called methods under test or MUTs), as well as methods nested within these methods (called mockable methods). The goal of this instrumentation is to serialize the receiving object, parameters, and returned object of an MUT, as well as the parameters and returned object of mockable methods. The tests generated by rick recreate the execution context by deserializing the objects collected during execution. The receiving object of the mockable method is replaced by a mock within the test. The verification statements in the generated test verify different aspects of the invocations of the mocked method when the MUT is called.
This wiki documents the process of generating tests with pankti, and tests that use mocks with rick. We first learn how to build the project, and understand its structure. The instrumentation and monitoring tutorial explains how we monitor an executing application. The tutorials for pankti and rick describe them in more detail.
git clone [email protected]:castor-software/pankti.git
cd pankti/
mvn clean install
-
pankti/pankti-extract/
: Finds the list of methods that can be the targets for test generation -
pankti/pankti-instrument/
: Instruments them with the goal of serializing objects as the application executes -
pankti/pankti-generate/
: Generates test with the serialized data -
pankti/rick/
: Generates tests with mocks with the serialized data