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

Last change on this file since 2169 was 2169, checked in by pharms, 7 years ago
  • changes for first VR oriented usability evaluation
File size: 17.1 KB
Line 
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
17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.INEFFICIENT_ACTIONS;
18
19import org.junit.Before;
20import org.junit.Test;
21
22import de.ugoe.cs.autoquest.usability.UsabilitySmell;
23
24/**
25 *
26 */
27public class RequiredInefficientActionsRuleTest extends AbstractUsabilityEvaluationTC {
28
29    /**
30     *
31     */
32    @Before
33    public void setUp() {
34        //UsabilitySmellIntensity.defaultCoverageQuantile = 0;
35    }
36   
37    /**
38     *
39     */
40    @Test
41    public void testWithNormalScroll_01() {
42        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
43
44        // ===== check =====
45        String spec =
46            "UserSession {" +
47            "  Scroll body {}" +
48            "  Interaction elem1 {}" +
49            "}";
50       
51        // no smell expected, as interactions do not form tasks
52        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  };
53
54        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
55
56    }
57
58    /**
59     *
60     */
61    @Test
62    public void testWithNormalScroll_02() {
63        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
64
65        // ===== check =====
66        String spec =
67            "UserSession {" +
68            "  Scroll body {}" +
69            "  Interaction elem1 {}" +
70            "  Scroll body {}" +
71            "  Interaction elem1 {}" +
72            "}";
73       
74        // no smell expected, as interactions do not form tasks
75        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { };
76
77        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
78
79    }
80
81    /**
82     *
83     */
84    @Test
85    public void testWithNormalScroll_03() {
86        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
87
88        // ===== check =====
89        String spec =
90            "UserSession {" +
91            "  Sequence {" +
92            "    Interaction elem1 {}" +
93            "    Scroll body {}" +
94            "    Interaction elem1 {}" +
95            "  }" +
96            "}";
97       
98        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
99            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
100                                  INEFFICIENT_ACTIONS) };
101
102        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
103
104    }
105
106    /**
107     *
108     */
109    @Test
110    public void testWithNormalScroll_04() {
111        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
112
113        // ===== check =====
114        String spec =
115            "UserSession {" +
116            "  Sequence {" +
117            "    Interaction elem1 {}" +
118            "    Interaction elem2 {}" +
119            "    Scroll body {}" +
120            "  }" +
121            "}";
122       
123        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
124            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
125                                  INEFFICIENT_ACTIONS) };
126
127        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
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 {" +
141            "  Sequence seq1 {" +
142            "    Scroll body {}" +
143            "    Interaction elem1 {}" +
144            "    Interaction elem2 {}" +
145            "  }" +
146            "  Sequence seq1 {" +
147            "    Scroll body {}" +
148            "    Interaction elem1 {}" +
149            "    Interaction elem2 {}" +
150            "  }" +
151            "}";
152       
153        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
154            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
155                                  INEFFICIENT_ACTIONS) };
156
157        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
158
159    }
160
161    /**
162     *
163     */
164    @Test
165    public void testWithNormalScroll_06() {
166        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
167
168        // ===== check =====
169        String spec =
170            "UserSession {" +
171            "  Sequence seq1 {" +
172            "    Interaction elem1 {}" +
173            "    Scroll body {}" +
174            "    Interaction elem2 {}" +
175            "  }" +
176            "  Sequence seq1 {" +
177            "    Interaction elem1 {}" +
178            "    Scroll body {}" +
179            "    Interaction elem2 {}" +
180            "  }" +
181            "}";
182       
183        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
184            { new UsabilitySmell(/*HIGH*/ UsabilitySmellIntensity.getIntensity(0),
185                                  INEFFICIENT_ACTIONS) };
186
187        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
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 {" +
202            "    Interaction elem1 {}" +
203            "    Interaction elem1 {}" +
204            "    Interaction elem1 {}" +
205            "    Scroll body {}" +
206            "    Interaction elem1 {}" +
207            "  }" +
208            "}";
209       
210        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
211            { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
212                                  INEFFICIENT_ACTIONS) };
213
214        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
215
216    }
217
218    /**
219     *
220     */
221    @Test
222    public void testScrollSeldomRequired_02() {
223        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
224
225        // ===== check =====
226        String spec =
227            "UserSession {" +
228            "  Sequence seq1 {" +
229            "    Optional opt1 { }" +
230            "    Interaction elem1 {}" +
231            "    Interaction elem2 {}" +
232            "  }" +
233            "  Sequence seq1 {" +
234            "    Optional opt1 {" +
235            "      Scroll body {}" +
236            "    }" +
237            "    Interaction elem1 {}" +
238            "    Interaction elem2 {}" +
239            "  }" +
240            "  Sequence seq1 {" +
241            "    Optional opt1 {" +
242            "      Scroll body {}" +
243            "    }" +
244            "    Interaction elem1 {}" +
245            "    Interaction elem2 {}" +
246            "  }" +
247            "}";
248       
249        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
250            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
251                                  INEFFICIENT_ACTIONS) };
252
253        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
254
255    }
256
257    /**
258     *
259     */
260    @Test
261    public void testScrollSeldomRequired_03() {
262        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
263
264        // ===== check =====
265        String spec =
266            "UserSession {" +
267            "  Sequence seq1 {" +
268            "    Interaction elem1 {}" +
269            "    Interaction elem2 {}" +
270            "    Optional opt1 { }" +
271            "  }" +
272            "  Sequence seq1 {" +
273            "    Interaction elem1 {}" +
274            "    Interaction elem2 {}" +
275            "    Optional opt1 {" +
276            "      Scroll body {}" +
277            "    }" +
278            "  }" +
279            "  Sequence seq1 {" +
280            "    Interaction elem1 {}" +
281            "    Interaction elem2 {}" +
282            "    Optional opt1 {" +
283            "      Scroll body {}" +
284            "    }" +
285            "  }" +
286            "}";
287       
288        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
289            { new UsabilitySmell(/*MEDIUM*/ UsabilitySmellIntensity.getIntensity(0),
290                                  INEFFICIENT_ACTIONS) };
291
292        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
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 {" +
307            "    Interaction elem2 {}" +
308            "    Optional opt1 { }" +
309            "    Interaction elem1 {}" +
310            "  }" +
311            "  Sequence seq1 {" +
312            "    Interaction elem2 {}" +
313            "    Optional opt1 {}" +
314            "    Interaction elem1 {}" +
315            "  }" +
316            "  Sequence seq1 {" +
317            "    Interaction elem2 {}" +
318            "    Optional opt1 {" +
319            "      Scroll body {}" +
320            "    }" +
321            "    Interaction elem1 {}" +
322            "  }" +
323            "  Sequence seq1 {" +
324            "    Interaction elem2 {}" +
325            "    Optional opt1 {" +
326            "      Scroll body {}" +
327            "    }" +
328            "    Interaction elem1 {}" +
329            "  }" +
330            "}";
331       
332        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
333           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
334                                  INEFFICIENT_ACTIONS) };
335
336        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
337
338    }
339
340    /**
341     *
342     */
343    @Test
344    public void testScrollSeldomRequired_05() {
345        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
346
347        // ===== check =====
348        String spec =
349            "UserSession {" +
350            "  Sequence seq1 {" +
351            "    Interaction elem1 {}" +
352            "    Optional opt1 { }" +
353            "    Interaction elem2 {}" +
354            "  }" +
355            "  Sequence seq1 {" +
356            "    Interaction elem1 {}" +
357            "    Optional opt1 {}" +
358            "    Interaction elem2 {}" +
359            "  }" +
360            "  Sequence seq1 {" +
361            "    Interaction elem1 {}" +
362            "    Optional opt1 {" +
363            "      Scroll body {}" +
364            "    }" +
365            "    Interaction elem2 {}" +
366            "  }" +
367            "  Sequence seq1 {" +
368            "    Interaction elem1 {}" +
369            "    Optional opt1 {" +
370            "      Scroll body {}" +
371            "    }" +
372            "    Interaction elem2 {}" +
373            "  }" +
374            "}";
375       
376        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
377           { new UsabilitySmell(/*LOW*/ UsabilitySmellIntensity.getIntensity(0),
378                                  INEFFICIENT_ACTIONS) };
379
380        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
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 {" +
395            "    Optional opt1 { }" +
396            "    Interaction elem1 {}" +
397            "    Interaction elem2 {}" +
398           "  }" +
399            "  Sequence seq1 {" +
400            "    Optional opt1 { }" +
401            "    Interaction elem1 {}" +
402            "    Interaction elem2 {}" +
403            "  }" +
404            "  Sequence seq1 {" +
405            "    Optional opt1 { }" +
406            "    Interaction elem1 {}" +
407            "    Interaction elem2 {}" +
408            "  }" +
409            "  Sequence seq1 {" +
410            "    Optional opt1 {" +
411            "      Scroll body {}" +
412            "    }" +
413            "    Interaction elem1 {}" +
414            "    Interaction elem2 {}" +
415            "  }" +
416            "}";
417       
418        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
419            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
420                                  INEFFICIENT_ACTIONS) };
421
422        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
423
424    }
425
426    /**
427     *
428     */
429    @Test
430    public void testScrollSeldomRequired_07() {
431        RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule();
432
433        // ===== check =====
434        String spec =
435            "UserSession {" +
436            "  Sequence seq1 {" +
437            "    Interaction elem1 {}" +
438            "    Optional opt1 { }" +
439            "    Interaction elem2 {}" +
440            "  }" +
441            "  Sequence seq1 {" +
442            "    Interaction elem1 {}" +
443            "    Optional opt1 { }" +
444            "    Interaction elem2 {}" +
445            "  }" +
446            "  Sequence seq1 {" +
447            "    Interaction elem1 {}" +
448            "    Optional opt1 { }" +
449            "    Interaction elem2 {}" +
450            "  }" +
451            "  Sequence seq1 {" +
452            "    Interaction elem1 {}" +
453            "    Optional opt1 {" +
454            "      Scroll body {}" +
455            "    }" +
456            "    Interaction elem2 {}" +
457            "  }" +
458            "}";
459       
460        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
461            { new UsabilitySmell(/*INFO*/ UsabilitySmellIntensity.getIntensity(0),
462                                  INEFFICIENT_ACTIONS) };
463
464        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
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 {" +
478            "  Sequence seq1 {" +
479            "    Optional opt1 { }" +
480            "    Interaction elem1 {}" +
481            "  }" +
482            "  Sequence seq1 {" +
483            "    Optional opt1 { }" +
484            "    Interaction elem1 {}" +
485            "  }" +
486            "  Sequence seq1 {" +
487            "    Optional opt1 { }" +
488            "    Interaction elem1 {}" +
489            "  }" +
490            "  Sequence seq1 {" +
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       
514        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { };
515
516        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
517
518    }
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       
566        UsabilitySmell[] expectedSmells = new UsabilitySmell[] { };
567
568        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
569
570    }
571}
Note: See TracBrowser for help on using the repository browser.