Unit Testing Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Best practices for Unit Testing

Hi James,

 

Thanks for the explanation Smiley Happy

 

When I tried creating a test by using both NI UTF and VI Tester, I also felt that VI Tester suits my needs. Also,

 

I have 2 more questions

1) I felt like handling arrays is not user-friendly in NI UTF. May I know your thoughts on this?

2) When we create a test case in VI Tester, it creates a class. Usually, class objects make the program run slower. Will there be any effect on performance because of this class?

 

 

0 Kudos
Message 11 of 23
(2,760 Views)

@Bhargavi_1

 Usually, class objects make the program run slower. Will there be any effect on performance because of this class?

That's not correct. Classes do not slow down application in any way.

Moreover, test class will run within VI Tester only, you'll not use it in main application, won't you?

Message 12 of 23
(2,755 Views)

Hi Kosist,

 

I won't use it in main application, I have realized that it won't affect the performance.

 

Thanks for the confirmation.Smiley Happy

0 Kudos
Message 13 of 23
(2,751 Views)

@Bhargavi_1 wrote:

 

1) I felt like handling arrays is not user-friendly in NI UTF. May I know your thoughts on this? 


I agree that handling arrays and clusters is not developer-friendly in NI UTF. I recommend populating the VI inputs and outputs with what you want and then within the UTF test case on the top right use one of the buttons there to "import values from VI".

Thanks for the compliments on the videos. I will add more... soon...ish 😉

 

 

Regards,

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 14 of 23
(2,741 Views)

Hi Fab,

 

Yeah, I tried handling arrays by importing the values from VI, but I feel this is an extra work that needs to be done Smiley Wink

 

Maybe, the wise decision is to choose JKI VI Tester.

 

Anyways thanks, FabSmiley Happy

0 Kudos
Message 15 of 23
(2,733 Views)

@Bhargavi_1

Yeah, I tried handling arrays by importing the values from VI, but I feel this is an extra work that needs to be done Smiley Wink

 


If you really want the extra work, you can look into test vectors in UTF 😉

 

I would give a try to JKI VI Tester and InstaCoverage and then chose the one that fits your needs better.

 

 

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 16 of 23
(2,724 Views)

Hello Fab,

 

Test vectors is not a good choice for my application as I have to compare the array of values..!!

 

I am choosing JKI VI Tester. I didn't use InstaCoverage, let me know if you find any advantage in InstaCoverage Smiley Wink

 

Thanks, FabSmiley Happy

0 Kudos
Message 17 of 23
(2,717 Views)

@Bhargavi_1 wrote:

 

I am choosing JKI VI Tester. I didn't use InstaCoverage, let me know if you find any advantage in InstaCoverage Smiley Wink


InstaCoverage is fairly new and I am still evaluating it, I will know more once I use it in a project. So far, I have been impressed with how responsive Péter and his team at Incquerylabs have been regarding feedback. They continue to improve the tool. It is already way better than what I saw during NI Week. 

 

The area where InstaCoverage has benefits over the other tools is Real-Time targets. NI UTF works in Real Time targets but it doesn't support code coverage calculation in those targets. JKI VI Tester doesn't work for testing code in Real-Time targets that call RT functions.

 

I have been using JKI VI Tester for several years now and I do prefer it over NI UTF. With some of my customers, I have to use NI UTF because they are in regulated environments. I have learned to work around some of the NI UTF issues. 

 

Keep us posted of your progress and good luck!

Regards,

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 18 of 23
(2,710 Views)

The area where InstaCoverage has benefits over the other tools is Real-Time targets. NI UTF works in Real Time targets but it doesn't support code coverage calculation in those targets. JKI VI Tester doesn't work for testing code in Real-Time targets that call RT functions.

That's not quite true. As of today, no available tool can measure test coverage on real-time targets. UTF and InstaCoverage can run tests on real-time targets but the coverage measurement will be disabled. Coverage measurement is only available on desktop. So a workaround is to test for coverage on desktop and run functional tests on the real-time target.

 

Again, like it is discussed in the comparison table, the main advantages of InstaCoverage over other tools are:

  • The only tool which is fast on big projects and measures test coverage.
  • Supports explicit test configuration files (same for UTF).
  • No LVOOP knowledge needed (same for UTF and Caraya).
  • Will be available for LabVIEW NXG (version 3.0 due around November 2018). 
  • There will be a free InstaCoverage Core version (no API and test coverage).

 

0 Kudos
Message 19 of 23
(2,666 Views)

@FabiolaDelaCueva wrote:

@Bhargavi_1 wrote:

 

I am choosing JKI VI Tester. I didn't use InstaCoverage, let me know if you find any advantage in InstaCoverage Smiley Wink


The area where InstaCoverage has benefits over the other tools is Real-Time targets. NI UTF works in Real Time targets but it doesn't support code coverage calculation in those targets. JKI VI Tester doesn't work for testing code in Real-Time targets that call RT functions.

To be more precise, there is, as of today, no available tool to measure test coverage on real-time targets. UTF and InstaCoverage can execute unit tests on RT targets but the coverage measurement will be disabled. A workaround is to test for coverage on desktop and (re-)run functional tests on the target. 

 

Again, like it is discussed in the comparison table, the main advantages of InstaCoverage over other tools are:

  • The only tool which is fast on big projects and measures test coverage.
  • Supports explicit test configuration files (same for UTF).
  • Requires no LVOOP knowledge (same for UTF and Caraya).
  • Will be available for LabVIEW NXG (3.0 due in November 2018).
  • There will be a free version soon (InstaCoverage Core).

 

Peter

Message 20 of 23
(2,675 Views)