10 How to Add Your Test Cases?
- Add a new folder, For Example MyTests in the Test folder created by the tool.
- Define the test sequence as shown in Figure 14 and save it in the folder; for example Test1 inside MyTests.
- Add more test sequences by adding more folders in MyTests. Figure 14 shows a template of a test sequence.
Strictly follow the folder structure shown in Figure 15.
Points to keep in mind while writing a test sequence:
- The test sequence must begin with the “TCF Description” and end with “End of Test Sequence”.
- The global declarations and code must be inserted in the beginning of the test sequence after TCF description.
- User declarations, startup code, cleanup code (if needed) must be inserted above each test case.
- The test case description, ID and requirements covered for each test case must be inserted above each test case.
- The total number of parameters of the test case (that includes the function input parameters, return value, global variables checked) must be defined for each test case as shown in Figure 16 Df_type information is used by LDRA tool to understand the type of input and output parameters, for example if the parameter is a global or local variable. Commonly used Df_Types are
- "Z" - input parameter through Local
- "H" - output Global
- "%" - Function return
- "O" - output parameter
- "G" - input parameter through Global
- The file under test must be defined for each test case and the function tested must be defined in that file.
- Each test cases must be separated by a blank row.
- End of test sequence must be written in column 3 after the last test case leaving a blank row.
- One test sequence can test one and only one file.
- If the file under test has to be tested in white box mode, the Excel sheet must be saved as *_UT.xlsx (UT stands for Unit Test). In this case, a Code coverage report will also be generated along with the regression report.
- If the file under test has to be tested in black box mode, the Excel sheet must be saved as *_FT.xlsx (FT stands for functional test).
Figure 16 shows a few examples of a test case.
NOTE
Clicking the Add testcases button replaces all of the predefined test folders. It s recommended to add new test folders rather than modifying the existing ones.
Useful Tip: Right-click on the test list field and press Refresh to regenerate the list.