Professional Documents
Culture Documents
Author
Anthony FAUCOGNEY
Abstract
This Application Note explains how to configure MaTeLo to generate CANoe test
cases, and automatically import them in the CANoe environment.
Keywords
Version
Table
able of contents
1.
2.
3.
4.
5.
Overview ................................................................
................................................................
................................................................
................................
................................................................
.................................................
................................................. 3
1.1.
1.2.
Vector CANoe To
Tool
ol Chain ................................
................................................................
................................................................
......................................................................
...................................... 3
1.3.
1.4.
2.2.
2.3.
MaTeLo: Test Suite generation into the Vector CANoe CAPL format ................................
....................................
.... 7
2.4.
2.5.
Application Example................................
................................................................
................................
................................................................
..............................................................
.............................................................. 10
3.1.
3.2.
3.3.
4.2.
4.3.
MaTeLo Testor
Testor:: Test Cases and Automation Script files generation ............................... 17
4.4.
Conclusion ................................................................
................................................................
................................................................
................................................................
.............................................................................
............................................. 23
5.1.
5.2.
5.3.
5.4.
Contact ................................................................
................................................................
................................................................
................................................................
................................................................ 23
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
Table of Figures
Figure
Figure 1: MaTeLo Automatic Test Framework ................................................................
................................................................
..........................................................
.......................... 5
Figure 2: Vector CAPL Browser ................................
................................................................
................................................................
................................................................
.................................................
................. 6
Figure 3: MaTeLo ATF Test Scripting Configuration ................................................................
................................................................
..................................................
.................. 9
Figure 4: Vector CANoe Simulation Environment ................................................................
...................................................................................
................................................... 10
Figure 5: Test Operation Call Implementation (Stimulation) ................................................................
................................................................
.................................. 13
Figure 6: CAPL Browser with a stimulation test function implementation ................................
.............................................
............. 14
Figure 7: Test Operation C
Call
all Implementation (Verification) ................................................................
................................................................
.................................. 14
Figure 8: CAPL Browser with a test function implementation ................................................................
................................................................ 15
Figure 9: MaTeLo Usage Model for the Car Locking System ................................................................
...................................................................
................................... 16
Figure 10: Markov Chain Report ................................
................................................................
................................................................
................................................................
.............................................
............. 16
Figure 11: MaTeLo Requirements Library ................................
................................................................
................................
...............................................................
............................... 17
Figure 12: MaTeLo Testor GUI ................................
................................................................
................................................................
................................................................
................................................
................ 17
Figure 13: Test Suite Analysis with the Generation Report Windows .....................................................
..................................................... 18
Figure 14: Name of the saved test suite ................................
................................................................
................................................................
................................................................
................................. 18
Figure 15: Generated MaTeLo files ................................................................
................................................................
................................................................
................................
.........................................
......... 19
Figure 16: MaTeLo XML Test Cases ................................................................
................................................................
................................................................
................................
.........................................
......... 19
Figure 17: MaTeLo Requirements Coverage Analysis Report ................................................................
................................................................
................................. 20
Figure 18: Partial CAPL Test Case Implementation ................................................................
................................................................
.................................................
................. 20
Figure 19: Partial CAPL Test Suite Implementation ................................................................
................................................................
.................................................
................. 21
Figure 20: CANoe Automation Script ................................
................................................................
................................
................................................................
......................................
...................................... 21
Figure 21: Automatic Creation of the Final CAPL file ................................................................
................................................................
..............................................
.............. 21
Figure 22: Added Test Cases into the CANoe Test Environment ................................
............................. 22
.............................................................
Figure 23: CANoe XML Report
Report................................
................................
................................................................
................................................................
.................................................
................. 22
................................................................
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
1. Overview
This application n
note
ote aims to explain how to use ALL4TEC MaTeLo instead of generating test cases for
Vector CANoe.
1.1. ALL4TEC MaTeLo Tool Chain
MaTeLo is a tool chain developed by ALL4TEC (www.all4tec.net
www.all4tec.net
www.all4tec.net) that implements the Model Based
Testing approach. In a user friendly environment
environment,, MaTeLo offers an integrated set of components and
features to enable test engineers in design
designing
ing their tests
test based on usage models
models..
Then, th
the
e test cases are automatically generated
enerated from the model depending on the user selected test
strategy.
The tool is mainly used in automotive at the product and system validation level.
In general, MaTeLo manages successfully test projects in the fields of automoti
automotive,
ve, railway or energy by
providing professional and valuable features to obtain a better test coverage and a higher engineering
productivity.
1.2. Vector CANoe Tool Chain
CANoe is a tool developed by Vector Informatik ((www.vector
www.vector-inform
www.vector informatik.com
informatik.com)
atik.com that offers simulation,
analysis and test
ing feature
features for distributed embedded networks development.
development. Thanks to its support
testing
of many busses, protocols and networks, CANoe is a very flexible solution for automotive system
systems
development and validation. With its capability to handle a partly real, partly simulated network, the
so called CANoe Test Feature Set enables to define and execute test
tests that address the system under
development.
The tool is a de facto industry standard for distributed system
systemss analysis and testing in automotive. It is
sometime the only comfortable way to interact with ECUs.
1.3. Why integrate MaTeLo with CANoe?
As soon as finding error
errors at early stage of the development cycle bring a high cost reduction,
reduction, the
interest to use MaTeLo for generating test cases during the network and system simulation make
makes
sense.
That is the reason why
why,, as soon as the system development start
starts,, tests
test can be designed, and
generated with MaTeLo
MaTeLo.. Then, as soon as the system can be simulated, the MaTeLo test cases will be
executed on the CANoe environment to insure high test coverage at low cost.
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
2. Integration Concept
2.1. MaTeLo
MaTeLo:: Vector CANoe Test Automation Framework
MaTeLo doesnt support in a fully integrat
integration
ion the Vector CANoe Test Automation Framework
Framework. First
First,, it
will be necessary to define a proprietary MaTeLo
Automatic
Automatic Test Framework aas knows
knows as ATF as the
following:
We can see different test operations, aka TO, that represent capable test services
service which can be
handle by the MaTeLo ATF, so
o for this paper Vector CANoe.
By convention, the TO starting by Admin_
Admin_ are used to deal with the construction
construction of the test script
structure and its automatic insertion in the end test tool.
2.2. CANoe: Test case implementation with CAPL format
The MaTeLo output format for test case generation will be CAPL (*.can).
(*.can). This CAPL file (categorized in
CANoe as CAP
CAPLL Test Node ) will host the test cases definition and its implementations as well as the
test functions libraries implementation. The CAPL structure is the following:
TestControl
o MainTest()
Testcase
testfunction
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
Test Suite
o Test Case 1
o Test Case 2
Test Step 1
Test Step 2
Stimulation
o Test Operation 1
o Test Operation n
Verification 1
o Test Operation 1
o Test Operation n
Verification n
Test Step n
o
o Test Case n
A Test
Test Suite
Suite means a test generation shoot
A Test
Test Case
Case means a selected path of the MaTeLo usage model
A Test
Test Step
Step means a transition in the usage model
Header
o File Header
o Main Test
o Test Suite Description
o Test Strategy Description
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
Footer
o Test Case Folder Declaration
o Test Functions Implementation
o File Footer
2.4.2. Test Case level (usage m
model
odel path)
ath)
Header
o Test Case Call
o Test Case Description
o Test Case Covered Requirement
o Test Case Declaration
Footer
2.4.3. Test Step level (ttransition)
ransition)
Header
o Test Step Description
o Test Step Covered Requirements
o Test Functions Calls with valued parameters
Footer
2.4.4. Generation Workflow
Because the script generation is done on the fly, we can easily understan
understand that this structure cannot
be generated in one single shoot. That is the reason why the generation process has been split into 2
generation actions + 1 automation action.
The process will generate 3 files from MaTeLo:
2 parti
partials
als files (CAPL *.can) for Test Suite and Test Case implementations
mplementations
o One file for the test case implementation (test functions calls)
o One file for the test suite implementation (test cases calls)
1 file (Visual Basic Script *.vbs) for CANoe Automation in order to add the generated test
cases automatically.
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
10
3. Application Example
Aiming to show this concept on a concrete project, a selected CANoe project, delivered as demo in the
release,
release is used to demonstrate the interoperability.
3.1. Automotive Locking System
In this Application Node, only a part of the system will be taken into account.
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
11
Panel Label
Symbol Type
Symbol Name
N ame
Available Value
Push Button
Input
Open Car
CAN signal
LockRequest
[idle ; 2]
Push Button
Input
Close Car
CAN signal
LockRequest
[idle ; 2]
Button
Input
Engine
CAN signal
EngineRunning
[0 ; 1]
Push Button
Input
Speed Up
EnvAccelerate
[0 ; 1]
Push Button
Input
Slow Down
EnvDecelerate
[0 ; 1]
Tail tell
Output
Lock State
CAN signal
LockState
[Locked ;
Unlocked]
Gauge
Output
Velocity
CAN signal
Velocity
[--100,350]
100,350]
Environmental
Variable
Environmental
Variable
Lock_Action
Lock_Action
Unlock_Action
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
Description
Involved Input
Involved Output
WHEN
The car is running
IF
The speed of the car
reach 50 km/h
THEN
The car become locked
IF
The button lock is
pressed
THEN
The car become locked
IF
The button lock is
pressed
THEN
The car become
unlocked
unlocked
Velocity
LockState
LockRequest
LockState
LockRequest
LockState
V1 March
March 2012
www.all4tec.net
12
3.3. Automati
Automaticc Test Framework
The following test operation
operations are required to performed the test case automation of the defined
requirements.
requirement .
3.3.1. Stimulation operations:
operations
Name
Push_Lock
Description
Change the signal lockrequest
to 1 , send the CAN frame, wait
that the CAN frame has been
confirmed on the CAN bus, and
then release the lockrequest
signal to 0, and confirm that the
CAN frame appear on the bus
Push_Unlock
Start_Engine
Stop_Engine
Set_Car_Speed
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
Parameters
None
None
Inputs/Outputs
Inputs/Outputs Involves
Input :
LockRequest
Input :
LockRequest
Input :
EngineRunning
Input :
EngineRunning
Input :
EnvAccelerate
EnvDecelerate
Output :
Velocity
V1 March
March 2012
www.all4tec.net
13
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
14
Description
Verify that the Lockstate
signal is 1
Verify that the Lockstate
signal is 0
Parameters
none
none
Inputs/Outputs In
Involves
volves
Output :
Lockstate
Output :
Lockstate
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
15
Figure 8:
8 CAPL Browser with a test function implementation
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
16
4. Project Deliveries
The full project can be found on our website at the following web address:
address: www.all4tec.net
4.1. MaTeLo usage model
To keep a simple understandable example
example,, the model is only about a single layer:
The usage model has been designed with MaTeLo Usage Model Editor. Even if only 3 requirements
explain the system needs, almost 20 transitions are necessary to cover the required use cases.
Figure 10:
10: Markov Chain Report
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
17
Figure 11:
11: MaTeLo Require
Requirements
ments Library
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
18
Figure 13:
13: Test Suite Analysis with the Generation Report Windows
The Arc Coverage algorithm just request 24 step to fully cover the whole model.
Figure 14:
14: Name of the saved test suite
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
19
Figure 15:
15: Generated MaTeLo files
The ggenerated
enerated MaTeLo test cases can be reviewed and analyzed with
with a style sheet that renders the
MaTeLo XML Test Suite as the following:
Figure 16:
16: MaTeLo XML Test Cases
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
20
A traceability table is generated to trace requirements with test cases and model items:
Then 2 partials CAPL files and 1 Visual Basic Script has been generated:
Figure 18:
18: Partial CAPL Test Case Implementation
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
21
Figure 19:
19: Partial CAPL Test SSuite
uite Implementation
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
22
The
he script
script control
controls CANoe
CANoe, via its COM server
server, and add
adds the MaTeLo generated test case into the
CANoe Test Environment.
Figure 22:
22: Added Test Cases into the CANoe Test Environment
Then,
Then, after executing the test case, the following report is automatically created:
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net
23
5. Conclusion
5.1. Project deliveries
Through this case study and their explanations, we notice that MaTeLo and CANoe are able to
integrate together. Thanks to this integration, a continuous process can be handled.
Thanks to MaTeLo, CANoe users are benefiting from a high
high-end
end Model
Model-Based
Based Testing approach to
build their test cases.
5.2. Tool integration benefits
The combinati
combination
on of the 2 tools will help to achieve a very productive engineering works.
MaTeLo help in making a good validation campaign, focus on requirements use case testing,
independently of the system implementation.
MaTeLo can use all the CANoe features (thanks to CAPL) and test patrimonies to run the campaign as
earliest as possible and during the whole development cycle.
5.3. Further Works
Additional integration can be handled to quickly extend this MaTeLo project and then enable users to:
- Get
CANoe
oe CAPL test function into the MaTeLo environment
et automatically the CAN
- Forward
orward CANoe test case
cases verdict to MaTeLo TCA
- Add
dd more MaTeLo usage model description & covered requirement
requirements into the CAPL test
cases
5.4. Contact
If you need more information or need more on this context, feel free to contact ALL4TEC at:
ALL4TEC
Contact
E-mail
mail
Phone
France Office
Pierre
MARTINETTI
pierre.martinetti@all4tec.net
+33(0)6
+33(0)6 08 21 12 03
Germany Office
Gabor
MATYUS
gabor.matyus@all4tec.net
+49(0)
+49(0) 17 28 971 101
Business Development
Anthony
FAUCOGNEY
anthony.faucogney@all4tec.net
fae@all4tec.net
Technical support
ALL4TEC
LAVAL (HQ) - MASSY - MUNICH
Phone: +33(0)2 43 49 75 30
V1 March
March 2012
www.all4tec.net