Jump to content
WG-

Idea for VITester

Recommended Posts

It would be awesome if you were able to manipulate the order in which tests are being done (and optionally leave tests out).

 

Example. I have a delete VI which deletes something. I return a boolean if it has actually been deleted. I also have a search VI which can look something up. Now in the unittest of the delete VI I have to actually verify that the record has been deleted. So after it has been deleted I also call the search VI, in the same unittest, which then checks if the record has been deleted. I also have a unittest which tests the search VI.

 

It would save me time (not programming the check on the unittest for delete) when I would be able to easily manipulate the order in which the unittests are being called. I could for example then first click the delete unittest and afterwards the search unittest. Further this would make a lot of test combinations possible, 2^(number of unittests) further enabling one to test the software more intensively.

 

The only problem which crosses my mind now is that you will have to be able to manipulate the tests. For example I have programmed the search unittest for a the search of ID:4 but not for ID:X where X is the ID that is being deleted for the delete test.

Share this post


Link to post
Share on other sites

I'm not a unit testing expert, but I'm pretty sure that unit tests should not depend on other unit tests. You can certainly reuse test support code, but there should be no external statefullness that an individual test relies upon.

 

I'll ping some others at JKI, to see if there are any more detailed answers that could be helpful to your testing scenario.

Share this post


Link to post
Share on other sites

I'm not a unit testing expert, but I'm pretty sure that unit tests should not depend on other unit tests. You can certainly reuse test support code, but there should be no external statefullness that an individual test relies upon.

 

This is correct - unit tests should not depend on execution order - that's one of the first principles of unit testing. What you should do is update the setUp.vi (and/or the tearDown.vi) in your TestCase class to setup the test (delete all unused files prior to running a test, create files needed for testing, etc). In the tearDown.vi you can delete all files that are no longer needed, etc. I hope that helps - let us know if you still have questions.

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.