Changeset 1493 for trunk/autoquest-core-usability-test/src/test/java/de
- Timestamp:
- 04/11/14 11:21:45 (11 years ago)
- Location:
- trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability
- Files:
-
- 1 added
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/RequiredInefficientActionsRuleTest.java
r1335 r1493 15 15 package de.ugoe.cs.autoquest.usability; 16 16 17 import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription. SCROLL_REQUIRED;17 import static de.ugoe.cs.autoquest.usability.UsabilityDefectDescription.INEFFICIENT_ACTIONS; 18 18 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.HIGH; 19 19 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.INFO; … … 21 21 import static de.ugoe.cs.autoquest.usability.UsabilityDefectSeverity.MEDIUM; 22 22 23 import org.junit.Before; 23 24 import org.junit.Test; 24 25 … … 28 29 * 29 30 */ 30 public class RequiredScrollRuleTest extends AbstractUsabilityEvaluationTC { 31 31 public class RequiredInefficientActionsRuleTest extends AbstractUsabilityEvaluationTC { 32 33 /** 34 * 35 */ 36 @Before 37 public void setUp() { 38 UsabilityDefectSeverity.defaultCoverageQuantile = 0; 39 } 40 32 41 /** 33 42 * … … 35 44 @Test 36 45 public void testWithNormalScroll_01() { 37 Required ScrollRule rule = new RequiredScrollRule();46 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 38 47 39 48 // ===== check ===== … … 56 65 @Test 57 66 public void testWithNormalScroll_02() { 58 Required ScrollRule rule = new RequiredScrollRule();67 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 59 68 60 69 // ===== check ===== … … 79 88 @Test 80 89 public void testWithNormalScroll_03() { 81 Required ScrollRule rule = new RequiredScrollRule();90 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 82 91 83 92 // ===== check ===== … … 91 100 92 101 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 93 { new UsabilityDefect(HIGH, SCROLL_REQUIRED) };102 { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 94 103 95 104 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); … … 102 111 @Test 103 112 public void testWithNormalScroll_04() { 104 RequiredScrollRule rule = new RequiredScrollRule(); 105 106 // ===== check ===== 107 String spec = 108 "UserSession {" + 109 " Sequence seq1 {" + 110 " Scroll body {}" + 111 " Interaction elem1 {}" + 112 " }" + 113 " Sequence seq1 {" + 114 " Scroll body {}" + 115 " Interaction elem1 {}" + 116 " }" + 117 "}"; 118 119 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 120 { new UsabilityDefect(HIGH, SCROLL_REQUIRED) }; 121 122 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 123 124 } 125 126 /** 127 * 128 */ 129 @Test 130 public void testOnlySeldomPreceededByScroll_01() { 131 RequiredScrollRule rule = new RequiredScrollRule(); 132 133 // ===== check ===== 134 String spec = 135 "UserSession {" + 136 " Sequence seq1 {" + 137 " Interaction elem1 {}" + 138 " Interaction elem1 {}" + 139 " Interaction elem1 {}" + 140 " Scroll body {}" + 113 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 114 115 // ===== check ===== 116 String spec = 117 "UserSession {" + 118 " Sequence {" + 119 " Interaction elem1 {}" + 120 " Scroll body {}" + 121 " }" + 122 "}"; 123 124 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 125 { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 126 127 assertUsabilityEvaluationResult(expectedDefects, 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 " }" + 145 " Sequence seq1 {" + 146 " Scroll body {}" + 147 " Interaction elem1 {}" + 148 " }" + 149 "}"; 150 151 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 152 { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 153 154 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 155 156 } 157 158 /** 159 * 160 */ 161 @Test 162 public void testWithNormalScroll_06() { 163 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 164 165 // ===== check ===== 166 String spec = 167 "UserSession {" + 168 " Sequence seq1 {" + 169 " Interaction elem1 {}" + 170 " Scroll body {}" + 171 " }" + 172 " Sequence seq1 {" + 173 " Interaction elem1 {}" + 174 " Scroll body {}" + 175 " }" + 176 "}"; 177 178 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 179 { new UsabilityDefect(HIGH, INEFFICIENT_ACTIONS) }; 180 181 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 182 183 } 184 185 /** 186 * 187 */ 188 @Test 189 public void testScrollSeldomRequired_01() { 190 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 191 192 // ===== check ===== 193 String spec = 194 "UserSession {" + 195 " Sequence seq1 {" + 196 " Interaction elem1 {}" + 197 " Interaction elem1 {}" + 198 " Interaction elem1 {}" + 199 " Scroll body {}" + 200 " Interaction elem1 {}" + 201 " }" + 202 "}"; 203 204 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 205 { new UsabilityDefect(LOW, INEFFICIENT_ACTIONS) }; 206 207 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 208 209 } 210 211 /** 212 * 213 */ 214 @Test 215 public void testScrollSeldomRequired_02() { 216 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 217 218 // ===== check ===== 219 String spec = 220 "UserSession {" + 221 " Sequence seq1 {" + 222 " Optional opt1 { }" + 223 " Interaction elem1 {}" + 224 " }" + 225 " Sequence seq1 {" + 226 " Optional opt1 {" + 227 " Scroll body {}" + 228 " }" + 229 " Interaction elem1 {}" + 230 " }" + 231 " Sequence seq1 {" + 232 " Optional opt1 {" + 233 " Scroll body {}" + 234 " }" + 235 " Interaction elem1 {}" + 236 " }" + 237 "}"; 238 239 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 240 { new UsabilityDefect(MEDIUM, INEFFICIENT_ACTIONS) }; 241 242 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 243 244 } 245 246 /** 247 * 248 */ 249 @Test 250 public void testScrollSeldomRequired_03() { 251 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 252 253 // ===== check ===== 254 String spec = 255 "UserSession {" + 256 " Sequence seq1 {" + 257 " Interaction elem1 {}" + 258 " Optional opt1 { }" + 259 " }" + 260 " Sequence seq1 {" + 261 " Interaction elem1 {}" + 262 " Optional opt1 {" + 263 " Scroll body {}" + 264 " }" + 265 " }" + 266 " Sequence seq1 {" + 267 " Interaction elem1 {}" + 268 " Optional opt1 {" + 269 " Scroll body {}" + 270 " }" + 271 " }" + 272 "}"; 273 274 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 275 { new UsabilityDefect(MEDIUM, INEFFICIENT_ACTIONS) }; 276 277 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 278 279 } 280 281 /** 282 * 283 */ 284 @Test 285 public void testScrollSeldomRequired_04() { 286 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 287 288 // ===== check ===== 289 String spec = 290 "UserSession {" + 291 " Sequence seq1 {" + 292 " Optional opt1 { }" + 293 " Interaction elem1 {}" + 294 " }" + 295 " Sequence seq1 {" + 296 " Optional opt1 {}" + 297 " Interaction elem1 {}" + 298 " }" + 299 " Sequence seq1 {" + 300 " Optional opt1 {" + 301 " Scroll body {}" + 302 " }" + 303 " Interaction elem1 {}" + 304 " }" + 305 " Sequence seq1 {" + 306 " Optional opt1 {" + 307 " Scroll body {}" + 308 " }" + 309 " Interaction elem1 {}" + 310 " }" + 311 "}"; 312 313 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 314 { new UsabilityDefect(LOW, INEFFICIENT_ACTIONS) }; 315 316 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 317 318 } 319 320 /** 321 * 322 */ 323 @Test 324 public void testScrollSeldomRequired_05() { 325 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 326 327 // ===== check ===== 328 String spec = 329 "UserSession {" + 330 " Sequence seq1 {" + 331 " Interaction elem1 {}" + 332 " Optional opt1 { }" + 333 " }" + 334 " Sequence seq1 {" + 335 " Interaction elem1 {}" + 336 " Optional opt1 {}" + 337 " }" + 338 " Sequence seq1 {" + 339 " Interaction elem1 {}" + 340 " Optional opt1 {" + 341 " Scroll body {}" + 342 " }" + 343 " }" + 344 " Sequence seq1 {" + 345 " Interaction elem1 {}" + 346 " Optional opt1 {" + 347 " Scroll body {}" + 348 " }" + 349 " }" + 350 "}"; 351 352 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 353 { new UsabilityDefect(LOW, INEFFICIENT_ACTIONS) }; 354 355 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 356 357 } 358 359 /** 360 * 361 */ 362 @Test 363 public void testScrollSeldomRequired_06() { 364 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 365 366 // ===== check ===== 367 String spec = 368 "UserSession {" + 369 " Sequence seq1 {" + 370 " Optional opt1 { }" + 371 " Interaction elem1 {}" + 372 " }" + 373 " Sequence seq1 {" + 374 " Optional opt1 { }" + 375 " Interaction elem1 {}" + 376 " }" + 377 " Sequence seq1 {" + 378 " Optional opt1 { }" + 379 " Interaction elem1 {}" + 380 " }" + 381 " Sequence seq1 {" + 382 " Optional opt1 {" + 383 " Scroll body {}" + 384 " }" + 385 " Interaction elem1 {}" + 386 " }" + 387 "}"; 388 389 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 390 { new UsabilityDefect(INFO, INEFFICIENT_ACTIONS) }; 391 392 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 393 394 } 395 396 /** 397 * 398 */ 399 @Test 400 public void testScrollSeldomRequired_07() { 401 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 402 403 // ===== check ===== 404 String spec = 405 "UserSession {" + 406 " Sequence seq1 {" + 407 " Interaction elem1 {}" + 408 " Optional opt1 { }" + 409 " }" + 410 " Sequence seq1 {" + 411 " Interaction elem1 {}" + 412 " Optional opt1 { }" + 413 " }" + 414 " Sequence seq1 {" + 415 " Interaction elem1 {}" + 416 " Optional opt1 { }" + 417 " }" + 418 " Sequence seq1 {" + 419 " Interaction elem1 {}" + 420 " Optional opt1 {" + 421 " Scroll body {}" + 422 " }" + 423 " }" + 424 "}"; 425 426 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 427 { new UsabilityDefect(INFO, INEFFICIENT_ACTIONS) }; 428 429 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 430 431 } 432 433 /** 434 * 435 */ 436 @Test 437 public void testScrollSeldomRequired_08() { 438 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 439 440 // ===== check ===== 441 String spec = 442 "UserSession {" + 443 " Sequence seq1 {" + 444 " Optional opt1 { }" + 445 " Interaction elem1 {}" + 446 " }" + 447 " Sequence seq1 {" + 448 " Optional opt1 { }" + 449 " Interaction elem1 {}" + 450 " }" + 451 " Sequence seq1 {" + 452 " Optional opt1 { }" + 453 " Interaction elem1 {}" + 454 " }" + 455 " Sequence seq1 {" + 456 " Optional opt1 {" + 457 " Scroll body {}" + 458 " }" + 459 " Interaction elem1 {}" + 460 " }" + 461 " Sequence seq1 {" + 462 " Optional opt1 { }" + 463 " Interaction elem1 {}" + 464 " }" + 465 " Sequence seq1 {" + 466 " Optional opt1 { }" + 467 " Interaction elem1 {}" + 468 " }" + 469 " Sequence seq1 {" + 470 " Optional opt1 { }" + 471 " Interaction elem1 {}" + 472 " }" + 473 " Sequence seq1 {" + 474 " Optional opt1 { }" + 141 475 " Interaction elem1 {}" + 142 476 " }" + … … 153 487 */ 154 488 @Test 155 public void testOnlySeldomPreceededByScroll_02() { 156 RequiredScrollRule rule = new RequiredScrollRule(); 157 158 // ===== check ===== 159 String spec = 160 "UserSession {" + 161 " Sequence seq1 {" + 162 " Optional opt1 { }" + 163 " Interaction elem1 {}" + 164 " }" + 165 " Sequence seq1 {" + 166 " Optional opt1 {" + 167 " Scroll body {}" + 168 " }" + 169 " Interaction elem1 {}" + 170 " }" + 171 " Sequence seq1 {" + 172 " Optional opt1 {" + 173 " Scroll body {}" + 174 " }" + 175 " Interaction elem1 {}" + 176 " }" + 177 "}"; 178 179 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 180 { new UsabilityDefect(MEDIUM, SCROLL_REQUIRED) }; 181 182 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 183 184 } 185 186 /** 187 * 188 */ 189 @Test 190 public void testOnlySeldomPreceededByScroll_03() { 191 RequiredScrollRule rule = new RequiredScrollRule(); 192 193 // ===== check ===== 194 String spec = 195 "UserSession {" + 196 " Sequence seq1 {" + 197 " Optional opt1 { }" + 198 " Interaction elem1 {}" + 199 " }" + 200 " Sequence seq1 {" + 201 " Optional opt1 {}" + 202 " Interaction elem1 {}" + 203 " }" + 204 " Sequence seq1 {" + 205 " Optional opt1 {" + 206 " Scroll body {}" + 207 " }" + 208 " Interaction elem1 {}" + 209 " }" + 210 " Sequence seq1 {" + 211 " Optional opt1 {" + 212 " Scroll body {}" + 213 " }" + 214 " Interaction elem1 {}" + 215 " }" + 216 "}"; 217 218 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 219 { new UsabilityDefect(LOW, SCROLL_REQUIRED) }; 220 221 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 222 223 } 224 225 /** 226 * 227 */ 228 @Test 229 public void testOnlySeldomPreceededByScroll_04() { 230 RequiredScrollRule rule = new RequiredScrollRule(); 231 232 // ===== check ===== 233 String spec = 234 "UserSession {" + 235 " Sequence seq1 {" + 236 " Optional opt1 { }" + 237 " Interaction elem1 {}" + 238 " }" + 239 " Sequence seq1 {" + 240 " Optional opt1 { }" + 241 " Interaction elem1 {}" + 242 " }" + 243 " Sequence seq1 {" + 244 " Optional opt1 { }" + 245 " Interaction elem1 {}" + 246 " }" + 247 " Sequence seq1 {" + 248 " Optional opt1 {" + 249 " Scroll body {}" + 250 " }" + 251 " Interaction elem1 {}" + 252 " }" + 253 "}"; 254 255 UsabilityDefect[] expectedDefects = new UsabilityDefect[] 256 { new UsabilityDefect(INFO, SCROLL_REQUIRED) }; 257 258 assertUsabilityEvaluationResult(expectedDefects, rule.evaluate(createTaskModel(spec))); 259 260 } 261 262 /** 263 * 264 */ 265 @Test 266 public void testOnlySeldomPreceededByScroll_05() { 267 RequiredScrollRule rule = new RequiredScrollRule(); 268 269 // ===== check ===== 270 String spec = 271 "UserSession {" + 272 " Sequence seq1 {" + 273 " Optional opt1 { }" + 274 " Interaction elem1 {}" + 275 " }" + 276 " Sequence seq1 {" + 277 " Optional opt1 { }" + 278 " Interaction elem1 {}" + 279 " }" + 280 " Sequence seq1 {" + 281 " Optional opt1 { }" + 282 " Interaction elem1 {}" + 283 " }" + 284 " Sequence seq1 {" + 285 " Optional opt1 {" + 286 " Scroll body {}" + 287 " }" + 288 " Interaction elem1 {}" + 289 " }" + 290 " Sequence seq1 {" + 291 " Optional opt1 { }" + 292 " Interaction elem1 {}" + 293 " }" + 294 " Sequence seq1 {" + 295 " Optional opt1 { }" + 296 " Interaction elem1 {}" + 297 " }" + 298 " Sequence seq1 {" + 299 " Optional opt1 { }" + 300 " Interaction elem1 {}" + 301 " }" + 302 " Sequence seq1 {" + 303 " Optional opt1 { }" + 304 " Interaction elem1 {}" + 489 public void testScrollSeldomRequired_09() { 490 RequiredInefficientActionsRule rule = new RequiredInefficientActionsRule(); 491 492 // ===== check ===== 493 String spec = 494 "UserSession {" + 495 " Sequence seq1 {" + 496 " Interaction elem1 {}" + 497 " Optional opt1 { }" + 498 " }" + 499 " Sequence seq1 {" + 500 " Interaction elem1 {}" + 501 " Optional opt1 { }" + 502 " }" + 503 " Sequence seq1 {" + 504 " Interaction elem1 {}" + 505 " Optional opt1 { }" + 506 " }" + 507 " Sequence seq1 {" + 508 " Interaction elem1 {}" + 509 " Optional opt1 {" + 510 " Scroll body {}" + 511 " }" + 512 " }" + 513 " Sequence seq1 {" + 514 " Interaction elem1 {}" + 515 " Optional opt1 { }" + 516 " }" + 517 " Sequence seq1 {" + 518 " Interaction elem1 {}" + 519 " Optional opt1 { }" + 520 " }" + 521 " Sequence seq1 {" + 522 " Interaction elem1 {}" + 523 " Optional opt1 { }" + 524 " }" + 525 " Sequence seq1 {" + 526 " Interaction elem1 {}" + 527 " Optional opt1 { }" + 305 528 " }" + 306 529 "}"; -
trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/UsabilityDefectDescriptionTest.java
r927 r1493 19 19 20 20 import java.util.HashMap; 21 import java.util.LinkedList; 22 import java.util.List; 21 23 import java.util.Map; 22 24 … … 26 28 27 29 /** 28 * TODO comment 29 * 30 * @version $Revision: $ $Date: 20.07.2012$ 31 * @author 2012, last modified by $Author: pharms$ 30 * @author Patrick Harms 32 31 */ 33 32 public class UsabilityDefectDescriptionTest { 34 33 35 34 /** 36 * TODO: comment37 35 * 38 36 */ … … 47 45 48 46 /** 49 * TODO: comment50 47 * 51 48 */ 52 49 @Test 53 public void testParameterization () {50 public void testParameterization_01() { 54 51 for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) { 55 Map<String, String> parameters = new HashMap<String, String>();52 Map<String, Object> parameters = new HashMap<String, Object>(); 56 53 57 54 for (String parameter : description.getDescriptionParameters()) { … … 65 62 } 66 63 64 65 /** 66 * 67 */ 68 @Test 69 public void testParameterization_02() { 70 for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) { 71 Map<String, Object> parameters = new HashMap<String, Object>(); 72 73 for (String parameter : description.getDescriptionParameters()) { 74 List<String> values = new LinkedList<String>(); 75 values.add("<parameter " + parameter + " value 1>"); 76 values.add("<parameter " + parameter + " value 2>"); 77 values.add("<parameter " + parameter + " value 3>"); 78 parameters.put(parameter, values); 79 } 80 81 assertNotNull(description.toString(parameters)); 82 assertNotSame("", description.toString(parameters)); 83 System.err.println(description.toString(parameters)); 84 } 85 } 86 67 87 }
Note: See TracChangeset
for help on using the changeset viewer.