Applying UML to TestStand and LabVIEW Matthew Kennedy Engineering Manager...
-
Upload
vernon-stoughton -
Category
Documents
-
view
245 -
download
3
Transcript of Applying UML to TestStand and LabVIEW Matthew Kennedy Engineering Manager...
www.bloomy.com© 2003 Bloomy Controls Inc.
Agenda
Software project problems Why UML? Useful UML tools for TestStand and LabVIEW Conclusion Resources
* This is not a UML course. Just not enough time.
www.bloomy.com© 2003 Bloomy Controls Inc.
Software Project Problems
Software functionality Requirements definition
End users and programmers exist in different worlds and speak different languages Requirements get lost or misunderstood
Software programmers don’t have clear requirements, skip design, and go straight to code development
www.bloomy.com© 2003 Bloomy Controls Inc.
Minimize Software Project Cost
“Just complete the software THEN fix it.”
Three simple rules:1. State requirements2. Create system design3. Code to the design
Units Stage
.1-.2 Requirements
.5 Design
1 Coding
2 Unit test
5 Acceptance test
20 Maintenance1 unit=Effort required to detect and repair a error during coding
www.bloomy.com© 2003 Bloomy Controls Inc.
Where Does UML Come In?
UML can help software programmers and project engineers to: Define customer requirements Create basic designs
Set of notation and meta-model language tools Defined notation Applicable to many programming languages Makes programmers put pencil to paper and diagram/plan
systems
www.bloomy.com© 2003 Bloomy Controls Inc.
Useful UML Tools for LabVIEW and TestStand
Use cases Interaction diagrams
Sequence diagrams Activity diagrams
www.bloomy.com© 2003 Bloomy Controls Inc.
Stage 1: Requirements
Use case First step toward defining a software system A set of scenarios tied together by a common user
goal Describes what system must do
www.bloomy.com© 2003 Bloomy Controls Inc.
Use Case Example
Example: Load UUT for testMain success scenario:
1. Operator picks up UUT from rack2. Operator checks UUT socket clear3. Operator inserts UUT into test fixture4. Operator starts test5. Fixture locks down UUT6. Test begins
Extension 5a. Fixture fails to lock down
5a1. Eject UUT5a2. Reset test system5a3. System request maintenance
• Communicate requirements
•A set of scenarios tied together by a common user goal
•Plain language
Load UUTfor Test
Actor
www.bloomy.com© 2003 Bloomy Controls Inc.
Use Case Diagram – ExampleSet Product
LimitsTransport
UUT Rack toValidation
Load UUT forTest
Update YieldReports
ReevaluateLimits/SPC
Test UUT
UUT Fails toLoad
Design Engineer
Manufacturing Tech
Test Operator
Quality Engineer
<<extend>>
www.bloomy.com© 2003 Bloomy Controls Inc.
Use Cases – Final Thought
Of all UML tools, use cases are arguably the most important
Key to ensure a successful requirements stage Actors are not always easy to identify
Actor could be the test system itself, a sequence, etc. Meant to be simple but detailed enough to
manage project scope
www.bloomy.com© 2003 Bloomy Controls Inc.
Stage 2: Design
Sequence diagram Describes how groups of objects or processes behave in a
sequential and concurrent manner Typically defines a single use case
Activity diagram A state of doing something Describes sequence of activity
State diagram Describes all possible states that can occur in a system
www.bloomy.com© 2003 Bloomy Controls Inc.
Sequence Diagram Example
Test SocketLoad Window
DAQHIL
TestSequence
[No Latch && <5 it.]Latch UUT
Objects/Processes
Message
[No Latch] RequestMaitenance
Latch UUT
TerminationRoutine[Latch]Begin Test
Return
Self-Call
DAQHIL
Initialize Hardware
Creation
Latch UUTFor Test
www.bloomy.com© 2003 Bloomy Controls Inc.
Activity Diagram
Latch UUTFor Test
Initalize DAQ Hardware
Prompt User to InsertUUTand
request SN
Test UUT
Read LatchSwitch
Display SafetyWarning Message
[System Latched]
Prompt Userfor Maintenance
Sequential Process Model MainSequence
SwimLanes
Fork
Join
Branch
Merge
End
[Else]
Guard
www.bloomy.com© 2003 Bloomy Controls Inc.
State Diagram
Open DAQ Driver References
Latch UUTand check for confirmation______________________
do/command latchdo/check latch indication
Update GUI indicating UUTLatch Progress
Abort Routine
Flash Red LED
Flash Green LED
System Latched
Close DAQ Driver Reference
User Manual Abort/Abort
[No
La
tch
&&
Use
r R
eq
ue
st R
etr
y]/R
ep
ea
t
[else
]/La
tch[noLatch &&< 5 trys]/retry
(La
tch S
tatu
s)/Co
ntin
ue
[Else]
/Display GUI
event(arguements)[condition]/action
[Latched][n
o L
atch
]
Start
Transition
State
Activity
self-transition[E
lse
]
[no
La
tch
]
Read LatchSwitch Activity
www.bloomy.com© 2003 Bloomy Controls Inc.
Stage 3: Coding
Software design must be implemented Obvious implementations
State diagrams: LabVIEW state machinesSequence diagrams: TestStand sequence
LabVIEW dataflow programming Sequence structuresActivity diagrams: LabVIEW state machines TestStand sequences
Using a state diagram does not mean you must use a LabVIEW state machine
www.bloomy.com© 2003 Bloomy Controls Inc.
Fancy Flowcharts?
Isn’t UML just another flowchart?
Widely accepted standard Intuitive to use Many end users already have familiarity with UML
Instantly start talking the same language Plenty of resources to help Flowcharts and more with standardized notation
www.bloomy.com© 2003 Bloomy Controls Inc.
More UML Uses
Tools for programming graphical object orientated code in LabVIEW – GOOP Useful for class diagrams, package and collaborations
diagrams Some projects require merging traditional text-based
OOP languages and LabVIEW UML design tools do not necessarily determine implementation Mix and match the appropriate tools and ADEs
www.bloomy.com© 2003 Bloomy Controls Inc.
Tools to Help
Rational Rose Visio – UML toolkit New LabVIEW state machine wizard Any word processor: Use case development
www.bloomy.com© 2003 Bloomy Controls Inc.
Lessons Learned
Keep use cases detailed Avoid using language-specific information of software
design in use cases Use swimlanes with activity diagrams to assist in
modularizing TestStand sequence development Finish state machine diagram before writing LabVIEW
code Use only what you need
Unnecessary to use every diagram tool to adequately design a software system
www.bloomy.com© 2003 Bloomy Controls Inc.
Conclusion
UML is an industry-accepted standard for developing software architectures
More and more people are becoming aware of the benefits of using UML
UML is an excellent tool for developing LabVIEW and TestStand architectures BEFORE coding
Use appropriate UML tools UML can save time and money by preventing costly
rework
www.bloomy.com© 2003 Bloomy Controls Inc.
Recommended Reading
UML Distilled Second Edition, Martin Fowler and Kendall Scott
Managing Software Requirements a Unified Approach, Dean Leffingwell and Don Widring
The Unified Modeling Language Guide, Grady Booch, Ivar Jacobson, James Rumbaugh
Writing Effective Use Cases, Alistair Cockburn
www.bloomy.com© 2003 Bloomy Controls Inc.
Web Resources
Use-cases.org foruse.com UML.org Rational.com
www.bloomy.com© 2003 Bloomy Controls Inc.
About Bloomy Controls
Test, measurement, automation, and control specialists since 1991
Systems integration, software development, and training provider
NI Select Integrator and Certified Training Center 3 Certified LabVIEW Architects 8 Certified LabVIEW Developers 1 Certified TestStand Architect 2 Certified TestStand Developers 8 Certified Professional Instructors
Offices in Windsor, CT; Milford, MA; and Mahwah, NJ
www.bloomy.com© 2003 Bloomy Controls Inc.
Contact Bloomy Controls
Email [email protected] Write or visit
CT, Western MA, Eastern NY:
Eastern MA, RI, Northern New England:
Greater NYC, NJ:
839 Marshall Phelps Rd. 100 Medway Rd., Ste 202Windsor, CT 06095 Milford, MA 01757 Mahwah, NJ(860) 298-9925 (508) 902-0054 (201) 818-0117