Change of Function Signature

Question:
How to easily adapt all calling points of a function, if the name or the parameter list of the function changes?
Answer:

There is no functionality to automatically adapt all calling points of a function in case the signature changes. This feature is not provided due to several reasons. One reason is that it is not clear in which context the calling points should be adapted. Should it be in the scope of the test unit or in the scope of the project or …? At least when changing library functions it is not possible to adapt all calling points at all, since the function might be used in different vTESTstudio projects. So it would not be possible to guarantee that all calling points are adapted at all.

Thus the approach when changing the signature of an interface function is as follows:

  • Find all calling points of a function by the use of the context menu entry Find all References either on the function definition or on one of the calling points. 


     
  • This command provides you a list of all calling points within the active test unit. The list is available within the Find Results window and can be used to navigate to the single calling points. 


     
  • Rename the function definition and/or change the list of input parameters.
  • Navigate to each of the calling points by the use of the list in the Find Results window.
  • Adapt the function call. In the Test Table Editor, the Test Sequence Diagram Editor and the State Diagram Editor it can be done by selecting the new function signature out of the selection box of the input field Signature


     
  • Already entered input parameter values are still available afterwards, they do not have to be entered again. Their order may be changed by the context menu entries Move Up and Move Down.


     


Article ID: 961
Last updated: 2019-05-20
Revision: 3
vTESTstudio -> Interface Functions -> Change of Function Signature
https://kb.vector.com/entry/961/