Index: /trunk/quest-core-usability/pom.xml
===================================================================
--- /trunk/quest-core-usability/pom.xml	(revision 442)
+++ /trunk/quest-core-usability/pom.xml	(revision 442)
@@ -0,0 +1,50 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>de.ugoe.cs.usability</groupId>
+  <artifactId>usabilityevaluationmanager</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <name>UsabilityEvaluationManager</name>
+  <scm>
+    <url>https://www.trex.informatik.uni-goettingen.de/svn/swephd/pharms/tasktree/trunk/UsabilityEvaluationManager</url>
+  </scm>
+  <dependencies>
+    <dependency>
+        <groupId>de.ugoe.cs.quest</groupId>
+        <artifactId>quest-core-tasktrees</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>4.8.1</version>
+        <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.jvnet.jaxb2.maven2</groupId>
+        <artifactId>maven-jaxb2-plugin</artifactId>
+        <version>0.8.2</version>
+        <configuration>
+          <generatePackage>de.ugoe.cs.quest.usability</generatePackage>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.5.1</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/TextInputStatisticsRule.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/TextInputStatisticsRule.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/TextInputStatisticsRule.java	(revision 442)
@@ -0,0 +1,412 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: TextInputStatisticsRule.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTree;
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode;
+import de.ugoe.cs.quest.tasktrees.treeifc.TextInputInteractionTask;
+import de.ugoe.cs.tasktree.guimodel.TextArea;
+import de.ugoe.cs.tasktree.guimodel.TextField;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 16.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class TextInputStatisticsRule implements de.ugoe.cs.quest.usability.UsabilityEvaluationRule
+{
+
+  //-----------------------------------------------------------------------------------------------
+  /* (non-Javadoc)
+   * @see de.ugoe.cs.usability.UsabilityEvaluationRule#evaluate(TaskTree)
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Override
+  public UsabilityEvaluationResult evaluate(TaskTree taskTree)
+  {
+    TextInputStatistics statistics = new TextInputStatistics();
+    calculateStatistics(taskTree.getRoot(), statistics);
+    
+    UsabilityEvaluationResult results = new UsabilityEvaluationResult();
+    analyzeStatistics(statistics, results);
+    
+    return results;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param statistics
+   * @param results
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void analyzeStatistics(TextInputStatistics statistics, UsabilityEvaluationResult results)
+  {
+    checkTextInputRatio(statistics, results);
+    checkTextFieldEntryRepetitions(statistics, results);
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param statistics
+   * @param results 
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void checkTextInputRatio(TextInputStatistics       statistics,
+                                   UsabilityEvaluationResult results)
+  {
+    float allTextFieldInputs =
+      statistics.getNoOfTextFieldInputs() + statistics.getNoOfTextAreaInputs();
+    
+    float ratio = allTextFieldInputs / (float) statistics.getNoOfAllInteractions();
+    
+    UsabilityDefectSeverity severity = null;
+    if (ratio > 0.9)
+    {
+      severity = UsabilityDefectSeverity.HIGH;
+    }
+    else if (ratio > 0.7)
+    {
+      severity = UsabilityDefectSeverity.MEDIUM;
+    }
+    else if (ratio > 0.5)
+    {
+      severity = UsabilityDefectSeverity.INFO;
+    }
+    
+    if (severity != null)
+    {
+      Map<String, String> parameters = new HashMap<String, String>();
+      parameters.put("textInputRatio", DecimalFormat.getInstance().format(ratio * 100) + "%");
+      
+      results.addDefect
+        (new UsabilityDefect
+           (severity, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO, parameters));
+    }
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param statistics
+   * @param results
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void checkTextFieldEntryRepetitions(TextInputStatistics       statistics,
+                                              UsabilityEvaluationResult results)
+  {
+    Map<String, Integer> words = new HashMap<String, Integer>();
+    int numberOfRepeatedWords = 0;
+    int maxRepetitions = 0;
+
+    for (int i = 0; i < statistics.getNoOfTextFieldInputs(); i++)
+    {
+      String[] fragments = statistics.getTextFieldInputFragments(i);
+      for (String fragment : fragments)
+      {
+        if (!"".equals(fragment.trim()))
+        {
+          Integer count = words.get(fragment);
+          if (count == null)
+          {
+            words.put(fragment, 1);
+          }
+          else
+          {
+            count++;
+            words.put(fragment, count);
+            maxRepetitions = Math.max(count, maxRepetitions);
+
+            if (count == 2)
+            {
+              // do not calculate repeated words several times
+              numberOfRepeatedWords++;
+            }
+          }
+        }
+      }
+    }
+    
+    UsabilityDefectSeverity severity = null;
+    if ((numberOfRepeatedWords > 10) || (maxRepetitions > 10))
+    {
+      severity = UsabilityDefectSeverity.HIGH;
+    }
+    else if ((numberOfRepeatedWords > 4) || (maxRepetitions > 4))
+    {
+      severity = UsabilityDefectSeverity.MEDIUM;
+    }
+    else if ((numberOfRepeatedWords > 2) || (maxRepetitions > 2))
+    {
+      severity = UsabilityDefectSeverity.LOW;
+    }
+    else if ((numberOfRepeatedWords > 1) || (maxRepetitions > 1))
+    {
+      severity = UsabilityDefectSeverity.INFO;
+    }
+    
+    if (severity != null)
+    {
+      Map<String, String> parameters = new HashMap<String, String>();
+      parameters.put("textRepetitionRatio", numberOfRepeatedWords + " repeated tokens, up to " +
+                     maxRepetitions + " repetitions per token");
+
+      results.addDefect
+        (new UsabilityDefect
+           (severity, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS, parameters));
+    }
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param taskTree
+   * @param statistics
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void calculateStatistics(TaskTreeNode node, TextInputStatistics statistics)
+  {
+    if (node instanceof TextInputInteractionTask)
+    {
+      calculateStatistics((TextInputInteractionTask) node, statistics);
+    }
+    else
+    {
+      if ((node.getChildren() == null) ||
+          (node.getChildren().size() == 0))
+      {
+        statistics.incrementNoOfOtherInteractionTasks();
+      }
+      else
+      {
+        for (TaskTreeNode child : node.getChildren())
+        {
+          calculateStatistics(child, statistics);
+        }
+      }
+    }
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param taskTree
+   * @param statistics
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void calculateStatistics(TextInputInteractionTask node, TextInputStatistics statistics)
+  {
+    String[] fragments = determineTextFragments(node.getEnteredText());
+    
+    if (node.getGUIElement() instanceof TextField)
+    {
+      statistics.addTextFieldInput(node, fragments);
+    }
+    else if (node.getGUIElement() instanceof TextArea)
+    {
+      statistics.addTextAreaInput(node, fragments);
+    }
+  }
+  
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param enteredText
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  private String[] determineTextFragments(String enteredText)
+  {
+    List<String> fragments = new ArrayList<String>();
+    
+    StringBuffer fragment = new StringBuffer();
+    char lastChar = 0;
+    
+    for (int i = 0; i < enteredText.length(); i++)
+    {
+      char currentChar = enteredText.charAt(i);
+      
+      if (!isEqualCharacterType(lastChar, currentChar))
+      {
+        // the previous fragment ended. so finalize it and start a new one
+        if ((fragment != null) && (fragment.length() > 0))
+        {
+          fragments.add(fragment.toString());
+          fragment = new StringBuffer();
+        }
+      }
+
+      fragment.append(currentChar);
+      lastChar = currentChar;
+    }
+    
+    if ((fragment != null) && (fragment.length() > 0))
+    {
+      fragments.add(fragment.toString());
+    }
+    
+    return fragments.toArray(new String[fragments.size()]);
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param lastChar
+   * @param currentChar
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  private boolean isEqualCharacterType(char char1, char char2)
+  {
+    return
+      ((char1 == char2) ||
+       (Character.isWhitespace(char1) && Character.isWhitespace(char2)) ||
+       (Character.isDigit(char1) && Character.isDigit(char2)) ||
+       (Character.isLetter(char1) && Character.isLetter(char2)) ||
+       (Character.isJavaIdentifierPart(char1) && Character.isJavaIdentifierPart(char2)));
+  }
+
+  //-------------------------------------------------------------------------------------------------
+  /**
+   * TODO comment
+   * 
+   * @version $Revision: $ $Date: 16.07.2012$
+   * @author 2012, last modified by $Author: pharms$
+   */
+  //-------------------------------------------------------------------------------------------------
+  public class TextInputStatistics
+  {
+    /** */
+    private List<Object[]> mTextFieldInputs = new ArrayList<Object[]>();
+    
+    /** */
+    private List<Object[]> mTextAreaInputs = new ArrayList<Object[]>();
+    
+    /** */
+    private int mOtherInteractionsCount;
+    
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     * @param node 
+     * @param fragments 
+     *
+     */
+    //-----------------------------------------------------------------------------------------------
+    public void addTextFieldInput(TextInputInteractionTask node, String[] fragments)
+    {
+      mTextFieldInputs.add(new Object[] { node, fragments });
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     * @param node 
+     * @param fragments 
+     *
+     */
+    //-----------------------------------------------------------------------------------------------
+    public void addTextAreaInput(TextInputInteractionTask node, String[] fragments)
+    {
+      mTextAreaInputs.add(new Object[] { node, fragments });
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     *
+     * @return
+     */
+    //-----------------------------------------------------------------------------------------------
+    public int getNoOfAllInteractions()
+    {
+      return mTextFieldInputs.size() + mTextAreaInputs.size() + mOtherInteractionsCount;
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     *
+     * @return
+     */
+    //-----------------------------------------------------------------------------------------------
+    public int getNoOfTextFieldInputs()
+    {
+      return mTextFieldInputs.size();
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     *
+     * @param i
+     * @return
+     */
+    //-----------------------------------------------------------------------------------------------
+    public String[] getTextFieldInputFragments(int index)
+    {
+      return (String[]) mTextFieldInputs.get(index)[1];
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     *
+     * @return
+     */
+    //-----------------------------------------------------------------------------------------------
+    public int getNoOfTextAreaInputs()
+    {
+      return mTextAreaInputs.size();
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     *
+     * @param i
+     * @return
+     */
+    //-----------------------------------------------------------------------------------------------
+    public String[] getTextAreaInputFragments(int index)
+    {
+      return (String[]) mTextAreaInputs.get(index)[1];
+    }
+
+    //-----------------------------------------------------------------------------------------------
+    /**
+     * TODO: comment
+     *
+     */
+    //-----------------------------------------------------------------------------------------------
+    public void incrementNoOfOtherInteractionTasks()
+    {
+      mOtherInteractionsCount++;
+    }
+
+    
+  }
+
+}
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefect.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefect.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefect.java	(revision 442)
@@ -0,0 +1,136 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityDefect.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import java.util.Map;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 16.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class UsabilityDefect
+{
+
+  /** */
+  private UsabilityDefectSeverity mSeverity;
+  
+  /** */
+  private UsabilityDefectDescription mDescription;
+
+  /** */
+  private Map<String, String> mDescriptionParameters;
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param medium
+   * @param highTextInputRatio
+   */
+  //-----------------------------------------------------------------------------------------------
+  public UsabilityDefect(UsabilityDefectSeverity    severity,
+                         UsabilityDefectDescription description)
+  {
+    this(severity, description, null);
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param medium
+   * @param highTextInputRatio
+   */
+  //-----------------------------------------------------------------------------------------------
+  public UsabilityDefect(UsabilityDefectSeverity    severity,
+                         UsabilityDefectDescription description,
+                         Map<String, String>        parameters)
+  {
+    mSeverity = severity;
+    mDescription = description;
+    mDescriptionParameters = parameters;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  public UsabilityDefectSeverity getSeverity()
+  {
+    return mSeverity;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * @param severity the severity to set
+   */
+  //-----------------------------------------------------------------------------------------------
+  public void setSeverity(UsabilityDefectSeverity severity)
+  {
+    mSeverity = severity;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * @param description the description to set
+   */
+  //-----------------------------------------------------------------------------------------------
+  public void setDescription(UsabilityDefectDescription description)
+  {
+    mDescription = description;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * 
+   */
+  //-----------------------------------------------------------------------------------------------
+  public String getParameterizedDescription()
+  {
+    return mDescription.toString(mDescriptionParameters);
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /* (non-Javadoc)
+   * @see java.lang.Object#equals(java.lang.Object)
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Override
+  public boolean equals(Object obj)
+  {
+    if (obj instanceof UsabilityDefect)
+    {
+      return
+        (mSeverity == ((UsabilityDefect) obj).mSeverity) &&
+        (mDescription == ((UsabilityDefect) obj).mDescription);
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /* (non-Javadoc)
+   * @see java.lang.Object#toString()
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Override
+  public String toString()
+  {
+    return "UsabilityDefect(" + mSeverity.name() + ", " + mDescription.name() + ")";
+  }
+
+}
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectDescription.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectDescription.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectDescription.java	(revision 442)
@@ -0,0 +1,217 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityDefectDescriptions.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 18.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import de.ugoe.cs.quest.usability.DefectDescription;
+import de.ugoe.cs.quest.usability.DefectDescriptions;
+import de.ugoe.cs.quest.usability.ParameterFragment;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 18.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public enum UsabilityDefectDescription
+{
+  TEXT_FIELD_INPUT_RATIO,
+  TEXT_FIELD_INPUT_REPETITIONS;
+
+  /** */
+  private static final String DEFAULT_MESSAGES_FILE = "defectDescriptions_en.xml";
+  
+  /** */
+  private static DefectDescriptions sDefectDescriptions;
+
+  /** */
+  private DefectDescription mDefectDescription;
+  
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param name
+   * @param ordinal
+   */
+  //-----------------------------------------------------------------------------------------------
+  private UsabilityDefectDescription()
+  {
+    init();
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  @SuppressWarnings("unchecked")
+  private void init()
+  {
+    synchronized (this.getClass())
+    {
+      if (sDefectDescriptions == null)
+      {
+        InputStream inputStream = ClassLoader.getSystemResourceAsStream(DEFAULT_MESSAGES_FILE);
+
+        try
+        {
+          String packageName = DefectDescriptions.class.getPackage().getName();
+          JAXBContext jaxbContext = JAXBContext.newInstance(packageName);
+          Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+        
+          sDefectDescriptions =
+            ((JAXBElement<DefectDescriptions>) unmarshaller.unmarshal(inputStream)).getValue();
+        }
+        catch (Exception e)
+        {
+          throw new RuntimeException("error while initializing usability defect descriptions", e);
+        }
+        finally
+        {
+          if (inputStream != null)
+          {
+            try
+            {
+              inputStream.close();
+            }
+            catch (IOException e)
+            {
+              // ignore
+            }
+          }
+        }
+      }
+    }
+    
+    for (DefectDescription description : sDefectDescriptions.getDefectDescription())
+    {
+      if (this.name().equals(description.getDefectId()))
+      {
+        mDefectDescription = description;
+        break;
+      }
+    }
+    
+    if (mDefectDescription == null)
+    {
+      throw new RuntimeException("error while initializing usability defect descriptions. No " +
+                                 "description text available for description " + this.name());
+    }
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * 
+   */
+  //-----------------------------------------------------------------------------------------------
+  public String toString(Map<String, String> parameters) throws IllegalArgumentException
+  {
+    StringBuffer result = new StringBuffer();
+    
+    for (Object fragment : mDefectDescription.getTextFragmentOrParameterFragment())
+    {
+      if (result.length() > 0)
+      {
+        result.append(" ");
+      }
+      
+      if (fragment instanceof ParameterFragment)
+      {
+        String value = null;
+        if (parameters != null)
+        {
+          value = parameters.get(((ParameterFragment) fragment).getParameterName());
+        }
+        
+        if (value != null)
+        {
+          result.append(value);
+        }
+        else
+        {
+          throw new IllegalArgumentException
+            ("required parameter \"" + ((ParameterFragment) fragment).getParameterName() +
+             "\" for usability defect description " + this.name() + " not provided");
+        }
+      }
+      else
+      {
+        result.append(getFragmentString(fragment));
+      }
+    }
+    
+    return result.toString();
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /* (non-Javadoc)
+   * @see java.lang.Enum#toString()
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Override
+  public String toString()
+  {
+    StringBuffer result = new StringBuffer();
+    
+    int paramCount = 1;
+    for (Object fragment : mDefectDescription.getTextFragmentOrParameterFragment())
+    {
+      if (result.length() > 0)
+      {
+        result.append(" ");
+      }
+      
+      if (fragment instanceof ParameterFragment)
+      {
+        result.append("<parameter");
+        result.append(paramCount++);
+        result.append(">");
+      }
+      else
+      {
+        result.append(getFragmentString(fragment));
+      }
+    }
+    
+    return result.toString();
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param fragment
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  private String getFragmentString(Object fragment)
+  {
+    String fragmentStr = fragment.toString().trim();
+    
+    fragmentStr = fragmentStr.replaceAll("\n", " ");
+    
+    while (fragmentStr.indexOf("  ") > -1)
+    {
+      fragmentStr = fragmentStr.replaceAll("  ", " ");
+    }
+    
+    return fragmentStr;
+  }
+
+}
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectSeverity.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectSeverity.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectSeverity.java	(revision 442)
@@ -0,0 +1,24 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityDefectSeverity.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 16.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public enum UsabilityDefectSeverity
+{
+  INFO,
+  LOW,
+  MEDIUM,
+  HIGH;
+}
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationManager.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationManager.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationManager.java	(revision 442)
@@ -0,0 +1,106 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityEvaluationManager.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTree;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 16.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class UsabilityEvaluationManager
+{
+  /** */
+  private static Logger LOG = Logger.getLogger(UsabilityEvaluationManager.class.getName());
+
+  /** */
+  private List<UsabilityEvaluationRule> mRules = new ArrayList<UsabilityEvaluationRule>();
+  
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  public UsabilityEvaluationManager()
+  {
+    super();
+    init();
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void init()
+  {
+    mRules.add(new TextInputStatisticsRule());
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param taskTree
+   */
+  //-----------------------------------------------------------------------------------------------
+  public UsabilityEvaluationResult evaluateUsability(TaskTree taskTree)
+  {
+    LOG.info("evaluating usability of task tree " + taskTree);
+    
+    List<UsabilityEvaluationResult> results = new ArrayList<UsabilityEvaluationResult>();
+    
+    for (UsabilityEvaluationRule rule : mRules)
+    {
+      LOG.info("applying rule " + rule.getClass().getSimpleName());
+      UsabilityEvaluationResult result = rule.evaluate(taskTree);
+      results.add(result);
+      LOG.info("the rule found " + result.getAllDefects().size() + " usability defects, of " +
+                "which " + result.getSevereDefects().size() + " are severe.");
+    }
+    
+    UsabilityEvaluationResult result = mergeResults(results);
+    LOG.info("the evaluation result contains " + result.getAllDefects().size() + " defects, of " +
+             "which " + result.getSevereDefects().size() + " are severe.");
+    return result;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param results
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  private UsabilityEvaluationResult mergeResults(List<UsabilityEvaluationResult> results)
+  {
+    UsabilityEvaluationResult result = new UsabilityEvaluationResult();
+    
+    for (UsabilityEvaluationResult ruleResult : results)
+    {
+      for (UsabilityDefect defect : ruleResult.getAllDefects())
+      {
+        result.addDefect(defect);
+      }
+    }
+    
+    return result;
+  }
+  
+}
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationResult.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationResult.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationResult.java	(revision 442)
@@ -0,0 +1,72 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityEvaluationResult.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import java.util.ArrayList;
+import java.util.List;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 16.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class UsabilityEvaluationResult
+{
+  /** */
+  private List<UsabilityDefect> mDefects = new ArrayList<UsabilityDefect>();
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param defect
+   */
+  //-----------------------------------------------------------------------------------------------
+  public void addDefect(UsabilityDefect defect)
+  {
+    mDefects.add(defect);
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  public List<UsabilityDefect> getAllDefects()
+  {
+    return mDefects;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  public List<UsabilityDefect> getSevereDefects()
+  {
+    List<UsabilityDefect> severeDefects = new ArrayList<UsabilityDefect>();
+    
+    for (UsabilityDefect defect : mDefects)
+    {
+      if (defect.getSeverity() == UsabilityDefectSeverity.HIGH)
+      {
+        severeDefects.add(defect);
+      }
+    }
+    
+    return severeDefects;
+  }
+
+}
Index: /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationRule.java
===================================================================
--- /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationRule.java	(revision 442)
+++ /trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationRule.java	(revision 442)
@@ -0,0 +1,33 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityEvaluationRule.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTree;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 16.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public interface UsabilityEvaluationRule
+{
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param taskTree
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  UsabilityEvaluationResult evaluate(TaskTree taskTree);
+
+}
Index: /trunk/quest-core-usability/src/main/resources/defectDescriptions.xsd
===================================================================
--- /trunk/quest-core-usability/src/main/resources/defectDescriptions.xsd	(revision 442)
+++ /trunk/quest-core-usability/src/main/resources/defectDescriptions.xsd	(revision 442)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+  targetNamespace="http://quest"
+  xmlns:tns="http://quest"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+  jxb:version="2.0"
+  elementFormDefault="qualified">
+  
+  <xsd:element name="defectDescriptions" type="tns:DefectDescriptions" />
+
+  <xsd:complexType name="DefectDescriptions">
+    <xsd:sequence>
+      <xsd:element name="defectDescription" type="tns:DefectDescription" maxOccurs="unbounded" />
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <xsd:complexType name="DefectDescription">
+    <xsd:choice maxOccurs="unbounded">
+      <xsd:element name="textFragment" type="tns:SimpleFragment" />
+      <xsd:element name="parameterFragment" type="tns:ParameterFragment" />
+    </xsd:choice>
+    <xsd:attribute name="defectId" type="xsd:string" use="required" />
+  </xsd:complexType>
+
+  <xsd:simpleType name="SimpleFragment">
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+  <xsd:complexType name="ParameterFragment">
+    <xsd:attribute name="parameterName" use="required" type="xsd:string" />
+  </xsd:complexType>
+
+</xsd:schema>
Index: /trunk/quest-core-usability/src/main/resources/defectDescriptions_en.xml
===================================================================
--- /trunk/quest-core-usability/src/main/resources/defectDescriptions_en.xml	(revision 442)
+++ /trunk/quest-core-usability/src/main/resources/defectDescriptions_en.xml	(revision 442)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<defectDescriptions
+  xmlns="http://quest"
+  xmlns:b="http://quest"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://quest defectDescriptions.xsd">
+  <b:defectDescription defectId="TEXT_FIELD_INPUT_RATIO">
+    <textFragment>
+      The ratio of interactions that enter text into text fields is
+      relatively high in comparison with the other user interactions (
+    </textFragment>
+    <b:parameterFragment parameterName="textInputRatio" />
+    <textFragment>
+      ). This should be reduced. As an
+      example, entering data can also be done using check boxes or combo boxes in the case
+      predefined values must be entered.
+    </textFragment>
+  </b:defectDescription>
+  <defectDescription defectId="TEXT_FIELD_INPUT_REPETITIONS">
+    <textFragment>Several interactions that enter text into text fields repeat
+      tokens such as words or specific signs (
+    </textFragment>
+    <b:parameterFragment parameterName="textRepetitionRatio" />
+    <textFragment>
+      ). This is an indicator that the same data must be
+      entered several times. This could be better supported by</textFragment>
+  </defectDescription>
+</defectDescriptions>
Index: /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/AbstractUsabilityEvaluationTC.java
===================================================================
--- /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/AbstractUsabilityEvaluationTC.java	(revision 442)
+++ /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/AbstractUsabilityEvaluationTC.java	(revision 442)
@@ -0,0 +1,263 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: AbstractUsabilityEvaluationTC.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 18.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.junit.Before;
+
+import de.ugoe.cs.quest.tasktrees.testutils.DummyGUIElement;
+import de.ugoe.cs.quest.tasktrees.testutils.DummyInteraction;
+import de.ugoe.cs.quest.tasktrees.testutils.DummyTextField;
+import de.ugoe.cs.quest.tasktrees.testutils.SimpleLogFormatter;
+import de.ugoe.cs.quest.tasktrees.treeifc.Iteration;
+import de.ugoe.cs.quest.tasktrees.treeifc.Selection;
+import de.ugoe.cs.quest.tasktrees.treeifc.Sequence;
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTree;
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeBuilder;
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode;
+import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeifc.TextInputInteractionTask;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeBuilderImpl;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactoryImpl;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 18.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class AbstractUsabilityEvaluationTC
+{
+  
+  /** */
+  private TaskTreeBuilder mTaskTreeBuilder = new TaskTreeBuilderImpl();
+
+  /** */
+  private TaskTreeNodeFactory mTaskTreeNodeFactory = new TaskTreeNodeFactoryImpl();
+  
+  //-----------------------------------------------------------------------------------------------
+  /**
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Before
+  public void setUp()
+  {
+    Logger.getLogger("").getHandlers()[0].setFormatter(new SimpleLogFormatter());
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  protected TaskTree createTaskTree(String spec)
+  {
+    Matcher matcher =
+      Pattern.compile("(\\s*(\\w+)\\s*(\\(((\\w*\\s*)*)\\))?\\s*(\\{))|(\\})").matcher(spec);
+      
+    if (!matcher.find())
+    {
+      if (!matcher.hitEnd())
+      {
+        throw new IllegalArgumentException("could not parse task specification");
+      }
+    }
+
+    return mTaskTreeNodeFactory.createTaskTree(parseTask(matcher, new int[1]));
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param expectedDefects
+   * @param evaluateUsability
+   */
+  //-----------------------------------------------------------------------------------------------
+  protected void assertUsabilityEvaluationResult(UsabilityDefect[]         expectedDefects,
+                                                 UsabilityEvaluationResult evaluationResult)
+  {
+    assertEquals(expectedDefects.length, evaluationResult.getAllDefects().size());
+    
+    EXPECTED_DEFECT_ITERATION:
+    for (UsabilityDefect expectedDefect : expectedDefects)
+    {
+      for (UsabilityDefect defect : evaluationResult.getAllDefects())
+      {
+        if (expectedDefect.equals(defect))
+        {
+          System.err.println(defect.getParameterizedDescription());
+          continue EXPECTED_DEFECT_ITERATION;
+        }
+      }
+      
+      for (UsabilityDefect defect : evaluationResult.getAllDefects())
+      {
+        System.err.println(defect);
+      }
+      
+      fail("expected defect " + expectedDefect + " not found in evaluation result");
+    }
+  }
+
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * 
+   */
+  //-----------------------------------------------------------------------------------------------
+  private TaskTreeNode parseTask(Matcher tokenMatcher, int[] typeNumbers)
+  {
+    String firstToken = tokenMatcher.group();
+    
+    if ("}".equals(firstToken))
+    {
+      throw new IllegalArgumentException("found a closing bracket at an unexpected place");
+    }
+    
+    TaskTreeNode treeNode = instantiateTreeNode(tokenMatcher, typeNumbers);
+    
+    if (!tokenMatcher.find())
+    {
+      throw new IllegalArgumentException("could not parse task specification");
+    }
+    
+    firstToken = tokenMatcher.group();
+    
+    if (!"}".equals(firstToken))
+    {
+      TaskTreeNode child = null;
+    
+      do
+      {
+        child = parseTask(tokenMatcher, typeNumbers);
+        
+        if (child != null)
+        {
+          addChild(treeNode, child);
+          
+          if (!tokenMatcher.find())
+          {
+            throw new IllegalArgumentException("could not parse task specification");
+          }
+          
+          firstToken = tokenMatcher.group();
+          
+          if ("}".equals(firstToken))
+          {
+            break;
+          }
+        }
+        
+      }
+      while (child != null);
+      
+    }
+    
+    return treeNode;
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param group
+   * @return
+   */
+  //-----------------------------------------------------------------------------------------------
+  private TaskTreeNode instantiateTreeNode(Matcher tokenMatcher, int[] typeNumbers)
+  {
+    String type = tokenMatcher.group(2);
+    String additionalInfo = tokenMatcher.group(4);
+    
+    if ("Interaction".equals(type))
+    {
+      return mTaskTreeNodeFactory.createNewInteractionTask
+        (new DummyGUIElement("dummy"), new DummyInteraction("dummy", typeNumbers[0]++));
+    }
+    else if ("Sequence".equals(type))
+    {
+      return mTaskTreeNodeFactory.createNewSequence();
+    }
+    else if ("Iteration".equals(type))
+    {
+      return mTaskTreeNodeFactory.createNewIteration();
+    }
+    else if ("Selection".equals(type))
+    {
+      return mTaskTreeNodeFactory.createNewSelection();
+    }
+    else if ("TextInput".equals(type))
+    {
+      if (additionalInfo == null)
+      {
+        fail("no simulated text provided for text input interactin task");
+      }
+      
+      TextInputInteractionTask task =
+        mTaskTreeNodeFactory.createNewTextInputInteractionTask(new DummyTextField(additionalInfo));
+     
+      task.setEnteredText(additionalInfo);
+      return task;
+    }
+    else
+    {
+      fail("invalid type of task tree node: " + type);
+      return null;
+    }
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   * @param treeNode
+   * @param child
+   */
+  //-----------------------------------------------------------------------------------------------
+  private void addChild(TaskTreeNode parent, TaskTreeNode child)
+  {
+    if (parent instanceof Sequence)
+    {
+      mTaskTreeBuilder.addChild((Sequence) parent, child);
+    }
+    else if (parent instanceof Iteration)
+    {
+      if (parent.getChildren().size() <= 0)
+      {
+        mTaskTreeBuilder.setChild((Iteration) parent, child);
+      }
+      else
+      {
+        fail("can not add more than one child to an iteration");
+      }
+    }
+    else if (parent instanceof Selection)
+    {
+      mTaskTreeBuilder.addChild((Selection) parent, child);
+    }
+    else if (parent instanceof TextInputInteractionTask)
+    {
+      mTaskTreeBuilder.addChild((TextInputInteractionTask) parent, child);
+    }
+    else
+    {
+      fail("can not add children to parent task tree node of type " + parent.getClass().getName());
+    }
+  }
+
+}
Index: /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/TextInputStatisticsRuleTest.java
===================================================================
--- /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/TextInputStatisticsRuleTest.java	(revision 442)
+++ /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/TextInputStatisticsRuleTest.java	(revision 442)
@@ -0,0 +1,649 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: TextInputStatisticsRuleTest.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 18.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import org.junit.Test;
+
+import de.ugoe.cs.quest.usability.UsabilityDefect;
+import de.ugoe.cs.quest.usability.UsabilityDefectDescription;
+import de.ugoe.cs.quest.usability.UsabilityDefectSeverity;
+import de.ugoe.cs.quest.usability.UsabilityEvaluationManager;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 18.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class TextInputStatisticsRuleTest extends AbstractUsabilityEvaluationTC
+{
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Test
+  public void testWithDifferentTextInputInteractionsOnly()
+  {
+    UsabilityEvaluationManager manager = new UsabilityEvaluationManager();
+    
+    String spec = "TextInput (bla) {}";
+    UsabilityDefect[] expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+    
+    spec =
+      "Sequence {" +
+      "  TextInput (bla) {}" +
+      "}";
+    
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+    
+    spec =
+      "Sequence {" +
+      "  TextInput (a) {}" +
+      "  TextInput (b) {}" +
+      "  TextInput (c) {}" +
+      "  TextInput (d) {}" +
+      "}";
+    
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+    
+    spec =
+      "Selection {" +
+      "  TextInput (a) {}" +
+      "  TextInput (b) {}" +
+      "  TextInput (c) {}" +
+      "  TextInput (d) {}" +
+      "}";
+      
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+      
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+      
+    spec =
+      "Iteration {" +
+      "  TextInput (bla) {}" +
+      "}";
+        
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+      
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+        
+    spec =
+      "Sequence {" +
+      "  TextInput (a) {}" +
+      "  Sequence {" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (d) {}" +
+      "    TextInput (e) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (f) {}" +
+      "  }" +
+      "  TextInput (g) {}" +
+      "  Selection {" +
+      "    TextInput (h) {}" +
+      "    TextInput (i) {}" +
+      "    TextInput (j) {}" +
+      "    TextInput (k) {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (l) {}" +
+      "    Sequence {" +
+      "      TextInput (m) {}" +
+      "      TextInput (n) {}" +
+      "      TextInput (o) {}" +
+      "      TextInput (p) {}" +
+      "    }" +
+      "    Iteration {" +
+      "      TextInput (q) {}" +
+      "    }" +
+      "    TextInput (r) {}" +
+      "    Selection {" +
+      "      TextInput (s) {}" +
+      "      TextInput (t) {}" +
+      "      TextInput (u) {}" +
+      "      TextInput (v) {}" +
+      "    }" +
+      "  }" +
+      "  Selection {" +
+      "    TextInput (w) {}" +
+      "    Sequence {" +
+      "      TextInput (x) {}" +
+      "      TextInput (y) {}" +
+      "      TextInput (z) {}" +
+      "      TextInput (aa) {}" +
+      "    }" +
+      "    Iteration {" +
+      "      TextInput (ab) {}" +
+      "    }" +
+      "    TextInput (ac) {}" +
+      "    Selection {" +
+      "      TextInput (ad) {}" +
+      "      TextInput (ae) {}" +
+      "      TextInput (af) {}" +
+      "      TextInput (ag) {}" +
+      "    }" +
+      "  }" +
+      "  TextInput (ah) {}" +
+      "}";
+     
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));   
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Test
+  public void testCombinationsOfTextInputInteractionsAndOtherInteractions()
+  {
+    UsabilityEvaluationManager manager = new UsabilityEvaluationManager();
+    
+    String spec =
+      "Sequence {" +
+      "  Interaction {}" +
+      "  TextInput (a) {}" +
+      "  TextInput (b) {}" +
+      "  Interaction {}" +
+      "  TextInput (c) {}" +
+      "}";
+      
+    UsabilityDefect[] expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+    
+    spec =
+      "Sequence {" +
+      "  Interaction {}" +
+      "  TextInput (a) {}" +
+      "  Interaction {}" +
+      "  Interaction {}" +
+      "  TextInput (c) {}" +
+      "}";
+        
+    expectedDefects = new UsabilityDefect[0];
+      
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+        
+    spec =
+      "Selection {" +
+      "  Interaction {}" +
+      "  TextInput (a) {}" +
+      "  TextInput (b) {}" +
+      "  Interaction {}" +
+      "  TextInput (c) {}" +
+      "}";
+      
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+      
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+      
+    spec =
+      "Sequence {" +
+      "  TextInput (a) {}" +
+      "  Sequence {" +
+      "    Interaction {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    Interaction {}" +
+      "    TextInput (d) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (e) {}" +
+      "  }" +
+      "  Interaction {}" +
+      "  Selection {" +
+      "    Interaction {}" +
+      "    TextInput (f) {}" +
+      "    TextInput (g) {}" +
+      "    Interaction {}" +
+      "    TextInput (h) {}" +
+      "    TextInput (i) {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (j) {}" +
+      "    Sequence {" +
+      "      TextInput (k) {}" +
+      "      Interaction {}" +
+      "      TextInput (l) {}" +
+      "      TextInput (m) {}" +
+      "      Interaction {}" +
+      "      TextInput (n) {}" +
+      "      TextInput (o) {}" +
+      "    }" +
+      "    Iteration {" +
+      "      Interaction {}" +
+      "    }" +
+      "    Interaction {}" +
+      "    Selection {" +
+      "      TextInput (p) {}" +
+      "      TextInput (q) {}" +
+      "      TextInput (r) {}" +
+      "      Interaction {}" +
+      "      TextInput (s) {}" +
+      "      TextInput (t) {}" +
+      "      Interaction {}" +
+      "      TextInput (u) {}" +
+      "      TextInput (v) {}" +
+      "    }" +
+      "  }" +
+      "  Selection {" +
+      "    Interaction {}" +
+      "    Sequence {" +
+      "      TextInput (w) {}" +
+      "      Interaction {}" +
+      "      TextInput (x) {}" +
+      "      TextInput (y) {}" +
+      "      Interaction {}" +
+      "    }" +
+      "    Iteration {" +
+      "      TextInput (z) {}" +
+      "    }" +
+      "    TextInput (aa) {}" +
+      "    Selection {" +
+      "      TextInput (ab) {}" +
+      "      Interaction {}" +
+      "      TextInput (ac) {}" +
+      "      TextInput (ad) {}" +
+      "      Interaction {}" +
+      "      TextInput (ae) {}" +
+      "    }" +
+      "  }" +
+      "  Interaction {}" +
+      "}";
+     
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+    
+    spec =
+      "Sequence {" +
+      "  TextInput (a) {}" +
+      "  Sequence {" +
+      "    Interaction {}" +
+      "    TextInput (b) {}" +
+      "    Interaction {}" +
+      "    Interaction {}" +
+      "    TextInput (c) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (d) {}" +
+      "  }" +
+      "  Interaction {}" +
+      "  Selection {" +
+      "    Interaction {}" +
+      "    TextInput (e) {}" +
+      "    Interaction {}" +
+      "    Interaction {}" +
+      "    TextInput (g) {}" +
+      "    Interaction {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (i) {}" +
+      "    Sequence {" +
+      "      TextInput (j) {}" +
+      "      Interaction {}" +
+      "      TextInput (k) {}" +
+      "      Interaction {}" +
+      "      Interaction {}" +
+      "      TextInput (m) {}" +
+      "      Interaction {}" +
+      "    }" +
+      "    Iteration {" +
+      "      Interaction {}" +
+      "    }" +
+      "    Interaction {}" +
+      "    Selection {" +
+      "      TextInput (o) {}" +
+      "      Interaction {}" +
+      "      Interaction {}" +
+      "      Interaction {}" +
+      "      Interaction {}" +
+      "      TextInput (s) {}" +
+      "      Interaction {}" +
+      "      TextInput (t) {}" +
+      "      TextInput (u) {}" +
+      "    }" +
+      "  }" +
+      "  Selection {" +
+      "    Interaction {}" +
+      "    Sequence {" +
+      "      TextInput (v) {}" +
+      "      Interaction {}" +
+      "      Interaction {}" +
+      "      TextInput (x) {}" +
+      "      Interaction {}" +
+      "    }" +
+      "    Iteration {" +
+      "      TextInput (y) {}" +
+      "    }" +
+      "    TextInput (z) {}" +
+      "    Selection {" +
+      "      TextInput (aa) {}" +
+      "      Interaction {}" +
+      "      TextInput (ab) {}" +
+      "      Interaction {}" +
+      "      Interaction {}" +
+      "      TextInput (ad) {}" +
+      "    }" +
+      "  }" +
+      "  Interaction {}" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[0];
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));   
+  }
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Test
+  public void testTextEntryRepetitions()
+  {
+    UsabilityEvaluationManager manager = new UsabilityEvaluationManager();
+    
+    String spec =
+      "Sequence {" +
+      "  TextInput (a b c) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (a) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (a) {}" +
+      "  }" +
+      "  TextInput (a) {}" +
+      "  Selection {" +
+      "    TextInput (b c) {}" +
+      "    TextInput (a) {}" +
+      "    TextInput (a c) {}" +
+      "    TextInput (b a) {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (b c) {}" +
+      "    Sequence {" +
+      "      TextInput (d a c) {}" +
+      "      TextInput (b b b a) {}" +
+      "      TextInput (a a c c) {}" +
+      "      TextInput (b b a) {}" +
+      "    }" +
+      "  }" +
+      "  TextInput (d) {}" +
+      "}";
+     
+    UsabilityDefect[] expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+    
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));   
+
+    spec =
+      "Sequence {" +
+      "  TextInput (a b c d e f g h i j k l m) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (d) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (e) {}" +
+      "  }" +
+      "  TextInput (f) {}" +
+      "  Selection {" +
+      "    TextInput (g) {}" +
+      "    TextInput (h) {}" +
+      "    TextInput (i) {}" +
+      "    TextInput (j) {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (k) {}" +
+      "    Sequence {" +
+      "      TextInput (l) {}" +
+      "      TextInput (m) {}" +
+      "      TextInput (n) {}" +
+      "      TextInput (o) {}" +
+      "    }" +
+      "  }" +
+      "  TextInput (p) {}" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+
+    spec =
+      "Sequence {" +
+      "  TextInput (a b c d e f g h i j k l m) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (d) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (e) {}" +
+      "  }" +
+      "  TextInput (a) {}" +
+      "  Selection {" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (d) {}" +
+      "    TextInput (e) {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    Sequence {" +
+      "      TextInput (b) {}" +
+      "      TextInput (c) {}" +
+      "      TextInput (d) {}" +
+      "      TextInput (e) {}" +
+      "    }" +
+      "  }" +
+      "  TextInput (f) {}" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.MEDIUM, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+ 
+    spec =
+      "Sequence {" +
+      "  TextInput (a b c d e f g h i j k l m) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (a) {}" +
+      "  }" +
+      "  Iteration {" +
+      "    TextInput (b) {}" +
+      "  }" +
+      "  TextInput (c) {}" +
+      "  Selection {" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "    TextInput (a) {}" +
+      "  }" +
+      "  Sequence {" +
+      "    TextInput (b) {}" +
+      "    Sequence {" +
+      "      TextInput (c) {}" +
+      "      TextInput (a) {}" +
+      "      TextInput (b) {}" +
+      "      TextInput (c) {}" +
+      "    }" +
+      "  }" +
+      "  TextInput (a) {}" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.MEDIUM, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+   
+    spec =
+      "Sequence {" +
+      "  TextInput (a b c) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "    TextInput (c) {}" +
+      "  }" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.LOW, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+     
+    spec =
+      "Sequence {" +
+      "  TextInput (a b c) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (a) {}" +
+      "    TextInput (b) {}" +
+      "  }" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.LOW, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+       
+    spec =
+      "Sequence {" +
+      "  TextInput (a b c) {}" +
+      "  Sequence {" +
+      "    TextInput (a) {}" +
+      "    TextInput (d) {}" +
+      "    TextInput (e) {}" +
+      "  }" +
+      "}";
+
+    expectedDefects = new UsabilityDefect[]
+    {
+      new UsabilityDefect
+        (UsabilityDefectSeverity.HIGH, UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO),
+      new UsabilityDefect
+        (UsabilityDefectSeverity.INFO, UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS)
+    };
+
+    assertUsabilityEvaluationResult
+      (expectedDefects, manager.evaluateUsability(createTaskTree(spec)));
+         
+  }
+
+}
Index: /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/UsabilityDefectDescriptionTest.java
===================================================================
--- /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/UsabilityDefectDescriptionTest.java	(revision 442)
+++ /trunk/quest-core-usability/src/test/java/de/ugoe/cs/quest/usability/UsabilityDefectDescriptionTest.java	(revision 442)
@@ -0,0 +1,45 @@
+//-------------------------------------------------------------------------------------------------
+// Module    : $RCSfile: UsabilityDefectDescriptionTest.java,v $
+// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 20.07.2012 $
+// Project   : UsabilityEvaluationManager
+// Creation  : 2012 by pharms
+// Copyright : Patrick Harms, 2012
+//-------------------------------------------------------------------------------------------------
+package de.ugoe.cs.quest.usability;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import de.ugoe.cs.quest.usability.UsabilityDefectDescription;
+
+//-------------------------------------------------------------------------------------------------
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 20.07.2012$
+ * @author 2012, last modified by $Author: pharms$
+ */
+//-------------------------------------------------------------------------------------------------
+public class UsabilityDefectDescriptionTest
+{
+
+  //-----------------------------------------------------------------------------------------------
+  /**
+   * TODO: comment
+   *
+   */
+  //-----------------------------------------------------------------------------------------------
+  @Test
+  public void testInitialization()
+  {
+    assertNotNull(UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO.toString());
+    assertNotSame("", UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO.toString());
+    System.err.println(UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO);
+    
+    assertNotNull(UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS.toString());
+    assertNotSame("", UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS.toString());
+    System.err.println(UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS);
+  }
+
+}
