Reactive Systems logo
Reactis for C API V2019

API - Reactis for C: MATLAB Bindings - Reactis Tester

rcTesterCreate a test suite.
rcTesterStartInitiate the asynchronous creation of a test suite.
rcTesterStopStop running asynchronous test suite creation.
rcTesterCloseClose a Reactis for C Tester session.
rcTesterIsRunningTrue if test suite creation is still ongoing.
rcTesterGetProgressGet test suite generation progress.
rcTesterGetStatusGet test suite generation status.
rcTesterGetSuiteGet test suite after generation is finished.


rcTester

Create a test suite.

Syntax

suiteId = rcTester(rsmFileName)
suiteId = rcTester(rsmFileName,rshFileName)
suiteId = rcTester(rsmFileName,rshFileName,suiteFileName)
suiteId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters)
suiteId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName)
suiteId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName,reportConfig)

Description

suiteId = rcTester(rsmFileName) creates a test suite for program rsmFileName using default settings.

suiteId = rcTester(rsmFileName,rshFileName) creates a test suite for program rsmFileName using project-specific settings from file rshFileName.

suiteId = rcTester(rsmFileName,rshFileName,suiteFileName) creates a test suite for program rsmFileName using project-specific settings from file rshFileName. The test suite will be saved with file name suiteFileName.

suiteId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters) Same as above, extraParameters is a string containing parameters to control test suite generation (see below).

suiteId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName) Same as above, also creates an HTML report about the generated test suite, saving it as file reportFileName.

suiteId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName,reportConfig) Same as above, but allows to specify which information should be included in the HTML report. reportConfig must be created by calling rcReportConfig.

Any parameter except rsmFileName may be omitted by passing in an empty matrix instead.

suiteId is a scalar integer valued double that identifies the test suite file when calling other rcSuite* or rcSimRunSuite API functions. Test suite suiteId should be closed afterward by calling rcSuiteClose. If no test suite file name was given in the rcTester call, the test suite should be saved by calling rcSuiteSave before closing it, otherwise the test data contained in the suite will be deleted.

After the rcTester call finishes, coverage information may be obtained by calling rcGetCoverageMetrics.

The extraParameters string may include any of the following flags. All are optional:

-a {0|1}
Turns input abstraction on (1) or off (0). Inputs abstraction usually improves the performance of Tester and should be left on (default). In rare cases, turning it off may improve coverage. If coverage problems are encountered with inputs abstraction on, it may be beneficial to take a test suite produced with abstraction on, pre-load it into Tester, turn abstraction off, and then run Tester again.
-g c1;c2;...;cn
Specify a list of coverage metrics that should be used to guide test suite generation. Possible values for c1, c2, ... cn are:
Condition
Stateflow/Simulink/C Conditions
Decision
Stateflow/Simulink/C Decisions
MCDC
Modified condition/decision coverage
MCC
Multiple condition coverage
LookupDetail
Lookup table coverage
CStatement
C statements
CFunction
C functions
CFunctionCalls
Calls to C Functions
UserTarget
User-Defined Targets
Assertion
Assertions
-p fName1={y|n};fName2={y|n};...;fNamei={y|n}
Specify a list of .rst files to pre-load. The y|n argument for each file specifies whether or not pruning of the suite should be allowed. The random and targeted phases will extend the preloaded tests. The preloaded test suite files will not be modified.
-q timeoutSeconds
Specify the number of seconds for which to produce test cases. Tester will stop after either the timeout expires, all steps in the random or targeted phases have been executed, or full coverage is achieved for the program, whichever comes first. If -q is given and -t is not given, then Tester will continue until either the timeout expires or full coverage is achieved.
-r numTests;numSteps
Specify the number of tests and steps in the random phase. The defaults are 5 tests of 1000 steps each.
-s randomSeed
Initial seed for the random number generator.
-t stepsInTargetedPhase
stepsInTargetedPhase specifies the number of execution steps to take during the targeted phase of test generation. The default is 20,000 steps.

See Also

rcTesterStart, rcSuiteSave, rcSuiteClose, rcReportConfig, rcGetCoverageMetrics


rcTesterStart

Initiate the asynchronous creation of a test suite.

Syntax

testerId = rcTester(rsmFileName)
testerId = rcTester(rsmFileName,rshFileName)
testerId = rcTester(rsmFileName,rshFileName,suiteFileName)
testerId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters)
testerId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName)
testerId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName,reportConfig)

Description

testerId = rcTester(rsmFileName) initiates the creation of a test suite for program rsmFileName using default settings.

testerId = rcTester(rsmFileName,rshFileName) initiates the creation of a test suite for program rsmFileName using project-specific settings from file rshFileName.

testerId = rcTester(rsmFileName,rshFileName,suiteFileName) initiates the creation of a test suite for program rsmFileName using project-specific settings from file rshFileName. The test suite will be saved with file name suiteFileName.

testerId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters) Same as above, extraParameters is a string containing parameters to control test suite generation (see below).

testerId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName) Same as above, also creates an HTML report about the generated test suite, saving it as file reportFileName.

testerId = rcTester(rsmFileName,rshFileName,suiteFileName,extraParameters,reportFileName,reportConfig) Same as above, but allows to specify which information should be included in the HTML report. reportConfig must be created by calling rcReportConfig.

Any parameter except rsmFileName may be omitted by passing in an empty matrix instead.

testerId is a scalar integer valued double that identifies the test suite file when calling other rcTester* API functions. You should call rcTesterClose after test suite creation has finished to release memory allocated by rcTesterStart.

