4. Reactis Tester#

4.1. rcTester#

Create a test suite.

4.1.1. 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)

4.1.2. 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.

4.1.3. See Also#

rcTesterStart, rcSuiteSave, rcSuiteClose, rcReportConfig, rcGetCoverageMetrics

4.2. rcTesterStart#

Initiate the asynchronous creation of a test suite.

4.2.1. 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)

4.2.2. 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.

4.2.3. See Also#

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

4.3. rcTesterStop#

Stop running asynchronous test suite creation.

4.3.1. Syntax#

rcTesterStop(testerId)

4.3.2. 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.

4.3.3. See Also#

rcTesterStart, rcTesterIsRunning, rcTesterGetProgress, rcTesterGetSuite, rcTesterClose

4.4. rcTesterClose#

Close a Reactis for C Tester session.

4.4.1. Syntax#

rcTesterClose(testerId)

4.4.2. Description#

rcTesterClose(testerId)

closes the Tester session identified by testerId.

4.4.3. See Also#

rcTesterStart

4.5. rcTesterIsRunning#

True if test suite creation is still ongoing.

4.5.1. Syntax#

r = rcTesterIsRunning(testerId)

4.5.2. 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.

4.5.3. See Also#

rcTesterStart, rcTesterGetStatus, rcTesterGetProgress, rcTesterStop, rcTesterGetSuite, rcTesterClose

4.6. rcTesterGetProgress#

Get test suite generation progress.

4.6.1. Syntax#

p = rcTesterGetProgress(testerId)

4.6.2. Description#

p = rcTesterGetProgress(testerId)

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

4.6.3. See Also#

rcTesterStart, rcTesterIsRunning, rcTesterGetStatus, rcTesterStop, rcTesterGetSuite, rcTesterClose

4.7. rcTesterGetStatus#

Get test suite generation status.

4.7.1. Syntax#

s = rcTesterGetStatus(testerId)

4.7.2. Description#

s = rcTesterGetStatus(testerId)

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

4.7.3. See Also#

rcTesterStart, rcTesterIsRunning, rcTesterGetProgress, rcTesterStop, rcTesterGetSuite, rcTesterClose

4.8. rcTesterGetSuite#

Get test suite after generation is finished.

4.8.1. Syntax#

suiteId = rcTesterGetSuite(testerId) 

4.8.2. 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.

4.8.3. See Also#

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