1
Testing of CAN-Bus Devices with TTCN-3
- A. Deinlein, A. Ulrich
Siemens AG, Germany {andreas.deinlein, andreas.ulrich}@siemens.com
2
- Testing of CAN-Bus Devices with TTCN-3
Testing of CAN-Bus Devices with TTCN-3 A. Deinlein, A. Ulrich - - PDF document
Testing of CAN-Bus Devices with TTCN-3 A. Deinlein, A. Ulrich Siemens AG, Germany {andreas.deinlein, andreas.ulrich}@siemens.com 2 Testing of CAN-Bus Devices with TTCN-3 agenda Introduction Testing tool selection TTCN-3 test
2
3
collimator
4
interaction and communicates with the master
testing language standardized by ETSI
X-rays in medical devices
up to 12 motor driven axles
collimator communicates over the CAN fieldbus via CANopen with a master (tester)
CAN CAN CAN CAN table stand X-ray generator
automated test of the integrated embedded device via the CAN interface
5
6
yes yes
187 203 total points limited yes abstract test architecture limited yes concurrent test cases
freely adaptable supported HW devices yes yes configuration of execution yes tool dependant real-time constraints limited freely adaptable report generation graphical tool new language ease of use yes adaptable CAN supported
(Vektor Informatik)
April 2005
7
concurrent testflow with 3 PTCs:
myTimer.start(0.1); alt { [] myTimer.timeout { myTimer.start(0.1); repeat; } }
1.) timer accuracy:
timer accuracy := deviation from cyclic 100ms timer
2.) tester response time:
colPort.send(startAxlePPM(getMessageID(axle,RPDO1))); ackTimer.start; alt { [] colPort.receive(axleStateAck(getMessageID(axle,TPDO1))) { ackTimer.stop; } [] ackTimer.timeout { setverdict(fail); stop; } } colPort.send(resetAckAxlePPM(getMessageID(axle,RPDO1))); time
tester response time := time from receiving a message till sending the response
"#$
"#$
98,40 98,70 99,00 99,30 99,60 99,90 100,20 100,50 100,80 101,10 101,40 101,70 102,00 102,30 102,60 102,90 103,20 103,50 103,80 CANalyzer 10 20 30 40 50 60 70 80 90 100 CANalyzer Danet Telelogic
% = 0,76 % = 0,43 timer accuracy max.: 0,8 ms; av.: 0,5 ms max.: 0,9 ms; av.: 0,8 ms tester response time
RT Performance
April 2005
frequency timeout value
Frequency chart for timer accuracy
expected 5ms window (Danet + Telelogic)
9
behaviour.3mp artis_architecture.3mp artis_functions.3mp artis_datatypes.3mp artis_testdata.3mp artis_declarations.3mp canopen_functions.3mp canopen_datatypes.3mp canopen_testdata.3mp canopen_declarations.3mp
TTCN-3 module concept:
between test cases
libraries
Codecs (libCodec.a)
from XML-File with CAN message representation
TRI-Library (libTri.a) (Danet)
with support for CAN-HW
PA-Library (libnt.a) (Danet) 10
function fNMTReset(in integer nodeid) runs on MTC { timer emcyTimer := 20.0; fTeststep("NMT-Reset"); colPort.send(resetNMT(nodeid)); emcyTimer.start(25.0); alt { [] colPort.receive(bootup(1792 + nodeid)) { repeat; } [] emcyTimer.timeout { fText("EMCY-Timeout abgelaufen"); setverdict(fail); } } fTeststepEnd(); }
canopen_functions.3mp
Testspecifier
behaviour.3mp
module behaviour { modulepar { integer config}; import from artis_architecture all; import ... testcase tcTemplate() runs on MTC system TSI { fRegisterCollimatorIDs(config); map (self:colPort, system:colPort); //***** USER AREA ******************* fNMTReset(64); //********************************** unmap (self:colPort, system:colPort); } control { execute (tcTemplate(), 500.0); } }
Testdeveloper
type port CCollimator_PortType message ... type component MTC ...
artis_architecture.3mp
XML
type record NMT_MessageType { integer messageID, integer node_ID, integer cs } with { encode "Canopen" }
canopen_datatypes.3mp
template NMT_MessageType resetNMT …
canopen_testdata.3mp generated
11
SUT image field CCD camera light emitter teststand TTCN-3 tester 12
test- script test- script EXE EXE compile execute test- spec. test- spec.
Workflow:
Results (XML) Results (XML) HTML HTML PDF PDF transform
13
14
10 20 30 40 50 60 70 80 90 100 codereview unittest component IT reliability tests system IT
test efforts
in days
Test automation used
10 20 30 40 50 60 codereview unittest component IT reliability tests system IT
85% of errors found in comp. IT result from test automation 16% of all errors are found in reliability tests Only 3 errors are found in system integration tests
found errors
15
in general worse performance compared to dedicated tools, e.g. CANoe
Solution required, e.g. codec/type co-generation if possible
About 3 times higher as for manual tests for the first test But 3 times less efforts in subsequent regression tests
16