12.07.2015 Views

Testing Embedded Systems in the Automotive Industry with TTCN-3

Testing Embedded Systems in the Automotive Industry with TTCN-3

Testing Embedded Systems in the Automotive Industry with TTCN-3

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Invest for <strong>the</strong> FutureThe contribution is partiallyfunded by <strong>the</strong> EFRE (Europeanfund for regional development)of <strong>the</strong> European Union.<strong>TTCN</strong>-3 User Conference 20093 – 5 June 2009 - ETSI, Sophia Antipolis, Francewww.temea.org<strong>Test<strong>in</strong>g</strong> <strong>Embedded</strong> <strong>Systems</strong> <strong>in</strong> <strong>the</strong><strong>Automotive</strong> <strong>Industry</strong> <strong>with</strong> <strong>TTCN</strong>-3Jens Grabowski (Universität Gött<strong>in</strong>gen), Jürgen Großmann(Fraunhofer FOKUS), Friedrich-Wilhelm Schröer (Fraunhofer FIRST),Jacob Wieland (<strong>Test<strong>in</strong>g</strong> Technologies), Diana Serbanescu(Technische Universität Berl<strong>in</strong>)grabowski@<strong>in</strong>formatik.uni-goett<strong>in</strong>gen.de,juergen.grossmann@fokus.fraunhofer.de, f.w.schroeer@first.fraunhofer.de,wieland@test<strong>in</strong>gtech.com, diana.serbanescu@fokus.fraunhofer.de


Standardized Test Technology for <strong>the</strong> <strong>Automotive</strong> <strong>Industry</strong>TEMEAWP1:<strong>Automotive</strong>Requirementswww.temea.orgWP5:Case StudyWP2:<strong>TTCN</strong>-3 embeddedConceptsWP4:Test Methodologyand QualityWP3:AUTOSARTest Framework


Motivationwww.temea.org<strong>Test<strong>in</strong>g</strong> software based embedded systems steadily <strong>in</strong>crease <strong>in</strong>complexity.In addition to that non-functional requirements, especially timerelated <strong>in</strong>put-output behavior, have to be considered.Adequate and standardized test solutions are needed, which at leastfeature a m<strong>in</strong>imum of flexibility, reusability and abstraction.3GOAL: Provide a standardized test<strong>in</strong>g solution forstandardized development environments (e.g. AUTOSAR for<strong>Automotive</strong> Solutions).GOAL: Tight Integration of real time test<strong>in</strong>g concepts <strong>in</strong> anexist<strong>in</strong>g test specification environment (i.e. The Test and<strong>Test<strong>in</strong>g</strong> Control Notation)


Standardized Test Technology for <strong>the</strong> <strong>Automotive</strong> <strong>Industry</strong><strong>TTCN</strong>-3 embedded Taskswww.temea.org <strong>TTCN</strong>-3 embedded for real time systems <strong>TTCN</strong>-3 embedded for cont<strong>in</strong>uous behavior <strong>TTCN</strong>-3 embedded hybrid behavior Graphical presentation format for <strong>TTCN</strong>-3 embeddedPreparation for standardization4


Real Time Test System Requirementswww.temea.orgtest componenttim<strong>in</strong>g checkvalue checktemporal controlstimulus : OUT_MSG_1[t max ]reaction : IN_MSG[t wait ]stimulus: OUT_MSG_2system under test (SUT)Standard: assessment of functional behavior (e.g. messagecontents).Additional: exact measurement, comparison and assessment ofmessage tim<strong>in</strong>g.Additional: temporal control of message dispatch<strong>in</strong>g.5


