Question & Answer
Question
How do you configure IBM Rhapsody TestConductor to create Unit and Integration tests using C Modules/Files?
Cause
TestConductor uses objects to create test cases with C Classes. However, since C Modules cannot be objects, TestConductor behaves differently. Instead of using instance links between objects, we must use usage dependencies
Answer
- Start with a simple C project. Two files: FileB and FileC. Each with a single function that outputs a string. In this default configuration you call them from the main file to confirm everything is working correctly.
- Right-click on FileB and select 'Create Test Architecture'. At this point you will prompted to add the TestingProfile if you haven't already. Accept this and continue.
- Right-click TestContext “Tcon_FileB” and select “Create SD Testcase”, then open the newly created TestCase “SD_tc_0()”
- Draw a new message from the TestContext to FileB, open the message's features window and select “FuncB()” in the realization field.
- Save the Project. Right-click the Tcon_FileB_Architecture test package and select, in turn:
Update TestPackage,
Build TestPackage
Execute TestPackage.
You should see the test scenario window appear and run the test case. The application will run and briefly show the function output in a command prompt
Note: The test context consists of two items; The test context & FuncB().
This is an example of a unit test. Now you must add the other File into this context to run an integrated test.
- Open the "Structure_of_TCon_FileB" Test Context Diagram under Ppkg_FileB::Tcon_FileB_Architecture::Tcon_FileB.
Drag the second file, FileC from the browser to the Test Context Diagram.
In the same diagram, add a <<usage>> dependency from the Tcon_FileB TestContext to the new FileC element.
- Open the test case “SD_tc_0()” and drag FileC to this diagram also.
- Draw a message from the TestContext to the FileC instance on the same diagram, it's features window and set the realization field to "FuncC()".
- Save the Project. Right-click the Tcon_FileB_Architecture test package and select, in turn:
Update TestPackage,
Build TestPackage
Execute TestPackage.
You should see the test scenario window appear and run the test case. The application will run and briefly show the function output in a command prompt.
Note: This time that the test context consists of three items. The test context, FuncB() and FuncC().
[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0.2","Edition":"Rational Rhapsody Developer","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21657838