source: trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationManager.java @ 1335

Last change on this file since 1335 was 1335, checked in by pharms, 10 years ago
  • corrected and extended usability evaluations
  • checking now more text field specific for required input formats and word repetitions
  • checking also for required scrolls
File size: 2.7 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 java.util.ArrayList;
18import java.util.List;
19import java.util.logging.Level;
20
21import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
22import de.ugoe.cs.util.console.Console;
23
24/**
25 * TODO comment
26 *
27 * @version $Revision: $ $Date: 16.07.2012$
28 * @author 2012, last modified by $Author: pharms$
29 */
30public class UsabilityEvaluationManager {
31   
32    /** */
33    private List<UsabilityEvaluationRule> rules = new ArrayList<UsabilityEvaluationRule>();
34
35    /**
36     *
37     */
38    public UsabilityEvaluationManager() {
39        super();
40        init();
41    }
42
43    /**
44     *
45     */
46    private void init() {
47        rules.add(new TextInputStatisticsRule());
48        rules.add(new RequiredScrollRule());
49    }
50
51    /**
52     *
53     */
54    public UsabilityEvaluationResult evaluateUsability(ITaskModel taskModel) {
55        Console.traceln(Level.INFO, "evaluating usability of task model " + taskModel);
56
57        List<UsabilityEvaluationResult> interimResults = new ArrayList<UsabilityEvaluationResult>();
58
59        for (UsabilityEvaluationRule rule : rules) {
60            Console.traceln(Level.INFO, "applying rule " + rule.getClass().getSimpleName());
61            UsabilityEvaluationResult result = rule.evaluate(taskModel);
62            interimResults.add(result);
63            Console.traceln(Level.INFO, "the rule found " + result.getAllDefects().size() +
64                            " usability defects, of which " + result.getSevereDefects().size() +
65                            " are severe.");
66        }
67
68        UsabilityEvaluationResult result = new UsabilityEvaluationResult(interimResults);
69        Console.println("the evaluation result contains " + result.getAllDefects().size() +
70                        " defects, of which " + result.getSevereDefects().size() + " are severe.");
71
72        List<UsabilityDefect> defects = result.getAllDefects();
73        for (int i = 0; i < defects.size(); i++) {
74            Console.println((i + 1) + ": " + defects.get(i).getParameterizedDescription());
75        }
76
77        return result;
78    }
79
80}
Note: See TracBrowser for help on using the repository browser.