Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OSEE » how to map Code units artifacts to java/.c/.h files?
how to map Code units artifacts to java/.c/.h files? [message #722633] Tue, 06 September 2011 11:26 Go to next message
Swapna Missing name is currently offline Swapna Missing nameFriend
Messages: 9
Registered: July 2009
Junior Member
I have an usecase where i would like to map the .c/h./.java files which are in SVN with osee code-unti artifacts. When there is an action created for which some code changes are required, then these code file changes also to be tracked or linked with the action. Like how the software requriement changes are tracked to the action. When the change report is generated even the source code files which got changed due to the action should be shown. Can anyone throw some light on how to do this is OSEE ?

Thanks
Swapna
Re: how to map Code units artifacts to java/.c/.h files? [message #757241 is a reply to message #722633] Thu, 17 November 2011 10:16 Go to previous message
Swapna Missing name is currently offline Swapna Missing nameFriend
Messages: 9
Registered: July 2009
Junior Member
We can extend the OSEE code-units to store workspace location of the file , this can be done by adding an attribute Content-URL, which can be used to map the code unit to the java/.c/.h file with workspace relative path.
Linking of requirements to code can be done using the TraceUnitHandler extension point.The attached mail contents can also help in establishing the tracing between requirements to code. This reply was from the OSEE core team,
<Reply start>
I believe what you want to do is import trace units. You can do this via the import wizard. You'll need to implement a couple of classes and make extensions from them.



Take a look at DemoTraceUnitResourceLocator. You will need to make your own ITraceUnitResourceLocator. This locator basically validates files that you select from the import wizard. So if you select a directory, each file will go through this locator. Add logic here to determine if the file is a valid source file that you want to create a trace unit from. The locator you implement will also determine what type of artifact gets created during import. We have a locator that locates test scripts and returns TestCase as the type. If our trace unit is of type TestCase, we have a Tagger that will put an annotation with the guid of the TestCase artifact in the source file. Look at the process method in TraceUnitToArtifactProcessor.

Next, you'll want to implement your own ITraceParser. Take a look at the DemoTraceParser. The most important method is getTraceMarks. That method should parse your source file, pull out trace marks that relate that file to a requirement, and return them. We do this via regular expressions.
Example:You can include traceability in comments // TRACEABILITY(Uses, SW_REQ_1)

Then you would have a regex search for those marks and the TraceMark created would be TraceMark("Uses", "SW_REQ_1"). The requirement being traced to needs to be some type of abstract software requirement.

Once everything is imported, you can easily go from your source file in package explorer to the associated artifact (which will be related to the requirements that it had trace marks for and vice versa. To go from artifact explorer, right click on your trace artifact, and select "Reveal in Workspace." If you have the associated source file in your workspace, it will open it up. Depending on how your source files are named and what artifact type your locator returns, you might have to make changes. The code for this is in RevealInWorkspaceOperation.

To go from the source file to the associate artifact, have the source file opened in the editor, right click and select "Find Trace Unit Artifact". Use the one on the top level menu, not the one under OSEE menu. This search uses the guid added in the annotation from importing.

Hopefully this can get you started.

John
<Reply End>

regards,
Swapna

Previous Topic:workflow graphical editor doesnot open on double click
Next Topic:Enabling Remote Event Service in OSEE
Goto Forum:
  


Current Time: Fri Apr 26 12:54:18 GMT 2024

Powered by FUDForum. Page generated in 0.03294 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top