The Unit Test View section is located on the right of the screen. The Unit Test View combines the test and coverage information and provides it in a single view.
Toolbar menu in the Unit Test View
Pull-down menu in the Unit Test View
Menu name | Description |
---|---|
Show coverage at all elements | Displays the coverage in all items. (function, test, test case) |
Add description when duplicate test case | Adds original test case number on duplicated test case. |
Insert Default Values for Empty Input | When input data are empty, inserts default values. |
Delete All Test case Descriptions | Delete test case descriptions all together. |
Check Integrity | Checks integrity about functions and stubs. Then, reset test if it needs. |
- Insert Default Values for Empty Input
Variable type Default value string (empty string) without string 0
Dashboard in the Unit Test View
Search
In the Unit Test View, you can search functions, tests and test cases by file, function, test, status (success, failure, error) and issue name.
Status search keyword
In the Unit Test View, you can filter the tests that are displayed by the status search keyword. It provides searchable keyword recommendation and auto-complete function.
Keyword | Description |
---|---|
%TEST_SUCCESS% |
Test success |
%TEST_FAILURE% %TEST_ERROR% |
Test failure/error |
%TEST_FAILURE% |
Test failure |
%TEST_ERROR% |
Test error |
%TEST_HAS_NOT_FUNCTION% |
Function changed |
%TEST_NOT_GUARANTEE% |
Run not guaranteed |
%TEST_RESULT_DIFFERENT% |
Host/Target result different |
Structure of the Unit Test View
The Unit Test View presents the hierarchy structure of [Function] > [Test] > [Test case]. If there are more than 100 test cases in a test, they are grouped in groups of 100 to represent a group.
Item icons in the Unit Test View
Item icon | Description |
---|---|
None | Function |
Test | |
Scenario test | |
Test case, Test case group |
Item status color in the Unit Test View
The execution information of functions, tests, and test cases in the Unit Test View is represented by colors.
Color | Description |
---|---|
Green | Function/Test: If the execution result of all the test cases under it is success. Test case: The result of execution is success. |
Blue | Function/Test: If only test cases with failure and no test cases with errors exist under it. Test case: The result of execution is failure. |
Red | Function/Test: If test cases with error exist under it. Test case: The result of execution is error. |
Orange | Function/Test: All test cases have not been executed under it and test cases that are not guaranteed to run exist. Test case: Run not guaranteed. |
Black | Function/Test: All test cases under it have not been executed. Test case: Not been executed. |
Function
The functions provide the function name, the coverage and the test case execution results (success, failure, error and total).
Double-click on a function to check the location of the function in the Source Code Editor.
Context menu of the function
![]()
Context menu | Description |
---|---|
Create Test | Creates a test of the selected function. |
Copy Test | Copies tests of the selected function. |
Delete | Deletes tests and test cases of the selected function. |
Show call graph | Shows the function call graph of the selected function. |
Show Control Flow Graph | Shows the control flow graph of the selected function. |
Show MC/DC | Shows MC/DC of the selected function. |
Host Output Value -> Expected Value | Pastes the host output value to the expected value. |
Test reconfiguration | Reconfigure test information. |
Set related file | Selects the files containing that test. |
Relevant issues settings | Associates the selected test with the issue of the management tool. |
Import Test Data | Imports the test data saved in local. |
Export Test Data | Exports the test data to local. |
Add Stub | Adds the stub to the selected test. |
Apply Class Code | Apply the class code generated in the Class Factory View to the function. |
Select Function | Selects the checkbox of all the functions selected by a mouse. |
Deselect Function | Deselects the checkbox of all functions selected by a mouse. |
Generate coverage report | Exports the selected test coverage to the selected path. |
Fault Localization | Identify the location of defects or failures from failed test cases. |
Test
The test provides coverage, test case execution results(success, failure, error, total).
Double-click on a test to open its Test Editor.
Context menu of the test
Context menu | Description |
---|---|
Add Test Case | Adds the test case to the unit test selected. |
Generate test cases automatically | Creates the test case in various ways. |
Host Output Value -> Expected Value | Pastes the host output value to the expected value. |
Initialize Test case | Delete all the test cases. |
Copy | Copies the test and test case. |
Paste | Pastes the test and test case. |
Duplicate | Duplicates the test and test case. |
Duplicate multiple times | Duplicates tests and test cases as many as the number entered. |
Delete | Deletes the test and test case. |
Rename | Modifies the test name. |
Test reconfiguration | Reconfigure test information. |
Set related file | Selects the files containing that test. |
Relevant issues settings | Associates the selected test with the issue of the management tool. |
Import Test Data | Imports the test data saved in local. |
Export Test Data | Exports the test data in local. |
Large test data | Exports it locally or registers the file written by the user to the target test as a test case. |
Add Stub | Adds the stub to the selected test. |
Apply Class Code | Apply the class code generated in the Class Factory View to the test. |
Select Test | Checks all checkbox of the tests selected. |
Deselect Test | Checks all checkbox of the tests selected. |
Fault Localization | Identify the location of defects or failures from failed test cases. |
Generate coverage report | Exports the selected test coverage to the selected path. |
- Rule for importing test data
When importing the test data, if you select multiple test data numbered with the test name, it imports those files by merging them.
Import test data
You can import the test data in various formats (csv, xlsx, txt, json).
- In the context menu of the Unit Test View, click [Import Test Data] and select either [Basic format data] or [External format data].
- If you select [Basic format data], the test data with the format (csv) exported from the CT 2023.12 is imported.
- If you select [External format data], the test data is imported from the files in various formats (csv, xlsx, txt, json).
Generate test cases automatically
It creates a test case by using [Flat/Pairwise/Random combination], [Generates with Function Generator], and [Search-based Test case Generation (CS Labs)].
- In the context menu of the Unit or the Integration Test View, click [Generate test cases automatically] and select one among [Flat Combination], [Pairwise Combination], [Random Combination], [Generate with Function Generator] and [Search-based Test case Generation (CS Labs)].
Method | Description |
---|---|
Flat | Combines simply based on variables having the largest number of test data. |
Pairwise | Combines so that each selected parameter data is paired at least once with the parameter data other than itself. ※ The number of variable partitions must be more than 2 and less than 52. |
Random | Combines the test data as many as the number of test cases that the user defines any value between the minimum value and the maximum value for the variable partition of input parameters. |
Generate with Function Generator | Creates a test case by using six function types. (Ramps, Random, Range, Sine, Toggle, and Single Value) |
Search-based Test case Generation (CS Labs) | Creates a test case by using AVM, which is a local search algorithm. ※ Currently, only C language is supported. |
- If you select [Random combination], the Random combination window is displayed so that the user can enter the number of test cases.
- If you select [Generate with Function generator], you can select the function type (Ramps, Sine, Random, Toggle, Range, Single value and None) and change the settings of the function selected via the settings of the function generator. In the properties window of the project, you can set the function generator information in [Test] > [Generate test cases automatically] > [Function Generator].
a. Common settings
You can change the value in [Project] > [Properties] with the setting value common to each function.
Setting | Description |
---|---|
Sample interval | The interval of samples to be sampled from the function. |
Number of sample | The number of samples to be sampled from the function(The number of test cases). |
Start value | The default value at which the function is started (the values are created based on the start value). |
Minimum value of type | The minimum value of variable partition. (If the return value of the function is less than the minimum value of type, the minimum value of type is returned.) |
Maximum value of type | The maximum value of variable partition. (If the return value of the function is greater than the maximum value of type, the maximum value of type is returned.) |
b. Ramps function
It is a function that creates a pulse by using Pre, Post and Hold values. If the number of samples is greater than the period of the function, the function is called recursively.
Setting | Description |
---|---|
Pre delay | The time to last Pre/Post sample value. |
Rise samples | The time to rise from Pre/Post sample value to Hold sample value. |
Hold samples | The time to last Hold sample value. |
Fall samples | The time to fall from Hold sample value to Pre/Post sample value. |
Post delay | The time to last Pre/Post sample value. |
Pre/Post delay value | Pre/Post delay sample value. |
Hold value | Hold sample value. |
c. Random function
It is a function that creates a random value between the minimum value (Min) and the maximum value (Max).
Setting | Description |
---|---|
Min | The minimum value of random range. |
Max | The maximum value of random range. |
d. Range function
It is a function that creates values that increments or decrements by a certain interval (Step Size) between the minimum value of type and the maximum value of type.
Setting | Description |
---|---|
Step size | The size of increment or decrement value. |
Hold | The number of times that the Step size holds. |
Rising | The function type that rises by the Step size. Ex) if the step size is 30, 0,30,60…… |
Falling | The function type that falls by the Step size. Ex) if the step size is 30, 100,70,40…… |
Alternate | If the result value of function meets the minimum/maximum value of type, the function type that changes to rise or fall. Ex) if the step size is 30 and the maximum/minimum value are 0~100, 0,30,60,90,60,30,0…… |
e. Sine function
It is a function that creates Sine value. If the number of samples is greater than the period of the function, the function is called recursively.
Setting | Description |
---|---|
Amplitude | The amplitude of Sine function. |
Period | The period of Sine function. |
Phase | The phase of Sine function. |
Offset | The offset of Sine function. |
f. Toggle function
It is a function that creates FirstValue and SecondValue repeatedly.
Setting | Description |
---|---|
First value | The first value that is repeated in Toggle function. |
Second value | The second value that is repeated in Toggle function. |
g. SingleValue function
It is a function that returns only a constant single value.
Setting | Description |
---|---|
Value | The value to be created. |
h. None
It does not create a function.
Relevant issues settings
It associates the selected test with the issue in the issue management tool registered. The CT 2023.12 supports the following issue management tools: JIRA, Trac, Redmine, Mantis, Bugzilla.
Need more help with this?
Don’t hesitate to contact us here.