Real Time <strong>TTCN</strong>-3Simple Real Time Scenariowww.temea.orgtimer t1,t2;p_out.send(OUT_MSG_1);test componentsystem under testt1.start(t_max);stimulus - OUT_MSG_1(SUT)alt{time check[t MAX ][]p_<strong>in</strong>.receive(IN_MSG_1){setverdict(pass)};[]t1.timeout{setverdict(fail)}value check reaction - IN_MSG_1}time control [t WAIT ]t2.start(twait);t2.timeout;stimulus - OUT_MSG_2p_out.send(OUT_MSG_2);p_<strong>in</strong>.receive(IN_MSG_2);setverdict(pass); var reaction float - IN_MSG_2 r_time,s_time;p_out.send(OUT_MSG_1);s_time:=now;p_<strong>in</strong>.receive(IN_MSG_1)-> timestamp r_time;if(r_time>s_time+tmax) setverdict(fail);wait(r_time+twait);p_out.send(OUT_MSG_2);p_<strong>in</strong>.receive(IN_MSG_2);setverdict(pass);


Formalization of <strong>the</strong> Test Systemwww.temea.orgPa set of ports to communicate <strong>with</strong><strong>the</strong> System Under Test (SUT),a set Q of <strong>in</strong>put queues to organize <strong>the</strong>order of <strong>in</strong>com<strong>in</strong>g messages,a set C of synchronized clocks tomeasure time and to simulate <strong>TTCN</strong>-3timers,a set M of messages,a set TP ⊆ TPdata ∪ TPtime of predicatesthat are used to characterize <strong>the</strong>properties of <strong>in</strong>com<strong>in</strong>g messages, anda set OP = {snap, check, enqueue,dequeue, first, encode, decode, match}of time-consum<strong>in</strong>g operations that arenecessary to organize <strong>the</strong> handl<strong>in</strong>g ofmessages at ports.q 1..qnm 1..mnp 1..pn7


Example: Comparison of Message Tim<strong>in</strong>g<strong>in</strong> Standard <strong>TTCN</strong>-3www.temea.orgArrival of messages m o ,..,m n and <strong>the</strong>timeout of timers t 0 ,..,t m are denotedby events e 0 ,..,e k+1 ,9tim<strong>in</strong>g is measured by comparisonof events, andonly events that occur <strong>in</strong> differentsnapshots are dist<strong>in</strong>guishable.Duration between two consecutive snapshot denote <strong>the</strong> bestaccuracy of time measurement for standard <strong>TTCN</strong>-3. Theduration depends on:- <strong>the</strong> number of messages that arrive and <strong>the</strong> number of ports(queues) to check,- <strong>the</strong> duration of check, decode, match for <strong>in</strong>dividual messages where<strong>the</strong> duration of decode and match is directly dependent on <strong>the</strong>content and structure of <strong>the</strong> message under observation.


Worst Case Influence of Time Consum<strong>in</strong>gOperationswww.temea.orgProblematic Situations: message burst over one or multiple ports.Each alternative is def<strong>in</strong>ed by:Simple assumption: a new message has arrived at each port andnone of <strong>the</strong> messages match.10


Solutionwww.temea.org Seamless access to time Explicit measur<strong>in</strong>g and access to <strong>the</strong> reception time ofmessages Utilities to handle comparison of time and temporalcontrol of statement execution11


Time: Concepts & Representationwww.temea.orgTime model based on positive real numbersActual time t = t( c0)can be directly obta<strong>in</strong>ed by <strong>the</strong> user (nowoperator).<strong>TTCN</strong>-3 Language Level:- now operator returnstime <strong>in</strong> seconds coded asa float value.- we allow arithmeticexpressions on timevalues- precision of timemeasurement can bespecified by means of <strong>the</strong>precision annotationmodule{…var float myTimeVar;testcase myTc runs on myComp{…myTimeVar:=now+1.0;…}} <strong>with</strong>{precision:=0.001}


<strong>TTCN</strong>-3 embeddedMeasurement of Timewww.temea.org… to retrieve <strong>the</strong> enqueue time of a message,p.receive(t)-> timestamp myTime;// yields <strong>the</strong> reception time of a messageand time measurement at any place <strong>in</strong> <strong>the</strong> testvar float myTime:= now;// yields <strong>the</strong> actual time13


