Requirements Toolbox: Problems when modifying linked MATLAB code

4 vues (au cours des 30 derniers jours)
Adil
Adil le 23 Août 2022
Modifié(e) : Adil le 30 Août 2022
Hi.
I'm currently using the MATLAB Requirements Toolbox for writing requirements and linking them from MATLAB code (.m files) and MATLAB test cases.
However, after creating links from MATLAB code to a requirement in the Requirements Editor, it seems like that the link is "hard-coded" and that code-lines above the link cannot be added/deleted anymore, without interfering with the existing links below.
So do I assume rightly that linking between MATLAB code and the Requirements Toolbox is not intended to be used like this?
Or is there any way to create "code-tags" that adapt the correct trace while modifying traced MATLAB code?
Edit:
I created a small example project to reproduce the issues:
1. Starting with 3 simple requirements which are implemented into codeExample.m and reqSet.slreqx. Each requirement is implemented separately in the code and has a link saved in codeExample.slmx. As can be seen at the attached screenshots below.
2. Then let's assume it was found out that there is a requirement missing on top of the code (even if the code makes no sense, just an example). So just after moving the first two code lines, the first issue occurs: The second link disappears and the first link does not move with the cursor. As can be seen at the screenshots below.
3. And after inserting the missing requirement into the code and the requirement set, we have two links which start at code line 1 and still one missing link. As can be seen at the screenshots below:
So I hope you can see that I modified the code only within the MATLAB editor and that this is helping you for detecting to find out what I maybe did wrong while using the Requirements Toolbox.
  2 commentaires
Artem
Artem le 30 Août 2022
Adi,
I tried your use case and all was good in my session. Please see the screenshot below. I do see the usability issue: the top linked range expanded instead of moving down, just because this linked range starts at the very top and there is no space to put a cursor before the linked range. I do realize your issue is with the lost 2nd link, not the expanded top range. I would appreciate your help in catching this bug.
1) What is the exact MATLAB version you are using, and what is your update level for this installation?
2) Was this a from-scratch experiment, or did you create and delete some links at the top of this .m file, before creating your initially shown 3 links?
3) You wrote "after moving the first two code lines". How exactly did you move the lines? In my attempt to reproduce the problem I simply put a cursor infront of "a = 20;" and pressed the "Enter" button twice. Did you do something different to create the two empty lines on top?
Thanks for your patience and help with this!
Adil
Adil le 30 Août 2022
Modifié(e) : Adil le 30 Août 2022
Hi Artem,
thanks again for your reply.
1) R2022a Update 3
2) Yes, it was a from-scratch experiment. I did not delete nor change nor add other links than described above.
3) Yes, I did it the same way as you by typing two times Enter with the cursor being in front of the 'a'.
The problem is also that these issues are not consistent for me: Sometimes everything works fine and sometimes the links behave weirdly. That's why I also included the error messages from the command line into the screenshot. "In rmiml.update" issues are thrown as can be seen.
Kind Regards,
Adil

Connectez-vous pour commenter.

Réponses (1)

Artem
Artem le 29 Août 2022
Adi,
We do support linking from MATLAB lines to Requirements Toolbox or to externally managed requirements. Linked ranges should adjust appropriately when .m file is edited. Please provide more details about (a) how do you establish links, and (b) how do you edit the .m file. For linked ranges to adjust automatically, you must use MATLAB Editor for modifying .m file, and the corresponding links file (.slmx file) must be available when working with the .m file, so that Requirements Toolbox can automatically update affected ranges and resave the .slmx file.
Artem
  2 commentaires
Adil
Adil le 30 Août 2022
Modifié(e) : Adil le 30 Août 2022
Hi Artem,
thanks for answering on this question.
I created a small example project to reproduce the issues and updated my question under "Edit".
Artem
Artem le 30 Août 2022
Adi,
Thank you for the explanations and the screenshots. There is definitely a bug somewhere. I will now try to reproduce the issue on my end. Hope to have a better answer later today.
Artem

Connectez-vous pour commenter.

Catégories

En savoir plus sur Software Development Tools dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by