rCOS

Refinement of Component and Object Systems

  • Increase font size
  • Default font size
  • Decrease font size

Robustness Testing for Software Components

E-mail Print PDF

This page gives instructions about how to generate and run robustness test cases with the  rCOS tool. The underlying principle refers to the paper "Robustness Testing for Software Components" by Bin Lei, Xuandong Li, Zhiming Liu, Charles Morisset, Volker Stolz, UNU-IIST report 423, 2009.

The following section will give you instructions:

  1. Install version 1.2.3 or better of the rCOS modeler. The installation instructions can be found at http://rcos.iist.unu.edu/index.php/rcos-modeler/installation.
  2. Import the  test-project into Eclipse. This project is archived into a zip file. You can access this file at http://rcos.iist.unu.edu/files/robustness.zip. In this project, there are several packages contained in the folder "src-tests". Most of the packages contain test case related data. Taking "rcos.cashdesk" as example, CoCoMe.uml is the rCOS UML model. Cashdesk.ocl contains the constraints defined with OCL language (we are working on directly using the rCOS preconditions). These two files are used when generating test cases. They are indispensable for generating test cases. The other Java files are used as implementation under test when running test cases.
  3. Now lets talk about how to use the project to generate test cases. Here we still take CoCoMe as a example. Right click on CoCoMe.uml in the Package Explorer and choose popmenu item rCOS->Generate Test Case. Then a dialog page will show up:

    There are 6 items on the page.

    • rCOS Model. The model you choose. Here it should be CoCoME.
    • State Machine. All the state Machines contained by the model. You need to choose one from them. CoCoME only have one state machine, Cashdesk_StateMachine.
    • rCOS Class. All the classes defined in the model. You should choose the class you want to test. Corresponding OCL File(see below) should exists. Here we choose Cashdesk class for test.
    • Package Name. The name comprises of the class's ancestor package name from root to its direct parent, which is conca with dot. Here class Cashdesk's package name is rcos.cashdesk. This name will be changed by replacing dot with underlying(rcos.cashdesk-->rcos_cashdesk). The result will be the package name containing generated test cases. You will find it in Output Directory (see Below).
    • OCL File. the ocl constrains file for specific class.
    • Output Directory. the location for the generated test case file. This location should be contained in a Java project. Besides, the directory should be source code folder of the java project. Here we choose the location as src-tests.
      Enter right choices and click Finish, a message dialog will give you information about how many testcases are generated. After refreshing the project, you can see the generated test cases in output directory under the package (e.g. rcos_cashdesk).
  4. Run test case one by one by right clicking on testcase java file and choosing Run As->Juit Test menu item. Or for convenience, find out Gen2Test.java file and run as Java Application. It will run all the test cases under the package(e.g. rcos_cashdesk). The test result will be printed on Console.
Last Updated on Wednesday, 30 September 2009 13:33