You are on page 1of 29

Software Engineering for NI LabVIEW Applications

Elijah Kerry LabVIEW Product Manager

ni.com/largeapps
ni.com/community/largeapps
Ensuring Software Quality and Reliability
Goals
1. Deliver a working product
2. Prove it works right
3. Mitigate risk of failure
4. Avoid last-minute changes

Why?
1. More complex software
2. Mission-critical applications
3. Growing team size
4. Increased scrutiny
5. Decreased time
National Instruments Is ISO 9001 Certified
Mission Critical Applications

High-Volume Production Test Structural Health Medical Devices

24/7 Furnace Monitoring Large Physics Applications In-Flight Fire Suppression


Software Quality Standards
Company-wide certification standard

ISO 9000
Voluntary certification standard for consistent processes

CMMI
Process improvement model sponsored by the National
Defense Industrial Association

Product-specific certification for quality

DO-178B
FAA standard for avionics software

FDA 21 CFR Part 820


Medical device standard
Software Engineering V-Model

Requirements Review and Test


Prototyping Gathering
Deployment Service

Application Integration
Architecture Testing

Module
Unit Testing
Architecture

Development
and
Debugging

9
The Software Engineering Process

Requirements Application
Development Validation Deployment
Gathering Architecture

NI Requirements LabVIEW LabVIEW Desktop LabVIEW Unit Application


Gateway Statechart Execution Trace Test Framework Builder

Object Software Validation LabVIEW Real Time


Orientation Developer Suite Option VI Analyzer
FPGA

Embedded

Prove it works. NI TestStand

Improve quality. Reduce risk. Save time.

10
System-Level View Track Changes Integrate with SCC

Software Configuration Management for LabVIEW

Merge Graphical Code Manage Files and Links View Revision History
11
Software Design Phase

Prototype Specifications

System Unit Test


Requirements Specifications Definitions

12
Requirements Traceability Solution from NI

13
How Do You Know If It Is Good Code?
Requirements Application Debugging and
Development Deployment
Gathering Architecture Testing

Development Environment Tools


Constant compilation
Highlight execution
Break point manager
Automatic error handling
Diagram cleanup
NI Style Guideline
VI profiler
Coercion (memory) dots
Conditional disable structures
Tools for Debugging and Testing Debugging
and Testing

LabVIEW Unit Functional Validation


Advanced

Test Framework of Code


Application Complexity

LabVIEW Desktop NI Real-Time Dynamic Code Analysis


Execution Trace Execution Trace
Simple

LabVIEW VI Static Code Analysis


Analyzer Toolkit

Low Risk High Risk


Application Criticality

16
Tools for Debugging and Testing Debugging and
Testing

LabVIEW Unit Functional Validation


Advanced

Test Framework of Code


Application Complexity

LabVIEW Desktop NI Real-Time Dynamic Code Analysis


Execution Trace Execution Trace
Simple

LabVIEW VI Static Code Analysis


Analyzer Toolkit

Low Risk High Risk


Application Criticality

17
Establish or Adopt Development Guidelines
Front Panel Style Block Diagram Style
Fonts and Text Characteristics Wiring Techniques
Colors Memory and Speed Optimization
Graphics and Custom Controls Sizing and Positioning
Layout Left-to-Right Layouts
Sizing and Positioning Block Diagram Comments
Labels Call Library Function Nodes and Code Interface
Paths versus Strings Nodes
Enumerated Type Controls versus Ring Controls Type Definitions
Default Values and Ranges Sequence Structures
Property Nodes
Key Navigation
Dialog Boxes
Icon and Connector Pane Style
Icons
Example of Intuitive Icons
Style Checklist Connector Panes
VI Checklist
Front Panel Checklist
Block Diagram Checklist

NI Style Guideline: ni.com/largeapps


LabVIEW VI Analyzer Code Complexity Metrics
Tests for Industry-Standard Metric Calculations

Edges = 5 Nodes = 3 Paths = 1


True Case 1

Case 2

False Case 3

Cyclomatic complexity: 5 3 + 2 (1) = 4

19
Tools for Debugging and Testing Debugging and
Testing

LabVIEW Unit Functional Validation


Advanced

Test Framework of Code


Application Complexity

LabVIEW Desktop NI Real-Time Dynamic Code Analysis


Execution Trace Execution Trace
Simple

LabVIEW VI Static Code Analysis


Analyzer Toolkit

Low Risk High Risk


Application Criticality

20
Trace Production Systems Remotely
LabVIEW Desktop Execution Trace Toolkit

Network

VIs and Debuggable Executables


Run-Time Execution Information

NI Real-Time Execution Trace Toolkit

Network

Deployed Real-Time Applications


Run-Time Execution Information

21
Desktop Execution Trace Toolkit
Trace During Run Time
Event Structures
Memory Allocation
Queues/Notifiers
Reference Leaks
Thread ID
Unhandled Errors
Dynamic / Static SubVIs
Custom User Strings

22
Tools for Debugging and Testing Debugging and
Testing

LabVIEW Unit Functional Validation


Advanced

Test Framework of Code


Application Complexity

LabVIEW Desktop NI Real-Time Dynamic Code Analysis


Execution Trace Execution Trace
Simple

LabVIEW VI Static Code Analysis


Analyzer Toolkit

Low Risk High Risk


Application Criticality

23
LabVIEW Unit Test Framework

Input Values Output

VI Under Test

Unit Test
Expected Output Automated
Framework
Report Generation

Test vector = Input value(s) + Expected output(s)

24
Data Science Automation
Developed Long-Term Testing Solution for Artificial Hearts
The flexibility and easy of use
of the LabVIEW Unit Test
Framework Toolkit certainly
enabled much faster and
reliable completion of this
portion of the project,
potentially saving hundreds
of hours and thousands of
dollars over the life of the
project.

25
Code Coverage Example

6 Diagrams, 3 Diagrams Executed, 50% Code Coverage

26
Code Coverage Example
First Test Vector
Block diagram, 2 case diagrams executed; (2 + 1)/6 = 50% code coverage

Second Test Vector (aggregates covered code from first pass)


Block diagram, 5 case diagrams executed; (4 + 1)/6 = 83.33% code coverage

27
Integration with NI Requirements Gateway
Implementation

Software Requirements

Unit Tests

Test Results

28
New Software Engineering Features in

LabVIEW Unit Test Framework


LabVIEW Desktop Execution Trace Toolkit
Code Complexity Metrics
App Builder Log File Generation
Data Value References
Command-Line Differencing
Subversion Compatibility Improvements
Statechart Documentation Generation
Requirements Application Debugging and
Development Deployment
Gathering Architecture Testing

Deploy Software to Embedded Hardware Targets

Build Professional Applications for the Desktop


The Software Engineering Process
Requirements Application Debugging and
Development Deployment
Gathering Architecture Testing

Software Engineering Tools and Best Practices


NI Requirements Design Patterns Data Flow LabVIEW VI Application
Gateway Analyzer Builder
Object LabVIEW
MathScript NI Real-Time
Orientation Execution Trace Real Time
LabVIEW
Multicore Statechart LabVIEW Desktop FPGA
LabVIEW Control Execution Trace
Design and Embedded
Simulation LabVIEW Unit
LabVIEW Test Framework
SignalExpress

31
Software Engineering Best Practices

ni.com/largeapps

You might also like