ReqIfUtil

버전 1.0 (7.52 KB) 작성자: Yongjian Feng
Utility to manipulate ReqIF documents. Change attribute values and add spec-relations
다운로드 수: 17
업데이트 날짜: 2021/9/25

MATLAB utility for Requirements Interchange Format (ReqIF) files

This is a MATLAB® class for manipulating ReqIF™ documents. ReqIF stands for Requirements Interchange Format. It is an important format that enables data exchange between requirement management tools.

With ReqIfUtil, you can

  • open a ReqIF document
  • get basic information like count of SpecObjects, Specifications, and SpecRelations
  • find SpecObject using attribute name and attribute value
  • change an attribute value of a SpecObject
  • add a SpecRelation between SpecObjects

Usage

Open and Save

To open a ReqIF document, instantiate a ReqIfUtil object with the filename. Here the sample ReqIF "ReqsAndLinks.reqif" is used for example:

reqif = ReqIfUtil('ReqsAndLinks.reqif');

To save a copy, call this:

reqif.saveReqIf('SavedReqIf.reqif');

Basic information of ReqIf

To get basic information of the opened ReqIF document:

numSpecObjs = reqif.getSpecObjCount();
numSpecRelations = reqif.getSpecRelationCount();
numSpecifications = reqif.getSpecificationCount();

Find SpecObjects

Find SpecObjects using attribute name and attribute value. For example, ReqIF.ChapterName is in general mapped to requirement summary. This sample code looks for SpecObjects that have "ReqIF.ChapterName" as "Req1"

specObjs = ReqIfUtil.find(reqif, 'ReqIF.ChapterName', 'Req1');

Change attribute value of a SpecObject

ReqIfUtil.setValue(specObjs{1}, 'ReqIF.ChapterName', 'ReqNew');

Add a SpecRelation

Assume that you found the two SpecObjects (source being specObj1, and target being specObj2) using the find methods above or you just pick two. Now you want to add a SpecRelation:

reqif.addLink(specObj1, specObj2, 'Implement');

How to get started

First copy the ReqIfUtil.m and ReqsAndLinks.reqif to your working directory.

% construct a ReqIfUtil object by providing a reqif file
reqif = ReqIfUtil('ReqsAndLinks.reqif');
% find two spec-objects
specObj1 = ReqIfUtil.find(reqif, 'ReqIF.ChapterName', 'Req5');
specObj2 = ReqIfUtil.find(reqif, 'ReqIF.ForeignID', ':6');
% Add a link from specObj1 to specObj2 named "Implement"
reqif.addRelation(specObj1{1}, specObj2{1}, 'Implement');
% save a new copy
reqif.saveReqIf('addedLink.reqif');

Please refer to testReqIfUtil.m for more examples of using ReqIfUtil.

인용 양식

Yongjian Feng (2024). ReqIfUtil (https://github.com/mathworks/ReqIfUtil/releases/tag/v1.0), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

줌: ReqIf-Utilities

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.