Test suite creation continues asynchronously after rcTesterStart returns. Use function rcTesterIsRunning to determine if test suite creation has finished. To stop test suite creation while it is still going, call rcTesterStop. Call rcTesterGetStatus and rcTesterGetProgress to get progress information. After test suite creation has finished, call rcTesterGetSuite to get the resulting test suite.

The extraParameters string may include any of the following flags. All are optional:

-a {0|1}
Turns input abstraction on (1) or off (0). Inputs abstraction usually improves the performance of Tester and should be left on (default). In rare cases, turning it off may improve coverage. If coverage problems are encountered with inputs abstraction on, it may be beneficial to take a test suite produced with abstraction on, pre-load it into Tester, turn abstraction off, and then run Tester again.
-g c1;c2;...;cn
Specify a list of coverage metrics that should be used to guide test suite generation. Possible values for c1, c2, ... cn are:
>
Subsystem
Conditional Subsystems
Branch
Branches in Simulink blocks
State
Stateflow States
ConditionAction
Stateflow Condition Actions
TransitionAction
Stateflow Transition Actions
Condition
Stateflow/Simulink/C Conditions
Decision
Stateflow/Simulink/C Decisions
MCDC
Modified condition/decision coverage
MCC
Multiple condition coverage
Boundary
Input boundary values
LookupDetail
Lookup table coverage
CStatement
C statements in white-box analysis of S-Functions and Stateflow custom C code
UserTarget
User-Defined Targets
Assertion
Assertions
-p fName1={y|n};fName2={y|n};...;fNamei={y|n}
Specify a list of .rst files to pre-load. The y|n argument for each file specifies whether or not pruning of the suite should be allowed. The random and targeted phases will extend the preloaded tests. The preloaded test suite files will not be modified.
-q timeoutSeconds
Specify the number of seconds for which to produce test cases. Tester will stop after either the timeout expires, all steps in the random or targeted phases have been executed, or full coverage is achieved for the program, whichever comes first. If -q is given and -t is not given, then Tester will continue until either the timeout expires or full coverage is achieved.
-r numTests;numSteps
Specify the number of tests and steps in the random phase. The defaults are 5 tests of 1000 steps each.
-s randomSeed
Initial seed for the random number generator.
-t stepsInTargetedPhase
stepsInTargetedPhase specifies the number of execution steps to take during the targeted phase of test generation. The default is 20,000 steps.

See Also

rcTesterIsRunning, rcTesterGetProgress, rcTesterGetStatus, rcTesterGetSuite, rcTesterStop, rcTesterClose, rcTester, rcSuiteSave, rcSuiteClose, rcReportConfig


rcTesterStop

Stop running asynchronous test suite creation.

Syntax

rcTesterStop(testerId)

Description

rcTesterStop(testerId) stops test suite creation in the Reactis Tester session testerId (initiated by rcTesterStart).

The part of the test suite that had already been created before the call to rcTesterStop can be accessed by calling rcTesterGetSuite.

See Also

rcTesterStart, rcTesterIsRunning, rcTesterGetProgress, rcTesterGetSuite, rcTesterClose


rcTesterClose

Close a Reactis for C Tester session.

Syntax

rcTesterClose(testerId)

Description

rcTesterClose(testerId) closes the Tester session identified by testerId.

See Also

rcTesterStart


rcTesterIsRunning

True if test suite creation is still ongoing.

Syntax

r = rcTesterIsRunning(testerId)

Description

r = rcTesterIsRunning(testerId) returns 1 if the Reactis for C Tester session testerId (initiated by rcTesterStart) is still running and 0 if it has finished.

See Also

rcTesterStart, rcTesterGetStatus, rcTesterGetProgress, rcTesterStop, rcTesterGetSuite, rcTesterClose


rcTesterGetProgress

Get test suite generation progress.

Syntax

p = rcTesterGetProgress(testerId)

Description

p = rcTesterGetProgress(testerId) returns a scalar double identifying the current progress of Reactis for C Tester session testerId(initiated by rcTesterStart) in percent.

See Also

rcTesterStart, rcTesterIsRunning, rcTesterGetStatus, rcTesterStop, rcTesterGetSuite, rcTesterClose


rcTesterGetStatus

Get test suite generation status.

Syntax

s = rcTesterGetStatus(testerId)

Description

s = rcTesterGetStatus(testerId) returns a string identifying the current status of Reactis for C Tester session testerId (initiated by rcTesterStart).

See Also

rcTesterStart, rcTesterIsRunning, rcTesterGetProgress, rcTesterStop, rcTesterGetSuite, rcTesterClose


rcTesterGetSuite

Get test suite after generation is finished.

Syntax

suiteId = rcTesterGetSuite(testerId) 

Description

suiteId = rcTesterGetSuite(testerId) returns the test suite generated by a call to rcTesterStart. If test suite generation has not yet finished, suiteId will be an empty matrix. Otherwise, suiteId is a scalar integer valued double that identifies the test suite file when calling other rcSuite* or rcSimRunSuite API functions. Test suite suiteId should be closed afterward by calling rcSuiteClose. If no test suite file name was given in the rcTesterStart call, the test suite should be saved by calling rcSuiteSave before closing it, otherwise the test data contained in the suite will be deleted.

See Also

rcTesterStart, rcTesterIsRunning, rcTesterGetStatus, rcTesterStop, rcTesterGetSuite, rcTesterClose, rcSuiteClose, rcSuiteSave