-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This project demonstrates how to work with CI tools (in this example with Jenkis) and LabVIEW with the InstaCoverage unit testing tool. As an example we implemented a calculator application which provides the four basic arithmetic operations and tested with InstaCoverage focused on code coverage.
The main tasks of this step are as follows:
-
Add code repository to Jenkins environment.
- This demonstrator's code is available on our public GitHub repository.
-
Configure trigger action in Jenkins server.
- In this demonstrator the trigger action is a new commit in the repository.
-
Configure todos upon each trigger (new commit) in a Jenkins file. In this demonstrator we configured following todos:
- Checkout repository (default, not in file).
- Run LabVIEW script to execute unit tests (see Step 2).
- Display test execution results.
For further questions contact us at [email protected].
The script is written in LabVIEW and it is used to execute the unit test environment for Jenkins. Our demonstrator contains an example script file, which executes the following actions:
- Execute InstaCoverage's "Run Tests From Project" API VI to execute all InstaCoverage tests from our calculator project.
- Execute InstaCoverage's "Generate Report File" API VI to create a JUnit test execution report.
- To be able to display test coverage results we adapt the XML report for the built-in JUnit Jenkins plugin (the corresponding code be found here). Note that InstaCoverage's report format contains test coverage data.
- Close LabVIEW.
Notes:
- For the script VI to be executed automatically set the VI properties/Execution/"Run when opened" checkbox to true.
- For displaying test coverage data another option would be create a new Jenkins plugin which is compatible with XML output format of InstaCoverage.
As mentioned in the introduction section we developed a simple calculator application which demonstrates a possible software development process. As a first step we added the business logic of the calculator (3.1 and 3.2), then we started to add unit tests (3.2). At this point we realized that we didn't cover all VI diagrams (3.3). Because of our development process requires 100% diagram coverage for all VIs, we added the missing unit tests. As result of this it turned out that we have a bug in the implementation, which has to be fixed (3.4).
Add basic functionality without unit tests.
Related build available here.
Functionality implementation and unit testsing.
Related build available here.
Add new unit test to reach 100% diagram coverage and realize that our code is buggy.
Related build available here.
Fix functionality which doesn't meet the requirements.
Related build available here.