Ignore:
Timestamp:
03/18/13 11:54:15 (12 years ago)
Author:
pharms
Message:
  • complete refactoring of task detection
  • many performance improvements in task detection
  • improved merging of sequences using Myers diff algorithm
Location:
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation
Files:
2 added
1 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java

    r1106 r1127  
    184184            } 
    185185            else { 
    186                 status = RuleApplicationStatus.RULE_NOT_APPLIED; 
    187             } 
    188              
    189             assertTrue(status != RuleApplicationStatus.RULE_APPLICATION_FEASIBLE); 
     186                status = RuleApplicationStatus.NOT_APPLIED; 
     187            } 
     188             
     189            assertTrue(status != RuleApplicationStatus.FEASIBLE); 
    190190             
    191191            if ((result != null) && (result.getNewlyCreatedParentNodes() != null)) { 
     
    195195            } 
    196196             
    197             if (status == RuleApplicationStatus.RULE_NOT_APPLIED) { 
     197            if (status == RuleApplicationStatus.NOT_APPLIED) { 
    198198                toBeAppliedOn.pop(); 
    199199            } 
    200200             
    201201        } 
    202         while ((!toBeAppliedOn.isEmpty()) || 
    203                (status == RuleApplicationStatus.RULE_APPLICATION_FINISHED)); 
     202        while ((!toBeAppliedOn.isEmpty()) || (status == RuleApplicationStatus.FINISHED)); 
    204203 
    205204        return taskTreeNodeFactory.createTaskTree(sequence); 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/IterationOfSubtreesDetectionRuleTest.java

    r1106 r1127  
    2929 * @author 2012, last modified by $Author: patrick$ 
    3030 */ 
    31 public class DefaultIterationDetectionRuleTest extends AbstractTemporalRelationshipTC { 
     31public class IterationOfSubtreesDetectionRuleTest extends AbstractTemporalRelationshipTC { 
    3232 
    3333    /** 
     
    4242            ("Sequence sequence1 {" + 
    4343             "  Event bla {}" + 
    44              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
    45  
    46         simulateEvent(event1, element1); 
    47         new TaskTreeChecker().assertTaskTree 
    48             ("Sequence sequence1 {" + 
    49              "  Iteration iteration1 {" + 
    50              "    Event bla {}" + 
    51              "  }" + 
    52              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
    53  
    54         simulateEvent(event1, element1); 
    55         new TaskTreeChecker().assertTaskTree 
    56             ("Sequence sequence1 {" + 
    57              "  Iteration iteration1 {" + 
    58              "    Event bla {}" + 
    59              "  }" + 
    60              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     44             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
     45 
     46        simulateEvent(event1, element1); 
     47        new TaskTreeChecker().assertTaskTree 
     48            ("Sequence sequence1 {" + 
     49             "  Iteration iteration1 {" + 
     50             "    Event bla {}" + 
     51             "  }" + 
     52             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
     53 
     54        simulateEvent(event1, element1); 
     55        new TaskTreeChecker().assertTaskTree 
     56            ("Sequence sequence1 {" + 
     57             "  Iteration iteration1 {" + 
     58             "    Event bla {}" + 
     59             "  }" + 
     60             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    6161 
    6262        for (int i = 0; i < 10; i++) { 
     
    6969             "    Event bla {}" + 
    7070             "  }" + 
    71              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     71             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    7272 
    7373        // now test with preceding and trailing other events 
     
    9595             "  Event blup {}" + 
    9696             "  Event bli {}" + 
    97              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     97             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    9898 
    9999        // now test with iterations of iterations 
     
    136136             "    }" + 
    137137             "  }" + 
    138              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     138             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    139139 
    140140    } 
     
    157157             "  Event bli {}" + 
    158158             "  Event blup {}" + 
    159              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
    160  
    161         simulateEvent(event1, element1); 
    162         simulateEvent(event2, element1); 
    163         simulateEvent(event3, element1); 
    164         new TaskTreeChecker().assertTaskTree 
    165             ("Sequence sequence1 {" + 
    166              "  Iteration iteration1 {" + 
    167              "    Sequence sequence2 {" + 
    168              "      Event bla {}" + 
    169              "      Event bli {}" + 
    170              "      Event blup {}" + 
    171              "    }" + 
    172              "  }" + 
    173              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
    174  
    175         simulateEvent(event1, element1); 
    176         simulateEvent(event2, element1); 
    177         simulateEvent(event3, element1); 
    178         new TaskTreeChecker().assertTaskTree 
    179             ("Sequence sequence1 {" + 
    180              "  Iteration iteration1 {" + 
    181              "    Sequence sequence2 {" + 
    182              "      Event bla {}" + 
    183              "      Event bli {}" + 
    184              "      Event blup {}" + 
    185              "    }" + 
    186              "  }" + 
    187              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     159             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
     160 
     161        simulateEvent(event1, element1); 
     162        simulateEvent(event2, element1); 
     163        simulateEvent(event3, element1); 
     164        new TaskTreeChecker().assertTaskTree 
     165            ("Sequence sequence1 {" + 
     166             "  Iteration iteration1 {" + 
     167             "    Sequence sequence2 {" + 
     168             "      Event bla {}" + 
     169             "      Event bli {}" + 
     170             "      Event blup {}" + 
     171             "    }" + 
     172             "  }" + 
     173             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
     174 
     175        simulateEvent(event1, element1); 
     176        simulateEvent(event2, element1); 
     177        simulateEvent(event3, element1); 
     178        new TaskTreeChecker().assertTaskTree 
     179            ("Sequence sequence1 {" + 
     180             "  Iteration iteration1 {" + 
     181             "    Sequence sequence2 {" + 
     182             "      Event bla {}" + 
     183             "      Event bli {}" + 
     184             "      Event blup {}" + 
     185             "    }" + 
     186             "  }" + 
     187             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    188188 
    189189        for (int i = 0; i < 10; i++) { 
     
    202202             "    }" + 
    203203             "  }" + 
    204              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     204             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    205205 
    206206        // now test with preceding and trailing other events 
     
    242242             "  Event blo {}" + 
    243243             "  Event ble {}" + 
    244              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     244             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    245245 
    246246        // now test with iterations of iterations 
     
    310310             "    }" + 
    311311             "  }" + 
    312              "}", getTaskTree(DefaultIterationDetectionRule.class, null)); 
     312             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null)); 
    313313    } 
    314314 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceDependingOnEventTypeDetectionRuleTest.java

    r1106 r1127  
    2828 * @author 2011, last modified by $Author: $ 
    2929 */ 
    30 public class DefaultGuiEventSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC { 
     30public class SequenceDependingOnEventTypeDetectionRuleTest extends AbstractTemporalRelationshipTC { 
    3131     
    3232    /** 
     
    4343             "  Event start {}" + 
    4444             "  Event end {}" + 
    45              "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null)); 
     45             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null)); 
    4646    } 
    4747     
     
    6262             "  Event bla {}" + 
    6363             "  Event end {}" + 
    64              "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null)); 
     64             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null)); 
    6565    } 
    6666     
     
    9696             "    Event end {}" + 
    9797             "  }" + 
    98              "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null)); 
     98             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null)); 
    9999    } 
    100100     
     
    128128             "  }" + 
    129129             "  Event startFinish {}" + 
    130              "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null)); 
     130             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null)); 
    131131    } 
    132132 
     
    190190             "  }" + 
    191191             "  Event finish {}" + 
    192              "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null)); 
     192             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null)); 
    193193    } 
    194194 
     
    260260             "  }" + 
    261261             "  Event finish {}" + 
    262              "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null)); 
     262             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null)); 
    263263    } 
    264264     
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java

    r1109 r1127  
    2020import de.ugoe.cs.autoquest.eventcore.gui.IInteraction; 
    2121import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker; 
     22import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality; 
    2223import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    2324import de.ugoe.cs.autoquest.test.DummyInteraction; 
     
    2930 * @author 2012, last modified by $Author: patrick$ 
    3031 */ 
    31 public class DefaultTaskSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC { 
     32public class SequenceForTaskDetectionRuleTest extends AbstractTemporalRelationshipTC { 
    3233 
    3334    /** 
     
    6566        simulateEvent(new DummyInteraction("noise8", 1), element1); 
    6667         
    67         new TaskTreeChecker().assertTaskTree 
    68             ("Sequence sequence1 {" + 
    69              "  Event noise0 {}" + 
    70              "  Sequence sequence2 {" + 
    71              "    Event action1 {}" + 
    72              "    Event action2 {}" + 
    73              "    Event action3 {}" + 
    74              "    Event action4 {}" + 
     68        new TaskTreeChecker(true).assertTaskTree 
     69            ("Sequence root {" + 
     70             "  Sequence session1 {" + 
     71             "    Event noise0 {}" + 
     72             "    Sequence sequence2 {" + 
     73             "      Event action1 {}" + 
     74             "      Event action2 {}" + 
     75             "      Event action3 {}" + 
     76             "      Event action4 {}" + 
     77             "    }" + 
     78             "    Event noise1 {}" + 
     79             "    Event noise2 {}" + 
     80             "    Sequence sequence2 {" + 
     81             "      Event action1 {}" + 
     82             "      Event action2 {}" + 
     83             "      Event action3 {}" + 
     84             "      Event action4 {}" + 
     85             "    }" + 
     86             "    Event noise3 {}" + 
     87             "    Event noise4 {}" + 
     88             "    Event noise5 {}" + 
     89             "    Event noise6 {}" + 
     90             "    Sequence sequence2 {" + 
     91             "      Event action1 {}" + 
     92             "      Event action2 {}" + 
     93             "      Event action3 {}" + 
     94             "      Event action4 {}" + 
     95             "    }" + 
     96             "    Event noise7 {}" + 
     97             "    Event noise8 {}" + 
    7598             "  }" + 
    76              "  Event noise1 {}" + 
    77              "  Event noise2 {}" + 
    78              "  Sequence sequence2 {" + 
    79              "    Event action1 {}" + 
    80              "    Event action2 {}" + 
    81              "    Event action3 {}" + 
    82              "    Event action4 {}" + 
    83              "  }" + 
    84              "  Event noise3 {}" + 
    85              "  Event noise4 {}" + 
    86              "  Event noise5 {}" + 
    87              "  Event noise6 {}" + 
    88              "  Sequence sequence2 {" + 
    89              "    Event action1 {}" + 
    90              "    Event action2 {}" + 
    91              "    Event action3 {}" + 
    92              "    Event action4 {}" + 
    93              "  }" + 
    94              "  Event noise7 {}" + 
    95              "  Event noise8 {}" + 
    96              "}", getTaskTree()); 
     99             "}", getTaskTree(SequenceForTaskDetectionRule.class, NodeEquality.LEXICALLY_EQUAL)); 
    97100 
    98101    } 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnGuiElementDetectionRuleTest.java

    r1106 r1127  
    2828 * @author 2011, last modified by $Author: $ 
    2929 */ 
    30 public class DefaultGuiElementSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC { 
     30public class SequenceOnGuiElementDetectionRuleTest extends AbstractTemporalRelationshipTC { 
    3131     
    3232    /** 
     
    6262             "  Event blu {}" + 
    6363             "  Event bla {}" + 
    64              "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null)); 
     64             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null)); 
    6565    } 
    6666 
     
    103103             "    Event bla {}" + 
    104104             "  }" + 
    105              "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null)); 
     105             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null)); 
    106106    } 
    107107 
     
    162162             "    Event blo {}" + 
    163163             "  }" + 
    164              "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null)); 
     164             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null)); 
    165165    } 
    166166 
     
    233233             "    }" + 
    234234             "  }" + 
    235              "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null)); 
     235             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null)); 
    236236    } 
    237237 
Note: See TracChangeset for help on using the changeset viewer.