<strong>TTCN</strong>-3 embeddedVerification of Temporal Behaviourwww.temea.org Verification of enqueue time for <strong>in</strong>com<strong>in</strong>g messages,procedure calls etc.p.receive(t)-> timestamp timevar {if (timvar>max){setverdict(fail)}else {setverdict(pass)}};14


<strong>TTCN</strong>-3 embeddedTemporal Controlwww.temea.org … at any place dur<strong>in</strong>g test case execution,wait(timepo<strong>in</strong>t); and similar for message tim<strong>in</strong>gwait(timepo<strong>in</strong>t);p.send(t);15


<strong>TTCN</strong>-3 embeddedSettable Error Verdict Necessarywww.temea.org Double check <strong>the</strong> tim<strong>in</strong>g of test system behavior// test system to slowwait(timepo<strong>in</strong>t);p.send(MSG_1);if(now >= timepo<strong>in</strong>t + tol) setverdict(error);// SUT to slowwait(timepo<strong>in</strong>t);p.send(MSG_1);if(now >= timepo<strong>in</strong>t + tol) setverdict(fail);// SUT or test system to slowwait(timepo<strong>in</strong>t);p.send(MSG_1);if(now >= timepo<strong>in</strong>t + tol) setverdict(<strong>in</strong>conclusive);16


Use Case: Test of an Indicator<strong>Test<strong>in</strong>g</strong> Temporal Propertieswww.temea.org Maximum activation time 60 ms, phase length 600 ms Synchronization between signals: distance < 5 ms17


Use Case: Test of an Indicator<strong>Test<strong>in</strong>g</strong> Activation of Indicatorwww.temea.orgtestcase tc1( ) runs on IndicatorTestComponent{var float l_actv, r_actv, f_actv;const float TMAX = 0.06;activate(tc_timout);leverIn.send (LEFT);l_actv:= now;<strong>in</strong>terleave{[ ] FrontOut.receive(ON) -> timestamp f_actv;[ ] RearOut.receive(ON) -> timestamp r_actv;}if ((f_actv-l_actv > TMAX)or (f_actv-r_actv > TMAX)){setverdict(fail)}setverdict(pass);}18


Use Case: Test of an Indicator<strong>Test<strong>in</strong>g</strong> Signal Synchronizationwww.temea.orgtestcase tc2( ) runs on IndicatorTestComponent{var float r_actv, f_actv;const float TMAX = 0.005;activate(tc_timout);leverIn.send (LEFT);<strong>in</strong>terleave{[ ] FrontOut.receive(ON) -> timestamp f_actv;[ ] RearOut.receive(ON) -> timestamp r_actv;}if (abs(r_actv-l_actv) > TMAX){setverdict(fail)}setverdict(pass);}19


Summary and Outlookwww.temea.orgRT concepts are tightly <strong>in</strong>tegrated <strong>with</strong> <strong>TTCN</strong>-3 and- provide means for an exact measurement, comparison and verificationof <strong>the</strong> tim<strong>in</strong>g of <strong>in</strong>com<strong>in</strong>g messages, and- enables <strong>the</strong> detection of tim<strong>in</strong>g problems dur<strong>in</strong>g test execution andmessage dispatch<strong>in</strong>gImplementation of ConceptsIntegration <strong>with</strong> high level model<strong>in</strong>g techniques (i.e. declarativeapproaches to specify tim<strong>in</strong>g constra<strong>in</strong>ts).Def<strong>in</strong>ition of cod<strong>in</strong>g and design guidel<strong>in</strong>es to support <strong>the</strong> RTcapabilitiesof <strong>the</strong> newly <strong>in</strong>troduced <strong>TTCN</strong>-3 concepts.20


Contact and Infowww.temea.orgwww.temea.orgContactJürgen GroßmannFraunhofer FOKUSKaiser<strong>in</strong>-Augusta-Allee 31,10589 Berl<strong>in</strong>Tel: +49-30-3463-7390juergen.grossmann@fokus.fraunhofer.de

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!