source: trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/RequiredInefficientActionsRuleTest.java

Last change on this file was 2169, checked in by pharms, 7 years ago
  • changes for first VR oriented usability evaluation
File size: 17.1 KB
RevLine 
[1335]1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.usability;
16
[1918]17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.INEFFICIENT_ACTIONS;
[1335]18
[1493]19import org.junit.Before;
[1335]20import org.junit.Test;
21
[1918]22import de.ugoe.cs.autoquest.usability.UsabilitySmell;
[1335]23
24/**
25 *
26 */
[1493]27public class RequiredInefficientActionsRuleTest extends AbstractUsabilityEvaluationTC {
[1335]28
29    /**
30     *
31     */
[1493]32    @Before
33    public void setUp() {
[1918]34        //UsabilitySmellIntensity.defaultCoverageQuantile = 0;
[1493]35    }
36   
37    /**
38     *
39     */
[1335]40    @Test
41    public void testWithNormalScroll_01() {
[1493]42        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]43
44        // ===== check =====
45        String spec =
46            "UserSession {" +
47            "  Scroll body {}" +
48            "  Interaction elem1 {}" +
49            "}";
50       
[1918]51        // no smell expected, as interactions do not form tasks
52        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  };
[1335]53
[1918]54        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]55
56    }
57
58    /**
59     *
60     */
61    @Test
62    public void testWithNormalScroll_02() {
[1493]63        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]64
65        // ===== check =====
66        String spec =
67            "UserSession {" +
68            "  Scroll body {}" +
69            "  Interaction elem1 {}" +
70            "  Scroll body {}" +
71            "  Interaction elem1 {}" +
72            "}";
73       
[1918]74        // no smell expected, as interactions do not form tasks
75        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { };
[1335]76
[1918]77        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]78
79    }
80
81    /**
82     *
83     */
84    @Test
85    public void testWithNormalScroll_03() {
[1493]86        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]87
88        // ===== check =====
89        String spec =
90            "UserSession {" +
91            "  Sequence {" +
[2169]92            "    Interaction elem1 {}" +
[1335]93            "    Scroll body {}" +
94            "    Interaction elem1 {}" +
95            "  }" +
96            "}";
97       
[1918]98        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
99            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
100                                  INEFFICIENT_ACTIONS) };
[1335]101
[1918]102        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]103
104    }
105
106    /**
107     *
108     */
109    @Test
110    public void testWithNormalScroll_04() {
[1493]111        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]112
113        // ===== check =====
114        String spec =
115            "UserSession {" +
[1493]116            "  Sequence {" +
117            "    Interaction elem1 {}" +
[2169]118            "    Interaction elem2 {}" +
[1493]119            "    Scroll body {}" +
120            "  }" +
121            "}";
122       
[1918]123        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
124            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
125                                  INEFFICIENT_ACTIONS) };
[1493]126
[1918]127        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1493]128
129    }
130
131    /**
132     *
133     */
134    @Test
135    public void testWithNormalScroll_05() {
136        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
137
138        // ===== check =====
139        String spec =
140            "UserSession {" +
[1335]141            "  Sequence seq1 {" +
142            "    Scroll body {}" +
143            "    Interaction elem1 {}" +
[2169]144            "    Interaction elem2 {}" +
[1335]145            "  }" +
146            "  Sequence seq1 {" +
147            "    Scroll body {}" +
148            "    Interaction elem1 {}" +
[2169]149            "    Interaction elem2 {}" +
[1335]150            "  }" +
151            "}";
152       
[1918]153        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
154            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
155                                  INEFFICIENT_ACTIONS) };
[1335]156
[1918]157        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]158
159    }
160
161    /**
162     *
163     */
164    @Test
[1493]165    public void testWithNormalScroll_06() {
166        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]167
168        // ===== check =====
169        String spec =
170            "UserSession {" +
171            "  Sequence seq1 {" +
172            "    Interaction elem1 {}" +
[1493]173            "    Scroll body {}" +
[2169]174            "    Interaction elem2 {}" +
[1493]175            "  }" +
176            "  Sequence seq1 {" +
[1335]177            "    Interaction elem1 {}" +
[1493]178            "    Scroll body {}" +
[2169]179            "    Interaction elem2 {}" +
[1493]180            "  }" +
181            "}";
182       
[1918]183        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
184            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
185                                  INEFFICIENT_ACTIONS) };
[1493]186
[1918]187        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1493]188
189    }
190
191    /**
192     *
193     */
194    @Test
195    public void testScrollSeldomRequired_01() {
196        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
197
198        // ===== check =====
199        String spec =
200            "UserSession {" +
201            "  Sequence seq1 {" +
[1335]202            "    Interaction elem1 {}" +
[1493]203            "    Interaction elem1 {}" +
204            "    Interaction elem1 {}" +
[1335]205            "    Scroll body {}" +
206            "    Interaction elem1 {}" +
207            "  }" +
208            "}";
209       
[1918]210        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
211            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
212                                  INEFFICIENT_ACTIONS) };
[1335]213
[1918]214        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]215
216    }
217
218    /**
219     *
220     */
221    @Test
[1493]222    public void testScrollSeldomRequired_02() {
223        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]224
225        // ===== check =====
226        String spec =
227            "UserSession {" +
228            "  Sequence seq1 {" +
229            "    Optional opt1 { }" +
230            "    Interaction elem1 {}" +
[2169]231            "    Interaction elem2 {}" +
[1335]232            "  }" +
233            "  Sequence seq1 {" +
234            "    Optional opt1 {" +
235            "      Scroll body {}" +
236            "    }" +
237            "    Interaction elem1 {}" +
[2169]238            "    Interaction elem2 {}" +
[1335]239            "  }" +
240            "  Sequence seq1 {" +
241            "    Optional opt1 {" +
242            "      Scroll body {}" +
243            "    }" +
244            "    Interaction elem1 {}" +
[2169]245            "    Interaction elem2 {}" +
[1335]246            "  }" +
247            "}";
248       
[1918]249        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
250            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
251                                  INEFFICIENT_ACTIONS) };
[1335]252
[1918]253        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]254
255    }
256
257    /**
258     *
259     */
260    @Test
[1493]261    public void testScrollSeldomRequired_03() {
262        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]263
264        // ===== check =====
265        String spec =
266            "UserSession {" +
267            "  Sequence seq1 {" +
[1493]268            "    Interaction elem1 {}" +
[2169]269            "    Interaction elem2 {}" +
[1335]270            "    Optional opt1 { }" +
[1493]271            "  }" +
272            "  Sequence seq1 {" +
[1335]273            "    Interaction elem1 {}" +
[2169]274            "    Interaction elem2 {}" +
[1493]275            "    Optional opt1 {" +
276            "      Scroll body {}" +
277            "    }" +
[1335]278            "  }" +
279            "  Sequence seq1 {" +
[1493]280            "    Interaction elem1 {}" +
[2169]281            "    Interaction elem2 {}" +
[1493]282            "    Optional opt1 {" +
283            "      Scroll body {}" +
284            "    }" +
285            "  }" +
286            "}";
287       
[1918]288        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
289            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
290                                  INEFFICIENT_ACTIONS) };
[1493]291
[1918]292        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1493]293
294    }
295
296    /**
297     *
298     */
299    @Test
300    public void testScrollSeldomRequired_04() {
301        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
302
303        // ===== check =====
304        String spec =
305            "UserSession {" +
306            "  Sequence seq1 {" +
[2169]307            "    Interaction elem2 {}" +
[1493]308            "    Optional opt1 { }" +
309            "    Interaction elem1 {}" +
310            "  }" +
311            "  Sequence seq1 {" +
[2169]312            "    Interaction elem2 {}" +
[1335]313            "    Optional opt1 {}" +
314            "    Interaction elem1 {}" +
315            "  }" +
316            "  Sequence seq1 {" +
[2169]317            "    Interaction elem2 {}" +
[1335]318            "    Optional opt1 {" +
319            "      Scroll body {}" +
320            "    }" +
321            "    Interaction elem1 {}" +
322            "  }" +
323            "  Sequence seq1 {" +
[2169]324            "    Interaction elem2 {}" +
[1335]325            "    Optional opt1 {" +
326            "      Scroll body {}" +
327            "    }" +
328            "    Interaction elem1 {}" +
329            "  }" +
330            "}";
331       
[1918]332        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
333           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
334                                  INEFFICIENT_ACTIONS) };
[1335]335
[1918]336        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]337
338    }
339
340    /**
341     *
342     */
343    @Test
[1493]344    public void testScrollSeldomRequired_05() {
345        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]346
347        // ===== check =====
348        String spec =
349            "UserSession {" +
350            "  Sequence seq1 {" +
[1493]351            "    Interaction elem1 {}" +
[1335]352            "    Optional opt1 { }" +
[2169]353            "    Interaction elem2 {}" +
[1493]354            "  }" +
355            "  Sequence seq1 {" +
[1335]356            "    Interaction elem1 {}" +
[1493]357            "    Optional opt1 {}" +
[2169]358            "    Interaction elem2 {}" +
[1335]359            "  }" +
360            "  Sequence seq1 {" +
[1493]361            "    Interaction elem1 {}" +
362            "    Optional opt1 {" +
363            "      Scroll body {}" +
364            "    }" +
[2169]365            "    Interaction elem2 {}" +
[1493]366            "  }" +
367            "  Sequence seq1 {" +
368            "    Interaction elem1 {}" +
369            "    Optional opt1 {" +
370            "      Scroll body {}" +
371            "    }" +
[2169]372            "    Interaction elem2 {}" +
[1493]373            "  }" +
374            "}";
375       
[1918]376        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
377           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
378                                  INEFFICIENT_ACTIONS) };
[1493]379
[1918]380        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1493]381
382    }
383
384    /**
385     *
386     */
387    @Test
388    public void testScrollSeldomRequired_06() {
389        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
390
391        // ===== check =====
392        String spec =
393            "UserSession {" +
394            "  Sequence seq1 {" +
[1335]395            "    Optional opt1 { }" +
396            "    Interaction elem1 {}" +
[2169]397            "    Interaction elem2 {}" +
398           "  }" +
[1335]399            "  Sequence seq1 {" +
400            "    Optional opt1 { }" +
401            "    Interaction elem1 {}" +
[2169]402            "    Interaction elem2 {}" +
[1335]403            "  }" +
404            "  Sequence seq1 {" +
[1493]405            "    Optional opt1 { }" +
406            "    Interaction elem1 {}" +
[2169]407            "    Interaction elem2 {}" +
[1493]408            "  }" +
409            "  Sequence seq1 {" +
[1335]410            "    Optional opt1 {" +
411            "      Scroll body {}" +
412            "    }" +
413            "    Interaction elem1 {}" +
[2169]414            "    Interaction elem2 {}" +
[1335]415            "  }" +
416            "}";
417       
[1918]418        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
419            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
420                                  INEFFICIENT_ACTIONS) };
[1335]421
[1918]422        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]423
424    }
425
426    /**
427     *
428     */
429    @Test
[1493]430    public void testScrollSeldomRequired_07() {
431        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
[1335]432
433        // ===== check =====
434        String spec =
435            "UserSession {" +
436            "  Sequence seq1 {" +
[1493]437            "    Interaction elem1 {}" +
[1335]438            "    Optional opt1 { }" +
[2169]439            "    Interaction elem2 {}" +
[1493]440            "  }" +
441            "  Sequence seq1 {" +
[1335]442            "    Interaction elem1 {}" +
[1493]443            "    Optional opt1 { }" +
[2169]444            "    Interaction elem2 {}" +
[1335]445            "  }" +
446            "  Sequence seq1 {" +
[1493]447            "    Interaction elem1 {}" +
[1335]448            "    Optional opt1 { }" +
[2169]449            "    Interaction elem2 {}" +
[1493]450            "  }" +
451            "  Sequence seq1 {" +
[1335]452            "    Interaction elem1 {}" +
[1493]453            "    Optional opt1 {" +
454            "      Scroll body {}" +
455            "    }" +
[2169]456            "    Interaction elem2 {}" +
[1335]457            "  }" +
[1493]458            "}";
459       
[1918]460        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
461            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
462                                  INEFFICIENT_ACTIONS) };
[1493]463
[1918]464        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1493]465
466    }
467
468    /**
469     *
470     */
471    @Test
472    public void testScrollSeldomRequired_08() {
473        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
474
475        // ===== check =====
476        String spec =
477            "UserSession {" +
[1335]478            "  Sequence seq1 {" +
479            "    Optional opt1 { }" +
480            "    Interaction elem1 {}" +
481            "  }" +
482            "  Sequence seq1 {" +
[1493]483            "    Optional opt1 { }" +
484            "    Interaction elem1 {}" +
485            "  }" +
486            "  Sequence seq1 {" +
487            "    Optional opt1 { }" +
488            "    Interaction elem1 {}" +
489            "  }" +
490            "  Sequence seq1 {" +
[1335]491            "    Optional opt1 {" +
492            "      Scroll body {}" +
493            "    }" +
494            "    Interaction elem1 {}" +
495            "  }" +
496            "  Sequence seq1 {" +
497            "    Optional opt1 { }" +
498            "    Interaction elem1 {}" +
499            "  }" +
500            "  Sequence seq1 {" +
501            "    Optional opt1 { }" +
502            "    Interaction elem1 {}" +
503            "  }" +
504            "  Sequence seq1 {" +
505            "    Optional opt1 { }" +
506            "    Interaction elem1 {}" +
507            "  }" +
508            "  Sequence seq1 {" +
509            "    Optional opt1 { }" +
510            "    Interaction elem1 {}" +
511            "  }" +
512            "}";
513       
[1918]514        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { };
[1335]515
[2169]516        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1335]517
518    }
[1493]519
520    /**
521     *
522     */
523    @Test
524    public void testScrollSeldomRequired_09() {
525        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
526
527        // ===== check =====
528        String spec =
529            "UserSession {" +
530            "  Sequence seq1 {" +
531            "    Interaction elem1 {}" +
532            "    Optional opt1 { }" +
533            "  }" +
534            "  Sequence seq1 {" +
535            "    Interaction elem1 {}" +
536            "    Optional opt1 { }" +
537            "  }" +
538            "  Sequence seq1 {" +
539            "    Interaction elem1 {}" +
540            "    Optional opt1 { }" +
541            "  }" +
542            "  Sequence seq1 {" +
543            "    Interaction elem1 {}" +
544            "    Optional opt1 {" +
545            "      Scroll body {}" +
546            "    }" +
547            "  }" +
548            "  Sequence seq1 {" +
549            "    Interaction elem1 {}" +
550            "    Optional opt1 { }" +
551            "  }" +
552            "  Sequence seq1 {" +
553            "    Interaction elem1 {}" +
554            "    Optional opt1 { }" +
555            "  }" +
556            "  Sequence seq1 {" +
557            "    Interaction elem1 {}" +
558            "    Optional opt1 { }" +
559            "  }" +
560            "  Sequence seq1 {" +
561            "    Interaction elem1 {}" +
562            "    Optional opt1 { }" +
563            "  }" +
564            "}";
565       
[1918]566        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { };
[1493]567
[2169]568        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
[1493]569
570    }
[1335]571}
Note: See TracBrowser for help on using the repository browser.