forked from tema-tut/tema-tg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
803 lines (582 loc) · 27.2 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
################
TEMA Test Engine
################
.. role:: raw-latex(raw)
:format: latex
:Date: 09.12.2010
:raw-latex:`\newpage`
.. contents:: Table of Contents
:raw-latex:`\newpage`
Introduction
============
This package contains programs for model analysation, model configuring and
composing, log analysation and test engine for running tests. In addition to
that some documentation is provided.
Included Programs
+++++++++++++++++
Model Analysation
-----------------
- tema.actionlist: List all action words in test model
- tema.analysator: Analyse test models
- tema.packagereader: Read various information from model package
- tema.simulate: Simulate model
- tema.xsimulate: Simulate model graphically
- tema.validate: Validate model components
Model Conversion
----------------
- tema.ats4appmodel2lsts: Convert Ats4AppModel-model to LSTS-model
- tema.mdm2svg: Convert MDM-Model to svg
- tema.model2dot: Generate graphviz models from TEMA-models.
- tema.model2lsts: Convert any TEMA-model to LSTS-model
Model Configuring,Composing and Executing
-----------------------------------------
- tema.composemodel: Compose test model that can be run with tema.testengine
- tema.generatetestconf: Configure model so it can be composed with
tema.composemodel
- tema.testengine: Execute test model
- tema.runmodelpackage: Helper program that uses composemodel,generatetestconf
and testengine.
Special tools for model composing
---------------------------------
These tools are used by other tools and generally are not indended for use by
regular user.
- tema.generatetaskswitcher: Generate task switcher for models
- tema.gt: Tool for graph transformations in LSTSes
- tema.renamerules: Tool for renaming rules in rules-files
- tema.rextendedrules: Convert extended rules file with regular expressions to
extended rules file
- tema.specialiser: Specialise model
Log Analysation
---------------
- tema.log2srt: Generate subtitle file from TEMA test log
- tema.logreader: General information about TEMA test log
- tema.plotter: Convert information generated with tema.logreader to gnuplot
format
- tema.sequencer: Generate action sequence from TEMA test log. Action sequence
can be given to TEMA test engine as parameter
Other
-----
- tema.filterexpand: Filter test model
- tema.variablemodelcreator: Generate variable models that can be imported in
ModelDesigner
Included Documentation
++++++++++++++++++++++
- Docs/testengine-for-developers: Short introduction for TEMA Test Engine
internals
- Docs/ssprotocol: Specification of protocol used for communication between
Test Engine and Client Adapters.
- INSTALL: Installation instructions
- README: General user guide
- TemaLib/tema/ats4appmodel/readme: Instructions for using Ats4AppModel-model
to LSTS-model converter
:raw-latex:`\newpage`
Models
======
Action Machines
+++++++++++++++
Action machines describe user actions on the level that is independent of user
interface details. Each action is called action word.
Refinement Machines
+++++++++++++++++++
Refinement machines convert the high level user actions (action words) to
concrete events in the user interface using keywords.
There is at least one refinement machine for every action machine for every
device.
Localisation
++++++++++++
TEMA includes support for localisation, that is, replacing specially
tagged strings in action names (esp. keywords) by strings of selected
language.
Localisation data is stored in files, each of which contain a table.
The header row specifies which languages will be given in the
following columns. The first column contains identifiers that will be
translated to the specified language in the localisation.
The localisation tables are read in CSV format produced by Excel
(fields are separated by semicolons ';'). Example::
identifier;en;fi;se
Contacts;Contacts;Kontaktit;Kontakter
Calendar;Calendar;Kalenteri;Kalender
To see, how localisation tables are used in the test execution, see
Section.
Data
++++
TEMA tools support using test data. The data can be filenames, contents for
text messages, first and last name, phone numbers, addresses, etc.
Defining data
-------------
Test data is defined in separate data files. Each line in a data file defines
one variable, its optional structure and all possible values. The variable
name and the structure are separated from the values with a colon.
For example, "txtfilename" variable that can have four different values is
defined as follows::
txtfilename: ["abcxyzåäö.txt", "a.txt", ".txt", "a"]
It is possible to define structured data values. For example, a
variable named "contact" can include fields "name" and "number". This allows
using the data so that a name is associated to a single phone number.
In the following, "contact" variable contains two names and their phone
numbers::
contact(name, number): [("Alice","5554"), ("Bob","55553")]
The depth of structures is not limited. In the next example, "name" field in
contacts is divided to "first" and "last" fields, but the phone number is
without substructure::
contact(name(first, last), number): \
[(("Alice","Allosaurus"),"5554"), \
(("Bob","Builder"),"5553")]
Using data
----------
Data is be manipulated and printed in the transitions of test models. If the
label of a transition contains statements between "$(" and ")$", the
statements are evaluted when the transition is executed in the test model.
This happens to all transitions, despite the type of the label (keywords,
action words and comments). The statements are written in Python.
If the evaluation results in data in OUT variable, the corresponding
$(...)$ in the transition label is replaced by the value of OUT. Otherwise,
the $(...)$ is replaced by an empty string.
Functions "first", "next" and "any" can be used to change the value of a
variable.
For example, given the data in the above example, execution of transitions ::
start_awEditContact
-- trying to find $(any(contact); OUT=contact.name.last)$
~kw_VerifyText '$(OUT=contact.name.first)$'
kw_PressHardKey <East>
kw_VerifyText '$(OUT=contact.name.first)$'
kw_SelectMenu 'Edit'
kw_VerifyText '$(OUT=contact.number)$'
kw_PressHardKey <SoftRight>
end_awEditContact
may have resulted in the following execution in the point of view of a
test adapter ::
start_awEditContact
-- trying to find Builder
~kw_VerifyText 'Bob'
kw_PressHardKey <East>
kw_VerifyText 'Bob'
kw_SelectMenu 'Edit'
kw_VerifyText '5553'
kw_PressHardKey <SoftRight>
end_awEditContact
Building a model
++++++++++++++++
First input file *testconfiguration.conf* needs to be created for
**tema.generatetestconf**. Following example file configures model for
two target devices with Messaging-application in Android-emulator target and
Telephony-application in N95-target. **Tema.packagereader** can be used to
determine required information from model. ::
[targets: type]
Emulator: Emulator21
Frank: N95
[targets: actionmachines[]]
Emulator: Messaging%20-%20Create%20MMS.lsts, \
Messaging%20-%20Create%20SMS.lsts, \
Messaging%20-%20Inbox.lsts, \
Messaging%20-%20Main.lsts, \
Messaging%20-%20Messages%20Interface.lsts, \
Messaging%20-%20Messages.lsts, \
Messaging%20-%20Receiver.lsts, \
Messaging%20-%20Sender.lsts, \
Messaging%20-%20Startup.lsts
Frank: Telephony%20-%20Call%20Ender.lsts, \
Telephony%20-%20Call%20Receiver.lsts, \
Telephony%20-%20Call.lsts, \
Telephony%20-%20Caller.lsts, \
Telephony%20-%20Dialer.lsts
[data: names[]]
datatables: Frank.td, Emulator.td, Text%20Messages.td, \
Multimedia%20Messages.td, \
Message%20Constants.td, \
Telephony%20Constants.td
localizationtables: Emulator21.csv, N95.csv
Next execute **tema.generatetestconf** ::
$ mkdir NG_Models
$ cd NG_Models
$ unzip ../NG_Models.zip
$ cd ..
$ tema.generatetestconf NG_Models \
testconfiguration.conf \
runnable_model
To build a model, go to the model directory *runnable_model* and run command
**tema.composemodel**. ::
$ cd runnable_model
$ tema.composemodel
This results in *combined-rules.ext* file. The file contains the necessary low
level information on the model components and their synchronisation in their
interleaved execution (the parallel composition rules). The model behaviour is
calculated on-the-fly during the test run based on this file.
Individual target models in configured model can also be composed.::
$ cd runnable_model/Emulator
$ tema.composemodel
This results in *rules.ext* file. Composing single target model can be useful
for example for model validation purposes.
Easier alternative is to use command **tema.runmodelpackage**. Runmodelpackage
automates previous steps and makes it easier to use models. Following command
::
$ tema.runmodelpackage NG_Models.zip \
--devices="Frank Emulator" \
--applications="Frank:Telephony;Emulator:Messaging" \
--targetdir=runnable_model \
--norun
creates runnable target in directory **runnable_model** with devices
*Frank* and *Emulator* but does not start testengine.
Validating a model
++++++++++++++++++
You can simulate the execution of the test model step-by-step with
command ::
$ tema.simulate combined-rules.ext
or use an advanced simulator with a GUI with command ::
$ tema.xsimulate combined-rules.ext
Testengine and *guiguidance* can be used to graphically execute models. It is
possible to execute them on real SUT ::
$ tema.testengine --model:parallellstsmodel:combined-rules.ext \
--guidance=guiguidance ...
or on graphically simulated SUT with *guiadapter* ::
$ tema.testengine --model:parallellstsmodel:combined-rules.ext \
--guidance=guiguidance \
--adapter=guiadapter ...
or on simulated SUT with *testadapter* ::
$ tema.testengine --model:parallellstsmodel:combined-rules.ext \
--guidance=guiguidance --adapter=testadapter \
--adapter-args=model:combined-rules.ext \
--testdata=nodata ...
Model components can be validated with command **tema.validate**. For example::
$ tema.validate VoiceRecorder.lsts
Test models can be analysed with command **tema.analysator**. That gives some
estimations about size of test models. Because analysing test models takes long
time, it is best to analyse single application at a time. Multiple test models
can be combined together in analysator and estimation of their size is given.
For example::
$ tema.runmodelpackage NG_Models.zip --devices=Emulator \
--applications=Emulator:Messaging \
--targetdir=MessagingOnly \
--norun
$ cd MessagingOnly/Emulator
$ tema.composemodel
$ cd ../..
$
$ tema.runmodelpackage NG_Models.zip --devices=Emulator \
--applications=Emulator:Contacts2 \
--targetdir=Contacts2Only \
--norun
$ cd Contacts2Only/Emulator
$ tema.composemodel
$ cd ../..
$
$ tema.analysator multi MessagingOnly/Emulator/rules.ext \
Contacts2Only/Emulator/rules.ext
creates two test configurations *MessagingOnly* and *Contacts2Only* with one
target named *Emulator*. Models are then composed and after that analysator is
executed to estimate total size of test model that contains both *Contacts2*
and *Messaging* application.
Simulate, xsimulate and validate can be used directly with any
*lsts* (action machine or refinement machine), *mdm* or *ext* (parallel
composition rules) file.
To list the action words and keywords appearing in the model, run command ::
$ tema.actionlist rules.ext
Converting Models
+++++++++++++++++
There are few converters included in package that can be used to convert models
between various formats.
- *tema.mdm2svg* can be used to convert MDM-models to svg graphics
- *tema.model2dot* can be used to convert any TEMA-model to graphviz
( http://www.graphviz.org/ ) format. For example to convert LSTS-model to
colored svg, following commands might be used::
$ tema.model2dot Messaging%20-%20Create%20SMS.lsts --colored | \
dot -Tsvg -o Messaging%20-%20Create%20SMS.svg
Model2dot can also be used to convert small test models. In example test
model with one application is converted to svg image. Different layout
algorithm from graphviz is used, because test model has much more states and
transitions than single model components. ::
$ tema.model2dot --colored --compact --no-actions \
--no-stateprops rules.ext \
| sfdp -Tsvg -o rules.svg
- *tema.model2lsts* can be used to convert any TEMA-model to LSTS.
- *tema.ats4appmodel2lsts* can be used to convert ATS4AppModel-models
( http://ats4appmodel.sourceforge.net/ ) to LSTS-models.
Some problems with different character encodings might be encountered during
model conversion. **iconv** can be used to convert between different character
encodings in Unix. ::
$ .. | iconv --from-code iso-8859-1 --to-code utf-8 | ..
:raw-latex:`\newpage`
Test execution
==============
Test Engine
+++++++++++
You can execute the test engine with **tema.testengine**. For example::
$ tema.testengine \
--model=parallellstsmodel:rules.ext \
--coveragereq="actions .*fullscreen.*" \
--initmodels="lstsmodel:boot.lsts,parallellstsmodel:initrules.ext" \
--testdata='file:calendardata.td,file:gallerydata.td' \
--guidance=gameguidance \
--guidance-args="lookahead:15,randomseed:42" \
--adapter=socketserveradapter \
--adapter-args="port:9090" \
--actionpp=localspp \
--actionpp-args='file:phones.csv,lang:en' \
--logger=fdlogger \
--logger-args='targetfd:stdout,exclude:ParallelLstsModel' \
--stop-after=1h30m55s
The --model and --coveragereq arguments are obligatory, other arguments have
some default values. Model argument specifies which test model should be used.
Coverage requirement sets the stopping condition for the test run, that is,
when the test has passed. In more detail, the arguments are:
--model (obligatory)
--------------------
The test execution tool can run tests based on
* a single LSTS file (for example, an LSTS drawn with TVT LSTS Editor)
* a single MDM file (ModelDesigner Model)
* TVT parallel composition extended rules file (**rules.ext** that is generated
when tema.composemodel is run in a model directory )
* a test log
if an LSTS file contains the model, use::
--model=lstsmodel:name-of-lsts-file
if an MDM file contains the model, use::
--model=mdmmodel:name-of-mdm-file
If the model is described in a parallel composition rules file, use::
--model=parallellstsmodel:name-of-rules-file
If you want to execute exactly the same keywords as in an earlier test run,
use::
--model=tracelogmodel:name-of-log-file
When using **tracelogmodel**, you must have "Adapter:" rows in the log. Do not
exclude adapter module from the logger if you want to be able to repeat the
test this way.
--coverage and --coveragereq (obligatory)
-----------------------------------------
::
--coverage=clparser \
--coveragereq="req1 and|or|then req2..."
There are five coverage module implementations in the TEMA package:
*altercoverage*, *clparser*, *findnewcoverage*, *trace_cov* and
*dummycoverage*. The arguments of different modules vary. To list the valid
arguments of the module, try *--coveragereq-args=help*.
* *dummycoverage* gives always zero percentage for coverage. This can be used
for test runs that should run without stopping condition.
* *trace_cov* can be used with action sequences that are generated with
tema.sequencer from test log.
* *findnewcoverage* tries to find new things in the model.
* *altercoverage* tries to maximise switches between applications.
* *clparser* implements coverage language.
If you want to cover every high level action (action word) that
appears in the model, use::
--coveragereq="actions end_aw.*"
If you want to test viewing an image in full screen mode and after
that zooming in and out, use::
--coveragereq="action .*awFullScreen then (action .*awZoomIn and action
.*awZoomOut)"
To find out which actions appear in the test model, run ::
tema.actionlist rules.ext
in the model directory.
Coverage language is described in more detail in Section Coverage language.
--initmodels
------------
::
--initmodels=modeltype1:modelfile1,modeltype2:modelfile2,...
The purpose of initialization models is to drive the SUT to a state that is
assumed in the test model. This may require booting the SUT, creating or
deleting some files in the SUT, and changing settings of applications in the
SUT, for instance.
Initialization models are models that end up to a deadlock, that is, a state
which is not the source state of any transition. When a deadlock state is
reached, the initialization with that model has been ended. Initialization
models are executed one by one in the order they are listed. Model type can be
any of supported model types, for example, *lstsmodel*, *parallellstsmodel*,
*mdmmodel* or *tracelogmodel*. When all initialization models have been
successfully executed, the main test starts. An error detected in the
initialization prevents also starting the main test.
--guidance and --guidance-args
------------------------------
::
--guidance=guidance-module
--guidance-args=arg1:val1,arg2:val2,...
There are nine guidance module implementations in the TEMA package:
*gameguidance*, *gameguidance-t*, *greedyguidance*, *randomguidance*,
*guiguidance*, *tabuguidance*, *sharedtabuguidance* , *weightguidance* and
*oneafteranotherguidance*. The arguments of different modules vary. To list
the valid arguments of the module, try *--guidance-args=help*.
* *randomguidance* chooses randomly (parameter *randomseed*)
one of the transitions leaving the current state.
* *gameguidance* calculates every path of the required length (parameter
*lookahead*) beginning from the current state. It chooses randomly
(parameter *randomseed*) one of the paths which give the greatest increase
in the coverage with the smallest number of steps. The calculated paths are
then used in at least next *rerouteafter* (parameter) steps.
* *gameguidance-t* calculates in background (in another thread) paths
beginning from the current state. The maximum length of the paths is limited
by parameter *maxdepth*. Next transition is chosen randomly (parameter
*randomseed*) among the paths which give the greatest increase in the
coverage. This algorithm uses efficiently the waiting time caused by a slow
SUT or test interface.
* *greedyguidance* is a breadth first searching algorithm that returns the
shortest path improving coverage. If one of the search limits is reached, a
random path is selected. There are two possible limiting parameters:
*max_states* gives the upper bound to the number of states expanded in a
single search, and *max_second* limits the time a single search can
last. (Greedy guidance is known as *wormguidance* in some
context.)
* *guiguidance* is a manual guidance. Path is manually selected through
graphical user interface. *Guiadapter* can be used with *guiguidance* to
fully simulate execution graphically.
* *tabuguidance* tries to find actions/states/transitions that are not in a
tabulist.
* *sharedtabuguidance* is a guidance that shares a tabulist between processes
* *weightguidance*
* *oneafteranotherguidance* is a special guidance that executes multiple
guidances.
--adapter and --adapter-args
----------------------------
::
--adapter=adapter-module
--adapter-args=arg1:val1,arg2:val2,...
There are four adapter module implementations in the TEMA package:
*socketserveradapter*, *multiplexingsocketserveradapter*, *testadapter* and
*guiadapter*. The arguments of different modules vary. To list the valid
arguments of the module, try *--adapter-args=help*.
* *Socketserveradapter* forwards keywords to and receives the results of their
execution from a TCP/IP port.
The most important argument is *port*, which is used for specifying which
TCP/IP port the adapter listens to (the default port is 9090). To listen to
TCP/IP connections in port 3333, use arguments::
--adapter-args=port:3333
Details of the communication is described in Socket Server Adapter
Communication Protocol *socketserveradapter.pdf*
* *multiplexingsocketserveradapter* is a multiplexing version of
socketserveradapter. Multiplexingsocketserveradapter allows more than one
client adapters to connect to TCP/IP port.
The most important argument is *clients*, which is used for specifying
how many clients will be used. To connect with two clients in port 9090, use
arguments::
--adapter-args=clients:2,port:9090
* *Testadapter* can be used to simulate SUT. Most important argument for
testadapter is *model*. Model specifies which test model we are
testing. Second import argument is delay, which specifies how many seconds
adapter waits between keyword executions.
::
--adapter-args=model:rules.ext,delay:0.5
* *Guiadapter* can be used in conjunction with *guiguidance* to interactively
execute model.
--logger and --logger-args
--------------------------
::
--logger=logger-module
--logger-args=arg1:val1,arg2:val2,...
There are two logger module implementations in the TEMA package: *fdlogger* and
*nologger*. To see valid arguments, run *--logger-args=help*.
* *fdlogger* has following valid arguments:
- *targetfile:name-of-log-file* writes log entries to the given file.
- *targetgzipfile:name-of-log-file* writes log entries to the given gzip
compressed file.
- *targetfd:stdout|stderr|number-of-file-descriptor* writes log entries to
the specified file descriptor.
- *exclude:module* ignores log entries from the given module. Module names
appear in the test log in the second column (right after the time).
* *nologger* can be used to disable all logging.
Log entries can be written to several targets. For example, you can save the
test log to file testlog1.txt and also display it (print it to the standard
output) with arguments::
--logger-args=targetfd:stdout,targetfile:testlog1.txt
--testdata
----------
::
--testdata='file:data1.td,file:data2.td'
Testengine supports testdata. Testdata are in files which can be given to
testengine with *file* parameter. Testdata can be disabled with parameter
*nodata*.
--actionpp and --actionpp-args
------------------------------
::
--actionpp=action-postprocessor
--actionpp-args=arg1:val1,arg2:val2,...
Keywords are sent to the test adapter through "action postprocessors".
Tema package contains one action postprocessor: localisation
postprocessor *localspp*. You can give it localisation tables
in CSV format with *file* argument and specify the default language with
*lang* argument. For example::
--actionpp=localspp \
--actionpp-args='file:widgets.csv,file:apps.csv,lang:fi'
*Localspp* also supports device specific localisation. In device specific
localisation each localisation table is bound to one device. For example::
--actionpp=localspp \
--actionpp-args='file:Device.td:widgets.csv,lang:Device1.td:fi, \
file:Device2.td:apps.csv,lang:Device2.td:en'
--stop-after
------------
::
--stop-after=duration
--stop-after=1h30m5s
Stop after arguments sets the maximum length of the test run. It can
be given as hours, minutes, seconds, or a combination of them where
the largest time units are given before the smaller ones. All numbers
must be integers.
--verify-states
---------------
::
--verify-states=1
All encountered state verifications can be executed with parameter value
*1*. Default value is *0* which means no special treatment to state
verifications.
Repeating a test run
++++++++++++++++++++
There are three ways to repeat a test run.
Deterministic guidance algorithms
---------------------------------
Test runs guided by *gameguidance* and *randomguidance*
can be easily repeated by using the same the random seed (parameter
*randomseed*) in the test runs, assuming that the SUT works
deterministically.
If the SUT behaves differently from the previous test run, the new
test run may end up executing a trace that is very different from the
previous one.
Note, that repeating a test run guided by *gameguidance-t* is
more difficult, because if the delays and the processor load are not
exactly the same, the search depth may vary. This implies variation in
the chosen transitions too.
Coverage requirement based on executed actions
----------------------------------------------
Form a new coverage requirement by connecting the chosen actions in
the test log with "then" operator. Use *gameguidance* as a
guidance algorithm.
This is the most robust way to try to execute the same (or not too
different) trace as in the previous test run. Even if SUT behaves
differently, the test guidance tries to guide the run to very similar
trace as quickly as possible.
Sequence of executed action words ( and keywords ) can be created with
*tema.sequencer*::
$ tema.sequencer --aw-only < testlog.log > testlog.sequence
$ tema.testengine --coverage=trace_cov --coveragereq= \
--coveragereq-args=file:testlog.sequence ...
Test log is a model
-------------------
With *tracelogmodel* you can execute exactly the same keywords as in the
previous test run. The test log of the previous run is used as a model in the
new run.
If the SUT behaves differently, the test run stops immediately. ::
$ tema.testengine --model=tracelogmodel:testlog.log
Log Analysation
+++++++++++++++
After test, *tema.log2srt*, *tema.logreader*, *tema.plotter* and
*tema.sequencer* can be used to analyse test logs.
- tema.log2srt generates subtitle file from TEMA test log. First parameter
*delay* tells delay between test video and test log. Second parameter
*clock skew* tells clock skew between computer that recorded video and
computer that executed TEMA testengine. Clock skew can be removed by using
Network Time Protocol (NTP) on both computers.
- tema.logreader prints general information about TEMA test log. It is also
possible extract information in either **gnuplot** or csv-format.
- tema.plotter selects information to display with gnuplot from
*tema.logreader --gnuplot* output format. For example ::
$ tema logreader testlog.log --gnuplot --datarate=10.0s | \
tema plotter -x s -y kw --term='svg' | gnuplot > keywordsPerSec.svg
creates svg-picture with information about keyword execution compared with
time.
- tema.sequencer generates action sequences from TEMA test log. Action sequence
can be given to TEMA test engine as parameter
Coverage language
+++++++++++++++++
Syntax of the language is the following::
cov-req ::= elem-req | cov-req ("and" | "or" | "then") cov-req
elem-req ::= ("action" | "actions") regexp
where *regexp* is an regular expression matching names of actions in the test
model. Parenthesis can be used around coverage requirements.
In elementary requirements (*elem-req*) with *action* you express that you
want to cover at least one of the actions matching the regular expression.
With *actions* you require that every action matching the regular expression
should be covered.