Changeset 1040 for trunk


Ignore:
Timestamp:
01/16/13 17:51:51 (12 years ago)
Author:
adeicke
Message:
  • Removed lombok related annotations and util class
  • Added comments and formating due to match project defaults
Location:
trunk
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/AllTests.java

    r1030 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability; 
     
    1225import de.ugoe.cs.autoquest.usability.evaluation.rule.set.RulesetFactoryTest; 
    1326 
     27/** 
     28 * <p> 
     29 * TODO comment 
     30 * </p> 
     31 *  
     32 * @author Alexander Deicke 
     33 */ 
    1434@RunWith(Suite.class) 
    1535@SuiteClasses( 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationFacadeTest.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability; 
    216 
     
    1125import de.ugoe.cs.autoquest.usability.testutil.TaskTreeBuilder; 
    1226 
     27/** 
     28 * <p> 
     29 * TODO comment 
     30 * </p> 
     31 *  
     32 * @author Alexander Deicke 
     33 */ 
    1334public class UsabilityEvaluationFacadeTest { 
    1435 
     
    1738        UsabilityEvaluationFacade.applyUsabilityRuleset(null); 
    1839    } 
    19      
     40 
    2041    @Test 
    2142    public void apply_empty_ruleset_should_return_execute_usability_evaluation_step() { 
    22         ExecuteUsabilityEvaluationStep executeUsabilityEvaluationStep =  
    23                 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()); 
    24         assertThat(executeUsabilityEvaluationStep).isInstanceOf(ExecuteUsabilityEvaluationStep.class); 
     43        ExecuteUsabilityEvaluationStep executeUsabilityEvaluationStep = 
     44            UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()); 
     45        assertThat(executeUsabilityEvaluationStep) 
     46            .isInstanceOf(ExecuteUsabilityEvaluationStep.class); 
    2547    } 
    26      
     48 
    2749    @Test(expected = NullPointerException.class) 
    2850    public void evaluate_usability_of_null_should_throw_exception() { 
    29         UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()).evaluateUsabilityOf(null); 
     51        UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()) 
     52            .evaluateUsabilityOf(null); 
    3053    } 
    31      
     54 
    3255    @Test 
    33     public void evaluate_usability_of_task_tree_against_empty_ruleset_should_return_empty_evaluation_report() { 
    34         ITaskTree taskTree =  TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 
    35         UsabilityEvaluationReport evaluationReport =  
    36                 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()).evaluateUsabilityOf(taskTree); 
    37         assertThat(evaluationReport).isNotNull(); 
     56    public void evaluate_usability_of_task_tree_against_empty_ruleset_should_return_empty_evaluation_report() 
     57    { 
     58        ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 
     59        UsabilityEvaluationReport evaluationReport = 
     60            UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()) 
     61                .evaluateUsabilityOf(taskTree); 
     62        assertThat(evaluationReport).isNotNull(); 
    3863    } 
    39      
     64 
    4065    @Test 
    41     public void evaluate_usability_of_task_tree_against_dummy_ruleset_should_return_non_empty_evaluation_report() { 
    42         ITaskTree taskTree =  TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 
    43         UsabilityEvaluationReport evaluationReport =  
    44                 UsabilityEvaluationFacade.applyUsabilityRuleset(new DummyUsabilityRuleset()).evaluateUsabilityOf(taskTree); 
     66    public void evaluate_usability_of_task_tree_against_dummy_ruleset_should_return_non_empty_evaluation_report() 
     67    { 
     68        ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 
     69        UsabilityEvaluationReport evaluationReport = 
     70            UsabilityEvaluationFacade.applyUsabilityRuleset(new DummyUsabilityRuleset()) 
     71                .evaluateUsabilityOf(taskTree); 
    4572        assertThat(evaluationReport).isNotNull(); 
    4673    } 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationReportTest.java

    r1034 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability; 
     
    1831import de.ugoe.cs.autoquest.usability.testutil.DummyUsabilityRuleset; 
    1932 
     33/** 
     34 * <p> 
     35 * TODO comment 
     36 * </p> 
     37 *  
     38 * @author Alexander Deicke 
     39 */ 
    2040public class UsabilityEvaluationReportTest { 
    2141 
     
    2848    public void usability_report_from_empty_list_has_no_recommendations() { 
    2949        UsabilityEvaluationReport evaluationReport = 
    30             UsabilityEvaluationReport.from(Collections 
    31                 .<UsabilityDefect> emptyList()); 
     50            UsabilityEvaluationReport.from(Collections.<UsabilityDefect> emptyList()); 
    3251        assertThat(evaluationReport).isNotNull().has(noUsabilityGuidlineRecommendations()); 
    3352    } 
     
    3655    public void usability_report_from_non_empty_list_has_recommendations() { 
    3756        List<UsabilityDefect> guidlineRecommendations = 
    38             Lists.newArrayList(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver()) 
     57            Lists 
     58                .newArrayList(new UsabilityDefectFactory( 
     59                                                         new DummyUsabilityGuidlineDescriptionResolver()) 
    3960                    .createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO, 
    4061                                                           new DummyUsabilityRuleset() 
    41                                                                .evaluationRules() 
    42                                                                .iterator().next(), 
     62                                                               .evaluationRules().iterator().next(), 
    4363                                                           Collections.<String, String> emptyMap())); 
    4464        UsabilityEvaluationReport evaluationReport = 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/AbstractUsabilityEvaluationTC.java

    r1030 r1040  
    8888     * @param evaluateUsability 
    8989     */ 
    90     protected void assertUsabilityEvaluationResult(UsabilityDefect[]         expectedDefects, 
     90    protected void assertUsabilityEvaluationResult(UsabilityDefect[] expectedDefects, 
    9191                                                   UsabilityEvaluationResult evaluationResult) 
    9292    { 
    9393        assertEquals(expectedDefects.length, evaluationResult.getAllDefects().size()); 
    9494 
    95         EXPECTED_DEFECT_ITERATION: 
    96         for (UsabilityDefect expectedDefect : expectedDefects) { 
     95        EXPECTED_DEFECT_ITERATION: for (UsabilityDefect expectedDefect : expectedDefects) { 
    9796            for (UsabilityDefect defect : evaluationResult.getAllDefects()) { 
    9897                if (expectedDefect.equals(defect)) { 
     
    167166 
    168167        if ("Interaction".equals(type)) { 
    169             return taskTreeNodeFactory.createNewEventTask 
    170                 (new DummyInteraction("dummy", typeNumbers[0]++), new DummyGUIElement("dummy")); 
     168            return taskTreeNodeFactory.createNewEventTask(new DummyInteraction("dummy", 
     169                                                                               typeNumbers[0]++), 
     170                                                          new DummyGUIElement("dummy")); 
    171171        } 
    172172        else if ("Sequence".equals(type)) { 
     
    185185 
    186186            TextInput textInput = new TextInput(additionalInfo, new ArrayList<Event>()); 
    187              
    188             IEventTask task = taskTreeNodeFactory.createNewEventTask 
    189                 (textInput, new DummyTextField(additionalInfo)); 
     187 
     188            IEventTask task = 
     189                taskTreeNodeFactory.createNewEventTask(textInput, 
     190                                                       new DummyTextField(additionalInfo)); 
    190191 
    191192            return task; 
     
    220221        else { 
    221222            fail("can not add children to parent task tree node of type " + 
    222                  parent.getClass().getName()); 
     223                parent.getClass().getName()); 
    223224        } 
    224225    } 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/NoLetterOrDigitTextInputsEvaluatorTest.java

    r1034 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
     
    2639import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 
    2740 
     41/** 
     42 * <p> 
     43 * TODO comment 
     44 * </p> 
     45 *  
     46 * @author Alexander Deicke 
     47 */ 
    2848public class NoLetterOrDigitTextInputsEvaluatorTest extends AbstractUsabilityEvaluationTC { 
    2949 
     
    3252    @Before 
    3353    public void initRuleUnderTest() { 
    34         EnumSet<? extends UsabilityRule> ruleset = 
    35             textInputUsabiliyRuleset().evaluationRules(); 
     54        EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules(); 
    3655        this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() { 
    3756 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/TextInputEntryRepetitionsEvaluatorTest.java

    r1034 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
     
    2639import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 
    2740 
     41/** 
     42 * <p> 
     43 * TODO comment 
     44 * </p> 
     45 *  
     46 * @author Alexander Deicke 
     47 */ 
    2848public class TextInputEntryRepetitionsEvaluatorTest extends AbstractUsabilityEvaluationTC { 
    2949 
     
    3252    @Before 
    3353    public void initRuleUnderTest() { 
    34         EnumSet<? extends UsabilityRule> ruleset = 
    35             textInputUsabiliyRuleset().evaluationRules(); 
     54        EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules(); 
    3655        this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() { 
    3756 
     
    85104            new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 
    86105        // Then 
    87         assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel());    } 
     106        assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel()); 
     107    } 
    88108 
    89109    @Test 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/TextInputRatioEvaluatorTest.java

    r1034 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
     
    2639import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 
    2740 
     41/** 
     42 * <p> 
     43 * TODO comment 
     44 * </p> 
     45 *  
     46 * @author Alexander Deicke 
     47 */ 
    2848public class TextInputRatioEvaluatorTest extends AbstractUsabilityEvaluationTC { 
    2949 
     
    3252    @Before 
    3353    public void initRuleUnderTest() { 
    34         EnumSet<? extends UsabilityRule> ruleset = 
    35             textInputUsabiliyRuleset().evaluationRules(); 
     54        EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules(); 
    3655        this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() { 
    3756 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/EmptyUsabilityRulesetTest.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
     
    620import org.junit.Test; 
    721 
     22/** 
     23 * <p> 
     24 * TODO comment 
     25 * </p> 
     26 *  
     27 * @author Alexander Deicke 
     28 */ 
    829public class EmptyUsabilityRulesetTest { 
    930 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/RulesetFactoryTest.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
     
    1024import org.junit.Test; 
    1125 
     26/** 
     27 * <p> 
     28 * TODO comment 
     29 * </p> 
     30 *  
     31 * @author Alexander Deicke 
     32 */ 
    1233public class RulesetFactoryTest { 
    13      
     34 
    1435    @Test 
    1536    public void empty_ruleset_factory_method_should_return_empty_ruleset() { 
    16         UsabilityRuleset ruleset = emptyUsabilityRuleset(); 
    17         assertThat(ruleset).isInstanceOf(EmptyUsabilityRuleset.class).has(noUsabilityRules()); 
     37        UsabilityRuleset ruleset = emptyUsabilityRuleset(); 
     38        assertThat(ruleset).isInstanceOf(EmptyUsabilityRuleset.class).has(noUsabilityRules()); 
    1839    } 
    19      
     40 
    2041    @Test 
    2142    public void text_input_ruleset_factory_method_should_return_text_input_ruleset() { 
    22         UsabilityRuleset ruleset = textInputUsabiliyRuleset(); 
    23         assertThat(ruleset).isInstanceOf(TextInputUsabiliyRuleset.class).has(usabilityRules()); 
     43        UsabilityRuleset ruleset = textInputUsabiliyRuleset(); 
     44        assertThat(ruleset).isInstanceOf(TextInputUsabiliyRuleset.class).has(usabilityRules()); 
    2445    } 
    25      
     46 
    2647    @Test 
    2748    public void mouse_interaction_ruleset_factory_method_should_return_mouse_interaction_ruleset() { 
    2849        UsabilityRuleset ruleset = mouseInteractionUsabiliyRuleset(); 
    29         assertThat(ruleset).isInstanceOf(MouseInteractionUsabilityRuleset.class).has(usabilityRules()); 
     50        assertThat(ruleset).isInstanceOf(MouseInteractionUsabilityRuleset.class) 
     51            .has(usabilityRules()); 
    3052    } 
    3153 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/CreateClickstreamImageFromTaskTreeDemoApp.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.sandboxapp; 
    216 
     
    2135import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil; 
    2236 
     37/** 
     38 * <p> 
     39 * TODO comment 
     40 * </p> 
     41 *  
     42 * @author Alexander Deicke 
     43 */ 
    2344public class CreateClickstreamImageFromTaskTreeDemoApp { 
    2445 
    2546    private static final String fileToParse = "javatrace.xml"; 
    26      
     47 
    2748    private static final String clickstreamFilename = "clickstream.png"; 
    28      
     49 
    2950    /** 
    3051     * <p> 
    3152     * TODO: comment 
    3253     * </p> 
    33      * 
     54     *  
    3455     * @param args 
    35      * @throws IOException  
     56     * @throws IOException 
    3657     */ 
    3758    public static void main(String[] args) throws IOException { 
    3859        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(fileToParse); 
    3960        FilterStatistic mouseInteractions = filterMouseInteractions(taskTree); 
    40          
     61 
    4162        BufferedImage clickstreamImage = new BufferedImage(1024, 768, BufferedImage.TYPE_INT_ARGB); 
    4263        Graphics2D drawArea = clickstreamImage.createGraphics(); 
    4364        drawArea.setColor(Color.BLACK); 
    44         drawArea.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 
    45          
     65        drawArea.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
     66                                  RenderingHints.VALUE_ANTIALIAS_ON); 
     67 
    4668        drawClickstream(mouseInteractions, drawArea); 
    4769 
     
    5274        int xb = -1; 
    5375        int yb = -1; 
    54          
    55         for(ITaskTreeNode node : mouseInteractions.nodesMatchedFilter()) { 
    56             MouseButtonInteraction interaction = (MouseButtonInteraction) ((IEventTask) node).getEventType(); 
     76 
     77        for (ITaskTreeNode node : mouseInteractions.nodesMatchedFilter()) { 
     78            MouseButtonInteraction interaction = 
     79                (MouseButtonInteraction) ((IEventTask) node).getEventType(); 
    5780            int x = interaction.getX(); 
    5881            int y = interaction.getY(); 
    59             g2.fillOval(x,y,1,1); 
    60             if(xb != -1 && y != -1) g2.drawLine(x, y, xb, yb); 
     82            g2.fillOval(x, y, 1, 1); 
     83            if (xb != -1 && y != -1) 
     84                g2.drawLine(x, y, xb, yb); 
    6185            xb = x; 
    6286            yb = y; 
    6387        } 
    6488    } 
    65      
     89 
    6690    private static FilterStatistic filterMouseInteractions(ITaskTree taskTree) { 
    6791        return new TaskTreeFilter(new IterativeDFSFilterStrategy()) 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/CreateHeatmapImageFromTaskTreeDemoApp.java

    r1030 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.sandboxapp; 
     
    1831import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil; 
    1932 
     33/** 
     34 * <p> 
     35 * TODO comment 
     36 * </p> 
     37 *  
     38 * @author Alexander Deicke 
     39 */ 
    2040public class CreateHeatmapImageFromTaskTreeDemoApp { 
    2141 
    2242    private static final String fileToParse = "javatrace.xml"; 
    23      
     43 
    2444    private static final String heatmapFilename = "click-heatmap.png"; 
    2545 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/TaskTreeVisualizerDemoApp.java

    r1030 r1040  
    145145    RadialTreeLayout<String, Integer> radialLayout; 
    146146 
    147     @SuppressWarnings({ "unchecked", "rawtypes" }) 
     147    @SuppressWarnings( 
     148        { "unchecked", "rawtypes" }) 
    148149    public TaskTreeVisualizerDemoApp(String filetoparse) { 
    149          
    150         ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(filetoparse);  
    151          
     150 
     151        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(filetoparse); 
     152 
    152153        // create a simple graph for the demo 
    153154        graph = new DelegateForest<String, Integer>(); 
     
    274275        content.add(controls, BorderLayout.SOUTH); 
    275276    } 
    276      
     277 
    277278    class Rings implements VisualizationServer.Paintable { 
    278279 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/DummyUsabilityGuidlineDescriptionResolver.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.testutil; 
    216 
     
    519import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule; 
    620 
    7 public class DummyUsabilityGuidlineDescriptionResolver implements UsabilityDefectDescriptionResolver { 
     21/** 
     22 * <p> 
     23 * TODO comment 
     24 * </p> 
     25 *  
     26 * @author Alexander Deicke 
     27 */ 
     28public class DummyUsabilityGuidlineDescriptionResolver implements 
     29    UsabilityDefectDescriptionResolver 
     30{ 
    831 
    932    public DefectDescription descriptionFor(UsabilityRule usabilityRule) { 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/DummyUsabilityRuleset.java

    r1034 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.testutil; 
    216 
     
    1327import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset; 
    1428 
     29/** 
     30 * <p> 
     31 * TODO comment 
     32 * </p> 
     33 *  
     34 * @author Alexander Deicke 
     35 */ 
    1536public class DummyUsabilityRuleset implements UsabilityRuleset { 
    1637 
    1738    private enum DummyUsabilityRule implements UsabilityRule { 
    18          
     39 
    1940        DUMMY_RULE_WITH_RECOMMENDATION { 
    20              
     41 
    2142            @Override 
    2243            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) { 
    23                 return Optional.of(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver()). 
    24                                    createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO, this, Collections.<String, String> emptyMap())); 
     44                return Optional 
     45                    .of(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver()) 
     46                        .createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO, 
     47                                                               this, Collections 
     48                                                                   .<String, String> emptyMap())); 
    2549            } 
    2650 
     
    2852                return this.name(); 
    2953            } 
    30              
     54 
    3155        }, 
    32          
     56 
    3357        DUMMY_RULE_WITHOUT_RECOMMENDATION { 
    34              
     58 
    3559            @Override 
    3660            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) { 
     
    4670 
    4771    } 
    48      
    49     private final EnumSet<DummyUsabilityRule> DUMMY_USABILITY_RULESET =  
    50             EnumSet.allOf(DummyUsabilityRule.class); 
     72 
     73    private final EnumSet<DummyUsabilityRule> DUMMY_USABILITY_RULESET = EnumSet 
     74        .allOf(DummyUsabilityRule.class); 
    5175 
    5276    public EnumSet<? extends UsabilityRule> evaluationRules() { 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/FestConditionUtil.java

    r1034 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.testutil; 
    216 
     
    1024import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset; 
    1125 
     26/** 
     27 * <p> 
     28 * TODO comment 
     29 * </p> 
     30 *  
     31 * @author Alexander Deicke 
     32 */ 
    1233public class FestConditionUtil { 
    1334 
     
    1536        // no good idea 
    1637    } 
    17      
     38 
    1839    public static Condition<UsabilityEvaluationReport> noUsabilityGuidlineRecommendations() { 
    1940        return new Condition<UsabilityEvaluationReport>() { 
    20      
     41 
    2142            @Override 
    2243            public boolean matches(UsabilityEvaluationReport usabilityEvaluationReport) { 
     
    2546        }; 
    2647    } 
    27      
     48 
    2849    public static Condition<UsabilityEvaluationReport> usabilityGuidlineRecommendations() { 
    2950        return new Condition<UsabilityEvaluationReport>() { 
    30      
     51 
    3152            @Override 
    3253            public boolean matches(UsabilityEvaluationReport usabilityEvaluationReport) { 
     
    3556        }; 
    3657    } 
    37      
     58 
    3859    public static Condition<UsabilityRuleset> noUsabilityRules() { 
    3960        return new Condition<UsabilityRuleset>() { 
     
    4364                return usabilityRuleset.evaluationRules().isEmpty(); 
    4465            } 
    45      
    4666 
    4767        }; 
    4868    } 
    49      
     69 
    5070    public static Condition<UsabilityRuleset> usabilityRules() { 
    5171        return new Condition<UsabilityRuleset>() { 
     
    5575                return !usabilityRuleset.evaluationRules().isEmpty(); 
    5676            } 
    57      
    5877 
    5978        }; 
    6079    } 
    61      
     80 
    6281    public static Condition<Optional<UsabilityDefect>> present() { 
    6382        return new Condition<Optional<UsabilityDefect>>() { 
     
    6786                return usabilityGuidlineRecommendation.isPresent(); 
    6887            } 
    69      
     88 
    7089        }; 
    7190    } 
    72      
     91 
    7392    public static Condition<Optional<UsabilityDefect>> absent() { 
    7493        return new Condition<Optional<UsabilityDefect>>() { 
     
    7897                return !usabilityGuidlineRecommendation.isPresent(); 
    7998            } 
    80      
     99 
    81100        }; 
    82101    } 
    83      
     102 
    84103    public static Condition<Optional<UsabilityDefect>> infoRecommendationSeverityLevel() { 
    85104        return new Condition<Optional<UsabilityDefect>>() { 
     
    87106            @Override 
    88107            public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 
    89                 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.INFO); 
     108                return usabilityGuidlineRecommendation.get().getSeverityLevel() 
     109                    .equals(UsabilityDefectSeverityLevel.INFO); 
    90110            } 
    91111 
    92112        }; 
    93113    } 
    94      
     114 
    95115    public static Condition<Optional<UsabilityDefect>> lowRecommendationSeverityLevel() { 
    96116        return new Condition<Optional<UsabilityDefect>>() { 
     
    98118            @Override 
    99119            public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 
    100                 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.LOW); 
     120                return usabilityGuidlineRecommendation.get().getSeverityLevel() 
     121                    .equals(UsabilityDefectSeverityLevel.LOW); 
    101122            } 
    102123 
    103124        }; 
    104125    } 
    105      
     126 
    106127    public static Condition<Optional<UsabilityDefect>> mediumRecommendationSeverityLevel() { 
    107128        return new Condition<Optional<UsabilityDefect>>() { 
     
    109130            @Override 
    110131            public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 
    111                 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.MEDIUM); 
     132                return usabilityGuidlineRecommendation.get().getSeverityLevel() 
     133                    .equals(UsabilityDefectSeverityLevel.MEDIUM); 
    112134            } 
    113135 
    114136        }; 
    115137    } 
    116      
     138 
    117139    public static Condition<Optional<UsabilityDefect>> highRecommendationSeverityLevel() { 
    118140        return new Condition<Optional<UsabilityDefect>>() { 
     
    120142            @Override 
    121143            public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 
    122                 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.HIGH); 
     144                return usabilityGuidlineRecommendation.get().getSeverityLevel() 
     145                    .equals(UsabilityDefectSeverityLevel.HIGH); 
    123146            } 
    124147 
    125148        }; 
    126149    } 
    127      
     150 
    128151} 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/GenerateTaskTreeUtil.java

    r1030 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.testutil; 
     
    1730import de.ugoe.cs.util.console.TextConsole; 
    1831 
     32/** 
     33 * <p> 
     34 * TODO comment 
     35 * </p> 
     36 *  
     37 * @author Alexander Deicke 
     38 */ 
    1939public class GenerateTaskTreeUtil { 
    20      
     40 
    2141    private static final String seqName = "sequences"; 
    2242 
  • trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/TaskTreeBuilder.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.testutil; 
    216 
     
    620import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNodeFactory; 
    721 
     22/** 
     23 * <p> 
     24 * TODO comment 
     25 * </p> 
     26 *  
     27 * @author Alexander Deicke 
     28 */ 
    829public class TaskTreeBuilder { 
    9      
     30 
    1031    public static CreateRootNodeStep builder() { 
    1132        return new CreateRootNodeStep(); 
    1233    } 
    13      
     34 
    1435    public static class CreateRootNodeStep { 
    15          
     36 
    1637        public AddChildrenStep root(String name) { 
    1738            return new AddChildrenStep(new TaskTreeNode(name)); 
    1839        } 
    19          
     40 
    2041    } 
    21      
     42 
    2243    public static class AddChildrenStep { 
    23          
     44 
    2445        private TaskTreeNode rootNode; 
    25          
     46 
    2647        public AddChildrenStep(TaskTreeNode taskTreeRootNode) { 
    2748            this.rootNode = taskTreeRootNode; 
     
    3253            return this; 
    3354        } 
    34          
     55 
    3556        public ITaskTree creatTaskTree() { 
    3657            return new TaskTreeNodeFactory().createTaskTree(rootNode); 
    3758        } 
    38          
     59 
    3960    } 
    40      
    41 //        private Employee employee; 
    42 // 
    43 //        public EmployeeBuilder() { 
    44 //            employee = new Employee(); 
    45 //        } 
    46 // 
    47 //        public static EmployeeBuilder defaultValues() { 
    48 //            return new EmployeeBuilder(); 
    49 //        } 
    50 // 
    51 //        public static EmployeeBuilder clone(Employee toClone) { 
    52 //            EmployeeBuilder builder = defaultValues(); 
    53 //            builder.setId(toClone.getId()); 
    54 //            builder.setName(toClone.getName()); 
    55 //            builder.setDepartment(toClone.getDepartment()); 
    56 //            return builder; 
    57 //        } 
    58 // 
    59 //        public static EmployeeBuilder random() { 
    60 //            EmployeeBuilder builder = defaultValues(); 
    61 //            builder.setId(getRandomInteger(0, 1000)); 
    62 //            builder.setName(getRandomString(20)); 
    63 //            builder.setDepartment(Department.values()[getRandomInteger(0, Department.values().length - 1)]); 
    64 //            return builder; 
    65 //        } 
    66 // 
    67 //        public EmployeeBuilder setId(int id) { 
    68 //            employee.setId(id); 
    69 //            return this; 
    70 //        } 
    71 // 
    72 //        public EmployeeBuilder setName(String name) { 
    73 //            employee.setName(name); 
    74 //            return this; 
    75 //        } 
    76 // 
    77 //        public EmployeeBuilder setDepartment(Department dept) { 
    78 //            employee.setDepartment(dept); 
    79 //            return this; 
    80 //        } 
    81 // 
    82 //        public Employee build() { 
    83 //            return employee; 
    84 //        } 
    85 //    } 
     61 
     62    // private Employee employee; 
     63    // 
     64    // public EmployeeBuilder() { 
     65    // employee = new Employee(); 
     66    // } 
     67    // 
     68    // public static EmployeeBuilder defaultValues() { 
     69    // return new EmployeeBuilder(); 
     70    // } 
     71    // 
     72    // public static EmployeeBuilder clone(Employee toClone) { 
     73    // EmployeeBuilder builder = defaultValues(); 
     74    // builder.setId(toClone.getId()); 
     75    // builder.setName(toClone.getName()); 
     76    // builder.setDepartment(toClone.getDepartment()); 
     77    // return builder; 
     78    // } 
     79    // 
     80    // public static EmployeeBuilder random() { 
     81    // EmployeeBuilder builder = defaultValues(); 
     82    // builder.setId(getRandomInteger(0, 1000)); 
     83    // builder.setName(getRandomString(20)); 
     84    // builder.setDepartment(Department.values()[getRandomInteger(0, Department.values().length - 
     85    // 1)]); 
     86    // return builder; 
     87    // } 
     88    // 
     89    // public EmployeeBuilder setId(int id) { 
     90    // employee.setId(id); 
     91    // return this; 
     92    // } 
     93    // 
     94    // public EmployeeBuilder setName(String name) { 
     95    // employee.setName(name); 
     96    // return this; 
     97    // } 
     98    // 
     99    // public EmployeeBuilder setDepartment(Department dept) { 
     100    // employee.setDepartment(dept); 
     101    // return this; 
     102    // } 
     103    // 
     104    // public Employee build() { 
     105    // return employee; 
     106    // } 
     107    // } 
    86108 
    87109} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationFacade.java

    r1033 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability; 
    216 
    317import java.util.EnumSet; 
    418import java.util.List; 
    5  
    6 import lombok.AccessLevel; 
    7 import lombok.AllArgsConstructor; 
    8 import lombok.NoArgsConstructor; 
    919 
    1020import com.google.common.base.Optional; 
     
    1727import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset; 
    1828 
    19 @NoArgsConstructor(access = AccessLevel.PRIVATE) 
     29/** 
     30 * <p> 
     31 * TODO comment 
     32 * </p> 
     33 *  
     34 * @author Alexander Deicke 
     35 */ 
    2036public class UsabilityEvaluationFacade { 
    2137 
    22     public static ExecuteUsabilityEvaluationStep applyUsabilityRuleset(UsabilityRuleset usabilityRuleset) { 
    23         Preconditions.checkNotNull(usabilityRuleset); 
     38    private UsabilityEvaluationFacade() { 
     39        // no instantiation allowed 
     40    } 
     41 
     42    public static ExecuteUsabilityEvaluationStep applyUsabilityRuleset(UsabilityRuleset usabilityRuleset) 
     43    { 
     44        Preconditions.checkNotNull(usabilityRuleset); 
    2445        return new ExecuteUsabilityEvaluationStep(usabilityRuleset); 
    2546    } 
    2647 
    27     @AllArgsConstructor 
    2848    protected static class ExecuteUsabilityEvaluationStep { 
    29          
    30         private final UsabilityRuleset usabilityRuleset; 
    3149 
    32         public UsabilityEvaluationReport evaluateUsabilityOf(ITaskTree taskTree) { 
    33             Preconditions.checkNotNull(taskTree); 
    34             EnumSet<? extends UsabilityRule> evaluationRules = usabilityRuleset.evaluationRules(); 
    35             List<UsabilityDefect> evaluationResults =  
    36                     Lists.newArrayListWithCapacity(evaluationRules.size()); 
    37             for(UsabilityRule usabilityRule : evaluationRules) { 
    38                 Optional<UsabilityDefect> ruleEvaluationResult = usabilityRule.evaluate(taskTree); 
    39                 if(ruleEvaluationResult.isPresent()) { 
    40                     evaluationResults.add(ruleEvaluationResult.get()); 
    41                 } 
    42             } 
    43             return UsabilityEvaluationReport.from(evaluationResults); 
    44         } 
    45          
     50        protected ExecuteUsabilityEvaluationStep(UsabilityRuleset usabilityRuleset) { 
     51            super(); 
     52            this.usabilityRuleset = usabilityRuleset; 
     53        } 
     54 
     55        private final UsabilityRuleset usabilityRuleset; 
     56 
     57        public UsabilityEvaluationReport evaluateUsabilityOf(ITaskTree taskTree) { 
     58            Preconditions.checkNotNull(taskTree); 
     59            EnumSet<? extends UsabilityRule> evaluationRules = usabilityRuleset.evaluationRules(); 
     60            List<UsabilityDefect> evaluationResults = 
     61                Lists.newArrayListWithCapacity(evaluationRules.size()); 
     62            for (UsabilityRule usabilityRule : evaluationRules) { 
     63                Optional<UsabilityDefect> ruleEvaluationResult = usabilityRule.evaluate(taskTree); 
     64                if (ruleEvaluationResult.isPresent()) { 
     65                    evaluationResults.add(ruleEvaluationResult.get()); 
     66                } 
     67            } 
     68            return UsabilityEvaluationReport.from(evaluationResults); 
     69        } 
     70 
    4671    } 
    4772 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationReport.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability; 
    216 
    317import java.util.List; 
    4  
    5 import lombok.AccessLevel; 
    6 import lombok.AllArgsConstructor; 
    718 
    819import com.google.common.base.Preconditions; 
     
    1021import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect; 
    1122 
    12 @AllArgsConstructor(access = AccessLevel.PRIVATE) 
     23/** 
     24 * <p> 
     25 * TODO comment 
     26 * </p> 
     27 *  
     28 * @author Alexander Deicke 
     29 */ 
    1330public class UsabilityEvaluationReport { 
    14      
     31 
    1532    private List<UsabilityDefect> evaluationResults; 
    16      
     33 
     34    private UsabilityEvaluationReport(List<UsabilityDefect> evaluationResults) { 
     35        this.evaluationResults = evaluationResults; 
     36    } 
     37 
    1738    public static UsabilityEvaluationReport from(List<UsabilityDefect> evaluationResults) { 
    18         Preconditions.checkNotNull(evaluationResults); 
    19         return new UsabilityEvaluationReport(evaluationResults); 
     39        Preconditions.checkNotNull(evaluationResults); 
     40        return new UsabilityEvaluationReport(evaluationResults); 
    2041    } 
    21      
     42 
    2243    public List<UsabilityDefect> evaluationResults() { 
    2344        return this.evaluationResults; 
    2445    } 
    25      
     46 
    2647} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/result/UsabilityDefect.java

    r1032 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.result; 
     
    720import java.util.Map; 
    821 
    9 import lombok.AllArgsConstructor; 
    10 import lombok.ExtensionMethod; 
    11 import lombok.Getter; 
    12  
    1322import org.apache.commons.lang.StringUtils; 
    1423 
    1524import com.google.common.base.CharMatcher; 
    1625import com.google.common.base.Joiner; 
     26import com.google.common.base.Predicate; 
     27import com.google.common.collect.Iterables; 
    1728import com.google.common.collect.Lists; 
    1829 
    1930import de.ugoe.cs.autoquest.usability.DefectDescription; 
    2031import de.ugoe.cs.autoquest.usability.ParameterFragment; 
    21 import de.ugoe.cs.autoquest.usability.util.DefectDescriptionExtensionMethods; 
    2232 
    23 @AllArgsConstructor 
    24 @ExtensionMethod({DefectDescriptionExtensionMethods.class}) 
     33/** 
     34 * <p> 
     35 * TODO comment 
     36 * </p> 
     37 *  
     38 * @author Alexander Deicke 
     39 */ 
    2540public class UsabilityDefect { 
    2641 
    27     @Getter 
    2842    private UsabilityDefectSeverityLevel severityLevel; 
    2943 
     
    3246    private Map<String, String> descriptionParametersValues; 
    3347 
     48    public UsabilityDefect(UsabilityDefectSeverityLevel severityLevel, 
     49                           DefectDescription defectDescription, 
     50                           Map<String, String> descriptionParametersValues) 
     51    { 
     52        super(); 
     53        this.severityLevel = severityLevel; 
     54        this.defectDescription = defectDescription; 
     55        this.descriptionParametersValues = descriptionParametersValues; 
     56    } 
     57 
    3458    public String defectDescription() { 
    35         if(defectDescription.containsParameterFragments()) { 
     59        if (containsParameterFragments(defectDescription)) { 
    3660            return assembleDefectDescription(); 
    37         } else { 
    38             return Joiner.on(" ").skipNulls().join(defectDescription.getTextFragmentOrParameterFragment()); 
     61        } 
     62        else { 
     63            return Joiner.on(" ").skipNulls() 
     64                .join(defectDescription.getTextFragmentOrParameterFragment()); 
    3965        } 
    4066    } 
    4167 
     68    private boolean containsParameterFragments(DefectDescription defectDescription) { 
     69        return Iterables.any(defectDescription.getTextFragmentOrParameterFragment(), 
     70                             new Predicate<Object>() { 
     71 
     72                                 @Override 
     73                                 public boolean apply(Object fragment) { 
     74                                     return fragment instanceof ParameterFragment; 
     75                                 } 
     76 
     77                             }); 
     78    } 
     79 
    4280    private String assembleDefectDescription() { 
    43         List<String> descriptionParts =  
    44                 Lists.newArrayListWithCapacity(defectDescription.getTextFragmentOrParameterFragment().size()); 
     81        List<String> descriptionParts = 
     82            Lists.newArrayListWithCapacity(defectDescription.getTextFragmentOrParameterFragment() 
     83                .size()); 
    4584 
    4685        for (Object fragment : defectDescription.getTextFragmentOrParameterFragment()) { 
    47             if (fragment.isParameterFragment()) { 
     86            if (isParameterFragment(fragment)) { 
    4887                descriptionParts.add(parameterFragmentAsString((ParameterFragment) fragment)); 
    49             } else { 
    50                  descriptionParts.add(CharMatcher.WHITESPACE.collapseFrom((String) fragment, ' ').trim()); 
     88            } 
     89            else { 
     90                descriptionParts.add(CharMatcher.WHITESPACE.collapseFrom((String) fragment, ' ') 
     91                    .trim()); 
    5192            } 
    5293        } 
     
    5596    } 
    5697 
     98    private boolean isParameterFragment(Object object) { 
     99        return object instanceof ParameterFragment; 
     100    } 
     101 
    57102    private String parameterFragmentAsString(ParameterFragment fragment) { 
    58         String value = descriptionParametersValues.getValueOrEmptyString(fragment.getParameterName()); 
     103        String value = 
     104            getValueOrEmptyString(descriptionParametersValues, fragment.getParameterName()); 
    59105        if (StringUtils.isNotEmpty(value)) { 
    60106            return value; 
    61         } else { 
    62             throw new IllegalArgumentException(format("required parameter \"%s\" for usability defect description not provided", fragment.getParameterName())); 
     107        } 
     108        else { 
     109            throw new IllegalArgumentException( 
     110                                               format("required parameter \"%s\" for usability defect description not provided", 
     111                                                      fragment.getParameterName())); 
    63112        } 
    64113    } 
    65114 
     115    private String getValueOrEmptyString(Map<String, String> stringKeyValueMap, String key) { 
     116        return stringKeyValueMap != null && stringKeyValueMap.containsKey(key) ? stringKeyValueMap 
     117            .get(key) : StringUtils.EMPTY; 
     118    } 
     119 
     120    public UsabilityDefectSeverityLevel getSeverityLevel() { 
     121        return severityLevel; 
     122    } 
     123 
    66124} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/result/UsabilityDefectDescriptionResolver.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.result; 
    216 
     
    418import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule; 
    519 
     20/** 
     21 * <p> 
     22 * TODO comment 
     23 * </p> 
     24 *  
     25 * @author Alexander Deicke 
     26 */ 
    627public interface UsabilityDefectDescriptionResolver { 
    728 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/result/UsabilityDefectFactory.java

    r1030 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.result; 
     
    619import de.ugoe.cs.autoquest.usability.DefectDescription; 
    720import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule; 
    8 import lombok.AllArgsConstructor; 
    921 
    10 @AllArgsConstructor 
     22/** 
     23 * <p> 
     24 * TODO comment 
     25 * </p> 
     26 *  
     27 * @author Alexander Deicke 
     28 */ 
    1129public class UsabilityDefectFactory { 
     30 
     31    public UsabilityDefectFactory(UsabilityDefectDescriptionResolver usabilityDefectDescriptionResolver) 
     32    { 
     33        super(); 
     34        this.usabilityDefectDescriptionResolver = usabilityDefectDescriptionResolver; 
     35    } 
    1236 
    1337    private final UsabilityDefectDescriptionResolver usabilityDefectDescriptionResolver; 
     
    1539    public UsabilityDefect createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel recommendationSeverityLevel, 
    1640                                                                 UsabilityRule usabilityRule, 
    17                                                                  Map<String, String> recommendationMessageParameteValues) { 
     41                                                                 Map<String, String> recommendationMessageParameteValues) 
     42    { 
    1843        DefectDescription guidlineDescription = 
    1944            usabilityDefectDescriptionResolver.descriptionFor(usabilityRule); 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/result/UsabilityDefectSeverityLevel.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.result; 
    216 
     17/** 
     18 * <p> 
     19 * TODO comment 
     20 * </p> 
     21 *  
     22 * @author Alexander Deicke 
     23 */ 
    324public enum UsabilityDefectSeverityLevel { 
    425 
    526    INFO, LOW, MEDIUM, HIGH; 
    6      
     27 
    728} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/result/UsabilityDefectXmlDescriptionResolver.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.result; 
    216 
     
    1630import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule; 
    1731 
     32/** 
     33 * <p> 
     34 * TODO comment 
     35 * </p> 
     36 *  
     37 * @author Alexander Deicke 
     38 */ 
    1839public class UsabilityDefectXmlDescriptionResolver implements UsabilityDefectDescriptionResolver { 
    19      
     40 
    2041    private static final String DEFAULT_MESSAGES_FILE = "defectDescriptions_en.xml"; 
    21      
    22     private static final UsabilityDefectXmlDescriptionResolver instance = new UsabilityDefectXmlDescriptionResolver(); 
    23      
     42 
     43    private static final UsabilityDefectXmlDescriptionResolver instance = 
     44        new UsabilityDefectXmlDescriptionResolver(); 
     45 
    2446    private DefectDescriptions defectDescriptions; 
    25      
     47 
    2648    private UsabilityDefectXmlDescriptionResolver() { 
    2749        loadDescriptions(); 
    2850    } 
    29      
     51 
    3052    @SuppressWarnings("unchecked") 
    3153    private void loadDescriptions() { 
    32         InputStream inputStream = 
    33                 ClassLoader.getSystemResourceAsStream(DEFAULT_MESSAGES_FILE); 
     54        InputStream inputStream = ClassLoader.getSystemResourceAsStream(DEFAULT_MESSAGES_FILE); 
    3455        try { 
    3556            String packageName = DefectDescriptions.class.getPackage().getName(); 
     
    3859 
    3960            defectDescriptions = 
    40                 ((JAXBElement<DefectDescriptions>) unmarshaller.unmarshal(inputStream)) 
    41                     .getValue(); 
     61                ((JAXBElement<DefectDescriptions>) unmarshaller.unmarshal(inputStream)).getValue(); 
    4262        } 
    4363        catch (Exception e) { 
    44             throw new RuntimeException 
    45                 ("error while initializing usability defect descriptions", e); 
     64            throw new RuntimeException("error while initializing usability defect descriptions", e); 
    4665        } 
    4766        finally { 
     
    5675        } 
    5776    } 
    58      
     77 
    5978    public static UsabilityDefectXmlDescriptionResolver instance() { 
    6079        return instance; 
     
    6382    @Override 
    6483    public DefectDescription descriptionFor(final UsabilityRule usabilityRule) { 
    65         Optional<DefectDescription> guidlineDescription = Iterables.tryFind(defectDescriptions.getDefectDescription(), new Predicate<DefectDescription>() { 
    66              
    67             public boolean apply(DefectDescription defectDescription) { 
    68                 return usabilityRule.ruleIdentifier().equals(defectDescription.getDefectId()); 
    69             } 
    70              
    71         }); 
    72         if(!guidlineDescription.isPresent()) 
    73             throw new RuntimeException 
    74             ("error while initializing usability defect descriptions. No " + 
    75                     "description text available for description " + usabilityRule.ruleIdentifier()); 
     84        Optional<DefectDescription> guidlineDescription = 
     85            Iterables.tryFind(defectDescriptions.getDefectDescription(), 
     86                              new Predicate<DefectDescription>() { 
     87 
     88                                  public boolean apply(DefectDescription defectDescription) { 
     89                                      return usabilityRule.ruleIdentifier() 
     90                                          .equals(defectDescription.getDefectId()); 
     91                                  } 
     92 
     93                              }); 
     94        if (!guidlineDescription.isPresent()) 
     95            throw new RuntimeException( 
     96                                       "error while initializing usability defect descriptions. No " + 
     97                                           "description text available for description " + 
     98                                           usabilityRule.ruleIdentifier()); 
    7699        return guidlineDescription.get(); 
    77100    } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/NoLetterOrDigitTextInputsEvaluator.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
    216 
     
    1630import de.ugoe.cs.autoquest.usability.tasktree.filter.TaskTreeFilter; 
    1731 
     32/** 
     33 * <p> 
     34 * TODO comment 
     35 * </p> 
     36 *  
     37 * @author Alexander Deicke 
     38 */ 
    1839public class NoLetterOrDigitTextInputsEvaluator extends RuleEvaluator { 
    1940 
    20     public NoLetterOrDigitTextInputsEvaluator(UsabilityRule evaluatedUsabilityRule, ITaskTree taskTree) { 
     41    public NoLetterOrDigitTextInputsEvaluator(UsabilityRule evaluatedUsabilityRule, 
     42                                              ITaskTree taskTree) 
     43    { 
    2144        super(evaluatedUsabilityRule, taskTree); 
    2245    } 
     
    2548    protected FilterStatistic nodesUnderEvaluation(ITaskTree taskTree) { 
    2649        Optional<FilterStatistic> cachedNodes = loadFromCache(TEXT_INPUT); 
    27         return cachedNodes.isPresent() ? cachedNodes.get() : cacheAndReturnNodes(taskTree, TEXT_INPUT); 
     50        return cachedNodes.isPresent() ? cachedNodes.get() : cacheAndReturnNodes(taskTree, 
     51                                                                                 TEXT_INPUT); 
    2852    } 
    29      
     53 
    3054    @Override 
    3155    protected FilterStatistic extractNodesFromTaskTree(ITaskTree taskTree) { 
    32         return new TaskTreeFilter(new IterativeDFSFilterStrategy()) 
    33             .filterByEventType(TEXT_INPUT).from(taskTree); 
     56        return new TaskTreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT) 
     57            .from(taskTree); 
    3458    } 
    3559 
    3660    @Override 
    3761    protected float calculateEvaluationMetric() { 
    38         Multiset<String> enteredTextFragments = aggregateEnteredTextFromTextInputs(this.filteredNodes.nodesMatchedFilter()); 
     62        Multiset<String> enteredTextFragments = 
     63            aggregateEnteredTextFromTextInputs(this.filteredNodes.nodesMatchedFilter()); 
    3964        int allCharactersCount = 0; 
    4065        int noLetterOrDigitCount = 0; 
    41         for(String textFragment : enteredTextFragments.elementSet()) { 
     66        for (String textFragment : enteredTextFragments.elementSet()) { 
    4267            int occurencesOfTextFragment = enteredTextFragments.count(textFragment); 
    4368            allCharactersCount += CharMatcher.ANY.countIn(textFragment) * occurencesOfTextFragment; 
    44             noLetterOrDigitCount += CharMatcher.forPredicate(characterIsLetterOrDigitPredicate()).countIn(textFragment) * occurencesOfTextFragment; 
     69            noLetterOrDigitCount += 
     70                CharMatcher.forPredicate(characterIsLetterOrDigitPredicate()).countIn(textFragment) * 
     71                    occurencesOfTextFragment; 
    4572        } 
    46         return allCharactersCount != 0 ? (float) noLetterOrDigitCount / (float) allCharactersCount : 0; 
     73        return allCharactersCount != 0 ? (float) noLetterOrDigitCount / (float) allCharactersCount 
     74            : 0; 
    4775    } 
    4876 
    4977    @Override 
    50     protected Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric) { 
     78    protected Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric) 
     79    { 
    5180        Optional<UsabilityDefectSeverityLevel> recommendationSeverityLevel = Optional.absent(); 
    5281        if (evaluationMetric > 0.1) // every 10th sign 
     
    6897        return recommendationSeverityLevel; 
    6998    } 
    70   
     99 
    71100} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/RuleEvaluator.java

    r1035 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
     
    1730import de.ugoe.cs.autoquest.usability.tasktree.filter.TaskTreeNodeFilter; 
    1831 
     32/** 
     33 * <p> 
     34 * TODO comment 
     35 * </p> 
     36 *  
     37 * @author Alexander Deicke 
     38 */ 
    1939public abstract class RuleEvaluator { 
    2040 
     
    3858 
    3959    @SuppressWarnings("rawtypes") 
    40     protected FilterStatistic cacheAndReturnNodes(ITaskTree taskTree, TaskTreeNodeFilter nodeFilter) { 
     60    protected FilterStatistic cacheAndReturnNodes(ITaskTree taskTree, TaskTreeNodeFilter nodeFilter) 
     61    { 
    4162        FilterStatistic textInputEvents = extractNodesFromTaskTree(taskTree); 
    4263        FilterStatisticCache.instance().addFilterStatistic(nodeFilter, textInputEvents); 
     
    5273            determineSeverityLevel(evaluationMetric); 
    5374        if (severityLevel.isPresent()) { 
    54             ruleEvaluationResult = 
    55                 Optional.of(createRuleEvaluationResult(severityLevel.get())); 
     75            ruleEvaluationResult = Optional.of(createRuleEvaluationResult(severityLevel.get())); 
    5676        } 
    5777        return ruleEvaluationResult; 
     
    5979 
    6080    protected abstract float calculateEvaluationMetric(); 
    61      
     81 
    6282    protected void storeEvaluationMetricForDefectDescription(String key, String value) { 
    6383        defectDescriptionMessageParameterValues.put(key, value); 
     
    6686    protected abstract Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric); 
    6787 
    68     public UsabilityDefect createRuleEvaluationResult(UsabilityDefectSeverityLevel severityLevelOfDefect) { 
     88    public UsabilityDefect createRuleEvaluationResult(UsabilityDefectSeverityLevel severityLevelOfDefect) 
     89    { 
    6990        return new UsabilityDefectFactory(UsabilityDefectXmlDescriptionResolver.instance()) 
    70             .createUsabilityGuidlineRecommendation(severityLevelOfDefect, 
    71                                                    evaluatedUsabilityRule, 
     91            .createUsabilityGuidlineRecommendation(severityLevelOfDefect, evaluatedUsabilityRule, 
    7292                                                   defectDescriptionMessageParameterValues); 
    7393    } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/TextInputEntryRepetitionsEvaluator.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
    216 
    317import static de.ugoe.cs.autoquest.usability.tasktree.filter.EventTypeFilter.TEXT_INPUT; 
    418import static de.ugoe.cs.autoquest.usability.util.TextInputUtil.aggregateEnteredTextFromTextInputs; 
     19import static java.lang.String.format; 
    520 
    621import com.google.common.base.Optional; 
     
    1631import de.ugoe.cs.autoquest.usability.tasktree.filter.TaskTreeFilter; 
    1732 
     33/** 
     34 * <p> 
     35 * TODO comment 
     36 * </p> 
     37 *  
     38 * @author Alexander Deicke 
     39 */ 
    1840public class TextInputEntryRepetitionsEvaluator extends RuleEvaluator { 
    1941 
    20     public TextInputEntryRepetitionsEvaluator(UsabilityRule evaluatedUsabilityRule, ITaskTree taskTree) { 
     42    public TextInputEntryRepetitionsEvaluator(UsabilityRule evaluatedUsabilityRule, 
     43                                              ITaskTree taskTree) 
     44    { 
    2145        super(evaluatedUsabilityRule, taskTree); 
    2246    } 
     
    2549    protected FilterStatistic nodesUnderEvaluation(ITaskTree taskTree) { 
    2650        Optional<FilterStatistic> cachedNodes = loadFromCache(TEXT_INPUT); 
    27         return cachedNodes.isPresent() ? cachedNodes.get() : cacheAndReturnNodes(taskTree, TEXT_INPUT); 
     51        return cachedNodes.isPresent() ? cachedNodes.get() : cacheAndReturnNodes(taskTree, 
     52                                                                                 TEXT_INPUT); 
    2853    } 
    29      
     54 
    3055    @Override 
    3156    protected FilterStatistic extractNodesFromTaskTree(ITaskTree taskTree) { 
    32         return new TaskTreeFilter(new IterativeDFSFilterStrategy()) 
    33             .filterByEventType(TEXT_INPUT).from(taskTree); 
     57        return new TaskTreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT) 
     58            .from(taskTree); 
    3459    } 
    3560 
    3661    @Override 
    3762    protected float calculateEvaluationMetric() { 
    38         Multiset<String> enteredTextFragments = aggregateEnteredTextFromTextInputs(this.filteredNodes.nodesMatchedFilter()); 
    39         Multiset<String> orderedTextFragmentsWithMultipleOccurences = onlyTextFragmentsWithMultipleOccurences(enteredTextFragments); 
    40         if(orderedTextFragmentsWithMultipleOccurences.isEmpty()) return 0; 
    41         String wordWithHighestRepetitionInTextFragments = orderedTextFragmentsWithMultipleOccurences.iterator().next(); 
     63        Multiset<String> enteredTextFragments = 
     64            aggregateEnteredTextFromTextInputs(this.filteredNodes.nodesMatchedFilter()); 
     65        Multiset<String> orderedTextFragmentsWithMultipleOccurences = 
     66            onlyTextFragmentsWithMultipleOccurences(enteredTextFragments); 
     67        if (orderedTextFragmentsWithMultipleOccurences.isEmpty()) 
     68            return 0; 
     69        String wordWithHighestRepetitionInTextFragments = 
     70            orderedTextFragmentsWithMultipleOccurences.iterator().next(); 
    4271        int numberOfRepeatedWords = orderedTextFragmentsWithMultipleOccurences.entrySet().size(); 
    43         int maxRepetitions = orderedTextFragmentsWithMultipleOccurences.count(wordWithHighestRepetitionInTextFragments); 
     72        int maxRepetitions = 
     73            orderedTextFragmentsWithMultipleOccurences 
     74                .count(wordWithHighestRepetitionInTextFragments); 
     75        storeEvaluationMetricForDefectDescription("textRepetitionRatio", 
     76                                                  format("textRepetitionRatio %s repeated tokens, up to %s repetitions per token", 
     77                                                         numberOfRepeatedWords, maxRepetitions)); 
    4478        return Math.max(numberOfRepeatedWords, maxRepetitions); 
    4579    } 
    46      
    47     private Multiset<String> onlyTextFragmentsWithMultipleOccurences(final Multiset<String> allTextInputs) { 
    48         return Multisets.copyHighestCountFirst(Multisets.filter(allTextInputs, new Predicate<String>() { 
    49              
    50             @Override 
    51             public boolean apply(String word) { 
    52                 return allTextInputs.count(word) > 1; 
    53             } 
    54              
    55         })); 
     80 
     81    private Multiset<String> onlyTextFragmentsWithMultipleOccurences(final Multiset<String> allTextInputs) 
     82    { 
     83        return Multisets.copyHighestCountFirst(Multisets.filter(allTextInputs, 
     84                                                                new Predicate<String>() { 
     85 
     86                                                                    @Override 
     87                                                                    public boolean apply(String word) 
     88                                                                    { 
     89                                                                        return allTextInputs 
     90                                                                            .count(word) > 1; 
     91                                                                    } 
     92 
     93                                                                })); 
    5694    } 
    5795 
    5896    @Override 
    59     protected Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric) { 
     97    protected Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric) 
     98    { 
    6099        Optional<UsabilityDefectSeverityLevel> recommendationSeverityLevel = Optional.absent(); 
    61100        if (evaluationMetric > 10) { 
     
    73112        return recommendationSeverityLevel; 
    74113    } 
    75      
     114 
    76115} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/TextInputRatioEvaluator.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; 
    216 
     
    1529import de.ugoe.cs.autoquest.usability.tasktree.filter.TaskTreeFilter; 
    1630 
     31/** 
     32 * <p> 
     33 * TODO comment 
     34 * </p> 
     35 *  
     36 * @author Alexander Deicke 
     37 */ 
    1738public class TextInputRatioEvaluator extends RuleEvaluator { 
    1839 
     
    2445    protected FilterStatistic nodesUnderEvaluation(ITaskTree taskTree) { 
    2546        Optional<FilterStatistic> cachedNodes = loadFromCache(TEXT_INPUT); 
    26         return cachedNodes.isPresent() ? cachedNodes.get() : cacheAndReturnNodes(taskTree, TEXT_INPUT); 
     47        return cachedNodes.isPresent() ? cachedNodes.get() : cacheAndReturnNodes(taskTree, 
     48                                                                                 TEXT_INPUT); 
    2749    } 
    2850 
    2951    @Override 
    3052    protected FilterStatistic extractNodesFromTaskTree(ITaskTree taskTree) { 
    31         return new TaskTreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT).from(taskTree); 
     53        return new TaskTreeFilter(new IterativeDFSFilterStrategy()).filterByEventType(TEXT_INPUT) 
     54            .from(taskTree); 
    3255    } 
    3356 
     
    3861        return textInputEvents / (textInputEvents + nonTextInputEvents); 
    3962    } 
    40      
     63 
    4164    private int nrOfEventNodesNotMatchedFilter() { 
    42         return Iterables.size( 
    43             Iterables.filter(this.filteredNodes.nodesNotMatchedFilter(), new Predicate<ITaskTreeNode>() { 
    44              
    45                 @Override 
    46                 public boolean apply(ITaskTreeNode node) { 
    47                     return  (node.getChildren() == null) || (node.getChildren().size() == 0); 
    48                 } 
    49             }) 
    50         ); 
     65        return Iterables.size(Iterables.filter(this.filteredNodes.nodesNotMatchedFilter(), 
     66                                              new Predicate<ITaskTreeNode>() { 
     67 
     68                                                   @Override 
     69                                                   public boolean apply(ITaskTreeNode node) { 
     70                                                       return (node.getChildren() == null) || 
     71                                                           (node.getChildren().size() == 0); 
     72                                                   } 
     73                                               })); 
    5174    } 
    5275 
    5376    @Override 
    54     protected Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric) { 
     77    protected Optional<UsabilityDefectSeverityLevel> determineSeverityLevel(float evaluationMetric) 
     78    { 
    5579        Optional<UsabilityDefectSeverityLevel> recommendationSeverityLevel = Optional.absent(); 
    5680        if (evaluationMetric > 0.9) { 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/EmptyUsabilityRuleset.java

    r1034 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
     
    1024import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect; 
    1125 
     26/** 
     27 * <p> 
     28 * TODO comment 
     29 * </p> 
     30 *  
     31 * @author Alexander Deicke 
     32 */ 
    1233public class EmptyUsabilityRuleset implements UsabilityRuleset { 
    13      
     34 
    1435    private enum EmptyUsabilityRule implements UsabilityRule { 
    15         ; 
     36        ; 
    1637 
    1738        @Override 
     
    2647 
    2748    } 
    28      
    29     private final EnumSet<EmptyUsabilityRule> EMPTY_USABILITY_RULESET =  
    30             EnumSet.noneOf(EmptyUsabilityRule.class); 
     49 
     50    private final EnumSet<EmptyUsabilityRule> EMPTY_USABILITY_RULESET = EnumSet 
     51        .noneOf(EmptyUsabilityRule.class); 
    3152 
    3253    @Override 
    3354    public EnumSet<? extends UsabilityRule> evaluationRules() { 
    34         return EMPTY_USABILITY_RULESET; 
     55        return EMPTY_USABILITY_RULESET; 
    3556    } 
    3657 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/MouseInteractionUsabilityRuleset.java

    r1034 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
     
    822import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect; 
    923 
     24/** 
     25 * <p> 
     26 * TODO comment 
     27 * </p> 
     28 *  
     29 * @author Alexander Deicke 
     30 */ 
    1031public class MouseInteractionUsabilityRuleset implements UsabilityRuleset { 
    1132 
    1233    private enum MouseInteractionUsabilityRule implements UsabilityRule { 
    13          
     34 
    1435        MOUSE_INTERACTION { 
    1536 
     
    2546                return this.name(); 
    2647            } 
    27              
     48 
    2849        }; 
    2950 
    3051        public abstract Optional<UsabilityDefect> evaluate(ITaskTree taskTree); 
    3152    } 
    32      
    33     private final EnumSet<MouseInteractionUsabilityRule> MOUSE_INTERACTION_USABILITY_RULESET = EnumSet 
    34             .allOf(MouseInteractionUsabilityRule.class); 
    35      
     53 
     54    private final EnumSet<MouseInteractionUsabilityRule> MOUSE_INTERACTION_USABILITY_RULESET = 
     55        EnumSet.allOf(MouseInteractionUsabilityRule.class); 
     56 
    3657    @Override 
    3758    public EnumSet<? extends UsabilityRule> evaluationRules() { 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/RulesetFactory.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
    3 import lombok.AccessLevel; 
    4 import lombok.NoArgsConstructor; 
     17/** 
     18 * <p> 
     19 * TODO comment 
     20 * </p> 
     21 *  
     22 * @author Alexander Deicke 
     23 */ 
     24public class RulesetFactory { 
    525 
    6 @NoArgsConstructor(access = AccessLevel.PRIVATE) 
    7 public class RulesetFactory { 
    8      
     26    private RulesetFactory() { 
     27        // no instantiation allowed 
     28    } 
     29 
    930    public static EmptyUsabilityRuleset emptyUsabilityRuleset() { 
    10         return new EmptyUsabilityRuleset(); 
     31        return new EmptyUsabilityRuleset(); 
    1132    } 
    12      
     33 
    1334    public static TextInputUsabiliyRuleset textInputUsabiliyRuleset() { 
    14         return new TextInputUsabiliyRuleset(); 
     35        return new TextInputUsabiliyRuleset(); 
    1536    } 
    16      
     37 
    1738    public static MouseInteractionUsabilityRuleset mouseInteractionUsabiliyRuleset() { 
    1839        return new MouseInteractionUsabilityRuleset(); 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/TextInputUsabiliyRuleset.java

    r1034 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
     
    1225import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.TextInputRatioEvaluator; 
    1326 
     27/** 
     28 * <p> 
     29 * TODO comment 
     30 * </p> 
     31 *  
     32 * @author Alexander Deicke 
     33 */ 
    1434public class TextInputUsabiliyRuleset implements UsabilityRuleset { 
    1535 
     
    1737 
    1838        TEXT_FIELD_INPUT_RATIO { 
    19              
     39 
    2040            @Override 
    2141            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) { 
     
    5676            } 
    5777 
     78        }; 
    5879 
    59         }; 
    60          
    6180        public abstract Optional<UsabilityDefect> evaluate(ITaskTree taskTree); 
    6281 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/UsabilityRule.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
     
    620import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect; 
    721 
     22/** 
     23 * <p> 
     24 * TODO comment 
     25 * </p> 
     26 *  
     27 * @author Alexander Deicke 
     28 */ 
    829public interface UsabilityRule { 
    9      
     30 
    1031    public String ruleIdentifier(); 
    11      
     32 
    1233    public Optional<UsabilityDefect> evaluate(ITaskTree taskTree); 
    1334 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/UsabilityRuleset.java

    r1034 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.evaluation.rule.set; 
    216 
    317import java.util.EnumSet; 
    418 
    5  
     19/** 
     20 * <p> 
     21 * TODO comment 
     22 * </p> 
     23 *  
     24 * @author Alexander Deicke 
     25 */ 
    626public interface UsabilityRuleset { 
    727 
    828    public EnumSet<? extends UsabilityRule> evaluationRules(); 
    9      
     29 
    1030} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/EventTargetFilter.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
     
    1125import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    1226 
     27/** 
     28 * <p> 
     29 * TODO comment 
     30 * </p> 
     31 *  
     32 * @author Alexander Deicke 
     33 */ 
    1334public enum EventTargetFilter implements TaskTreeNodeFilter<IEventTarget> { 
    1435 
    1536    TEXT_FIELD(ITextField.class), 
    16      
     37 
    1738    TEXT_AREA(ITextArea.class); 
    18      
     39 
    1940    private Class<? extends IEventTarget> eventTargetClazz; 
    20      
     41 
    2142    private EventTargetFilter(Class<? extends IEventTarget> eventTargetClazz) { 
    2243        this.eventTargetClazz = eventTargetClazz; 
     
    3758        return Predicates.and(instanceOfIEventTaskPredicate, nodeHoldsInstanceOfFilterArgument); 
    3859    } 
    39      
     60 
    4061    private Function<ITaskTreeNode, IEventTarget> nodeExtractionFunction() { 
    4162        return new Function<ITaskTreeNode, IEventTarget>() { 
    42              
     63 
    4364            @Override 
    4465            public IEventTarget apply(ITaskTreeNode treeNode) { 
     
    4768        }; 
    4869    } 
    49      
     70 
    5071} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/EventTypeFilter.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
     
    620 
    721import de.ugoe.cs.autoquest.eventcore.IEventType; 
     22import de.ugoe.cs.autoquest.eventcore.gui.IInteraction; 
    823import de.ugoe.cs.autoquest.eventcore.gui.MouseButtonInteraction; 
    924import de.ugoe.cs.autoquest.eventcore.gui.MouseInteraction; 
     
    1227import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    1328 
     29/** 
     30 * <p> 
     31 * TODO comment 
     32 * </p> 
     33 *  
     34 * @author Alexander Deicke 
     35 */ 
    1436public enum EventTypeFilter implements TaskTreeNodeFilter<IEventType> { 
     37 
     38    MOUSE_BUTTON_INTERACTION(MouseButtonInteraction.class), 
     39     
     40    MOUSE_INTERACTION(MouseInteraction.class), 
    1541     
    1642    TEXT_INPUT(TextInput.class), 
    1743     
    18     MOUSE_INTERACTION(MouseInteraction.class), 
    19      
    20     MOUSE_BUTTON_INTERACTION(MouseButtonInteraction.class); 
    21      
     44    USER_INTERACTION(IInteraction.class); 
     45 
    2246    private Class<? extends IEventType> eventTypeClazz; 
    23      
     47 
    2448    private EventTypeFilter(Class<? extends IEventType> eventTypeClazz) { 
    2549        this.eventTypeClazz = eventTypeClazz; 
     
    3155        return (Class<IEventType>) eventTypeClazz; 
    3256    } 
    33      
     57 
    3458    @SuppressWarnings("rawtypes") 
    3559    @Override 
     
    4064        return Predicates.and(instanceOfIEventTaskPredicate, nodeHoldsInstanceOfFilterArgument); 
    4165    } 
    42      
     66 
    4367    private Function<ITaskTreeNode, IEventType> nodeExtractionFunction() { 
    4468        return new Function<ITaskTreeNode, IEventType>() { 
    45              
     69 
    4670            @Override 
    4771            public IEventType apply(ITaskTreeNode treeNode) { 
     
    5074        }; 
    5175    } 
    52     } 
     76} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/FilterStatistic.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
     
    418 
    519import com.google.common.base.Predicate; 
     20import com.google.common.collect.LinkedListMultimap; 
    621import com.google.common.collect.Lists; 
     22import com.google.common.collect.Multimap; 
    723 
     24import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 
     25import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
    826import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    927 
     28/** 
     29 * <p> 
     30 * TODO comment 
     31 * </p> 
     32 *  
     33 * @author Alexander Deicke 
     34 */ 
    1035public class FilterStatistic { 
    11      
     36 
    1237    @SuppressWarnings("rawtypes") 
    1338    private final Predicate filterPredicate; 
    1439 
    1540    private List<ITaskTreeNode> filteredNodes = Lists.newArrayList(); 
    16      
     41 
    1742    private List<ITaskTreeNode> nodesNotMatchedFilter = Lists.newArrayList(); 
    18      
     43 
    1944    @SuppressWarnings("rawtypes") 
    2045    public FilterStatistic(Predicate filterPredicate) { 
    2146        this.filterPredicate = filterPredicate; 
    2247    } 
    23      
     48 
    2449    @SuppressWarnings("unchecked") 
    2550    public void addNode(ITaskTreeNode node) { 
    2651        if (filterPredicate.apply(node)) { 
    2752            filteredNodes.add(node); 
    28         } else { 
     53        } 
     54        else { 
    2955            nodesNotMatchedFilter.add(node); 
    3056        } 
    3157    } 
    32      
     58 
    3359    public List<ITaskTreeNode> nodesMatchedFilter() { 
    3460        return this.filteredNodes; 
    3561    } 
    36      
     62 
    3763    public int nrOfNodesMatchedFilter() { 
    3864        return this.filteredNodes.size(); 
    3965    } 
    40      
     66 
    4167    public List<ITaskTreeNode> nodesNotMatchedFilter() { 
    4268        return this.nodesNotMatchedFilter; 
    4369    } 
    44      
     70 
    4571    public int nrOfNodesNotMatchedFilter() { 
    4672        return this.nodesNotMatchedFilter.size(); 
    4773    } 
    48      
     74 
     75    /** 
     76     * <p> 
     77     * TODO: comment 
     78     * </p> 
     79     * 
     80     * @param eventTargetParent 
     81     * @return 
     82     */ 
     83    public Multimap<IGUIElement, ITaskTreeNode> groupBy() { 
     84        Multimap<IGUIElement, ITaskTreeNode> groupedNodes = LinkedListMultimap.create(); 
     85        for(ITaskTreeNode node : filteredNodes) { 
     86            IGUIElement eventTask = (IGUIElement) ((IEventTask) node).getEventTarget(); 
     87            groupedNodes.put(eventTask.getParent(), node); 
     88        } 
     89        return groupedNodes; 
     90    } 
     91 
    4992} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/FilterStatisticCache.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
     
    721import com.google.common.cache.CacheBuilder; 
    822 
     23/** 
     24 * <p> 
     25 * TODO comment 
     26 * </p> 
     27 *  
     28 * @author Alexander Deicke 
     29 */ 
    930public class FilterStatisticCache { 
    1031 
    1132    private static final FilterStatisticCache instance = new FilterStatisticCache(); 
    12      
     33 
    1334    @SuppressWarnings("rawtypes") 
    1435    private Cache<TaskTreeNodeFilter, FilterStatistic> cache; 
    15      
     36 
    1637    private FilterStatisticCache() { 
    1738        this.cache = CacheBuilder.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES).build(); 
    1839    } 
    19      
     40 
    2041    public static FilterStatisticCache instance() { 
    2142        return instance; 
    2243    } 
    23      
     44 
    2445    @SuppressWarnings("rawtypes") 
    2546    public void addFilterStatistic(TaskTreeNodeFilter nodeFilter, FilterStatistic filterStatistic) { 
    2647        this.cache.put(nodeFilter, filterStatistic); 
    2748    } 
    28      
     49 
    2950    @SuppressWarnings("rawtypes") 
    3051    public Optional<FilterStatistic> getFilterStatistic(TaskTreeNodeFilter nodeFilter) { 
    3152        return Optional.fromNullable(this.cache.getIfPresent(nodeFilter)); 
    3253    } 
    33      
     54 
    3455    public void clear() { 
    3556        this.cache.invalidateAll(); 
    3657    } 
    37      
     58 
    3859} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/IterativeDFSFilterStrategy.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
     
    1024import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    1125 
     26/** 
     27 * <p> 
     28 * TODO comment 
     29 * </p> 
     30 *  
     31 * @author Alexander Deicke 
     32 */ 
    1233public class IterativeDFSFilterStrategy implements TaskTreeFilterStrategy { 
    13      
     34 
    1435    private FilterStatistic filterStatistic; 
    15      
     36 
    1637    @SuppressWarnings("unchecked") 
    1738    @Override 
     
    3152        return this.filterStatistic; 
    3253    } 
    33      
     54 
     55    @SuppressWarnings("unchecked") 
     56    @Override 
     57    public FilterStatistic filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType) { 
     58        Predicate<ITaskTreeNode> filterPredicate = nodeType.filterPredicate(); 
     59        this.filterStatistic = new FilterStatistic(filterPredicate); 
     60        traverse(taskTree); 
     61        return this.filterStatistic; 
     62    } 
     63 
    3464    private void traverse(ITaskTree taskTree) { 
    3565        Stack<ITaskTreeNode> unvisitedNodes = new Stack<ITaskTreeNode>(); 
    3666        unvisitedNodes.push(taskTree.getRoot()); 
    37         while(stillUnvisitedNodes(unvisitedNodes)) { 
     67        while (stillUnvisitedNodes(unvisitedNodes)) { 
    3868            ITaskTreeNode node = unvisitedNodes.pop(); 
    3969            processCurrentNode(node); 
     
    4979        this.filterStatistic.addNode(node); 
    5080    } 
    51      
     81 
    5282    private void processChildrenOfCurrentNode(Stack<ITaskTreeNode> unvisitedNodes, 
    53                                               ITaskTreeNode node) { 
    54         for(ITaskTreeNode child : node.getChildren()) { 
     83                                              ITaskTreeNode node) 
     84    { 
     85        for (ITaskTreeNode child : node.getChildren()) { 
    5586            unvisitedNodes.push(child); 
    5687        } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/TaskTreeFilter.java

    r1030 r1040  
     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. 
    114 
    215package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     
    619import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
    720 
     21/** 
     22 * <p> 
     23 * TODO comment 
     24 * </p> 
     25 *  
     26 * @author Alexander Deicke 
     27 */ 
    828public class TaskTreeFilter { 
    9      
     29 
    1030    private final TaskTreeFilterStrategy taskTreeFilterStrategy; 
    11      
     31 
    1232    public TaskTreeFilter(TaskTreeFilterStrategy treeTraversalStrategy) { 
    1333        Preconditions.checkNotNull(treeTraversalStrategy); 
     
    2141    public FilterEventTypeStep filterByEventType(EventTypeFilter eventType) { 
    2242        return new FilterEventTypeStep(eventType); 
     43    } 
     44 
     45    public FilterNodeTypeStep filterByNodeType(TaskTreeNodeTypeFilter nodeType) { 
     46        return new FilterNodeTypeStep(nodeType); 
    2347    } 
    2448 
     
    5074 
    5175    } 
     76 
     77    public class FilterNodeTypeStep { 
     78 
     79        private final TaskTreeNodeTypeFilter nodeType; 
     80 
     81        public FilterNodeTypeStep(TaskTreeNodeTypeFilter nodeType) { 
     82            this.nodeType = nodeType; 
     83        } 
     84 
     85        public FilterStatistic from(ITaskTree taskTree) { 
     86            return taskTreeFilterStrategy.filter(taskTree, nodeType); 
     87        } 
     88 
     89    } 
    5290} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/TaskTreeFilterStrategy.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
    317import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
    418 
     19/** 
     20 * <p> 
     21 * TODO comment 
     22 * </p> 
     23 *  
     24 * @author Alexander Deicke 
     25 */ 
    526public interface TaskTreeFilterStrategy { 
    627 
     
    829 
    930    public FilterStatistic filter(ITaskTree taskTree, EventTypeFilter eventType); 
    10    
     31 
     32    public FilterStatistic filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType); 
     33 
    1134} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filter/TaskTreeNodeFilter.java

    r1030 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.tasktree.filter; 
    216 
    317import com.google.common.base.Predicate; 
    418 
     19/** 
     20 * <p> 
     21 * TODO comment 
     22 * </p> 
     23 *  
     24 * @author Alexander Deicke 
     25 */ 
    526public interface TaskTreeNodeFilter<T> { 
    627 
    728    public Class<T> clazz(); 
    8      
     29 
    930    @SuppressWarnings("rawtypes") 
    1031    public Predicate filterPredicate(); 
    11      
     32 
    1233} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/TextInputUtil.java

    r1031 r1040  
     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 
    115package de.ugoe.cs.autoquest.usability.util; 
    216 
     
    1529import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    1630 
     31/** 
     32 * <p> 
     33 * TODO comment 
     34 * </p> 
     35 *  
     36 * @author Alexander Deicke 
     37 */ 
    1738public class TextInputUtil { 
    18      
    19     public static Multiset<String> aggregateEnteredTextFromTextInputs(List<ITaskTreeNode> nodesWithTextInputEvents) { 
     39 
     40    private TextInputUtil() { 
     41        // util class 
     42    } 
     43 
     44    public static Multiset<String> aggregateEnteredTextFromTextInputs(List<ITaskTreeNode> nodesWithTextInputEvents) 
     45    { 
    2046        List<Iterable<String>> allTextInputs = Lists.newArrayList(); 
    21         for(ITaskTreeNode nodeWithTextInput : nodesWithTextInputEvents) { 
     47        for (ITaskTreeNode nodeWithTextInput : nodesWithTextInputEvents) { 
    2248            TextInput textInput = (TextInput) ((IEventTask) nodeWithTextInput).getEventType(); 
    2349            allTextInputs.add(splitTextIntoWordsAndSigns(textInput.getEnteredText())); 
     
    2551        return HashMultiset.create(Iterables.concat(allTextInputs)); 
    2652    } 
    27      
     53 
    2854    public static Iterable<String> splitTextIntoWordsAndSigns(String enteredText) { 
    29         CharMatcher onlyWords = CharMatcher.WHITESPACE.or(CharMatcher.forPredicate(characterIsJavaIdentifierPartPredicate())); 
    30         CharMatcher onlySigns = CharMatcher.WHITESPACE.or(CharMatcher.forPredicate(characterIsJavaIdentifierPartPredicate()).negate()); 
    31         Iterable<String> words = Splitter.on(onlyWords).omitEmptyStrings().trimResults().split(enteredText); 
    32         Iterable<String> signs = Splitter.on(onlySigns).omitEmptyStrings().trimResults().split(enteredText); 
     55        CharMatcher onlyWords = 
     56            CharMatcher.WHITESPACE.or(CharMatcher 
     57                .forPredicate(characterIsJavaIdentifierPartPredicate())); 
     58        CharMatcher onlySigns = 
     59            CharMatcher.WHITESPACE.or(CharMatcher 
     60                .forPredicate(characterIsJavaIdentifierPartPredicate()).negate()); 
     61        Iterable<String> words = 
     62            Splitter.on(onlyWords).omitEmptyStrings().trimResults().split(enteredText); 
     63        Iterable<String> signs = 
     64            Splitter.on(onlySigns).omitEmptyStrings().trimResults().split(enteredText); 
    3365        return Iterables.concat(words, signs); 
    3466    } 
    35      
     67 
    3668    public static Predicate<Character> characterIsJavaIdentifierPartPredicate() { 
    3769        return new Predicate<Character>() { 
    38              
     70 
    3971            @Override 
    4072            public boolean apply(Character character) { 
    41                return !Character.isJavaIdentifierPart(character); 
     73                return !Character.isJavaIdentifierPart(character); 
    4274            } 
    43              
     75 
    4476        }; 
    4577    } 
    46      
     78 
    4779    public static Predicate<Character> characterIsLetterOrDigitPredicate() { 
    4880        return new Predicate<Character>() { 
    49              
     81 
    5082            @Override 
    5183            public boolean apply(Character character) { 
    5284                return !Character.isLetterOrDigit(character); 
    5385            } 
    54              
     86 
    5587        }; 
    5688    } 
Note: See TracChangeset for help on using the changeset viewer.