Changeset 496 for trunk


Ignore:
Timestamp:
07/27/12 14:36:59 (12 years ago)
Author:
pharms
Message:
  • added further text entry based evaluation rule
Location:
trunk/quest-core-usability/src/main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/TextInputStatisticsRule.java

    r477 r496  
    6060    checkTextInputRatio(statistics, results); 
    6161    checkTextFieldEntryRepetitions(statistics, results); 
     62    checkTextFieldNoLetterOrDigitInputs(statistics, results); 
    6263  } 
    6364 
     
    8889    } 
    8990    else if (ratio > 0.5) 
     91    { 
     92      severity = UsabilityDefectSeverity.LOW; 
     93    } 
     94    else if (ratio > 0.3) 
    9095    { 
    9196      severity = UsabilityDefectSeverity.INFO; 
     
    180185   * TODO: comment 
    181186   * 
     187   * @param statistics 
     188   * @param results 
     189   */ 
     190  //----------------------------------------------------------------------------------------------- 
     191  private void checkTextFieldNoLetterOrDigitInputs(TextInputStatistics       statistics, 
     192                                                   UsabilityEvaluationResult results) 
     193  { 
     194    int allCharactersCount = 0; 
     195    int noLetterOrDigitCount = 0; 
     196 
     197    for (int i = 0; i < statistics.getNoOfTextFieldInputs(); i++) 
     198    { 
     199      String[] fragments = statistics.getTextFieldInputFragments(i); 
     200      for (String fragment : fragments) 
     201      { 
     202        String effectiveFragment = fragment.trim(); 
     203        for (int j = 0; j < effectiveFragment.length(); j++) 
     204        { 
     205          if (!Character.isWhitespace(effectiveFragment.charAt(j))) 
     206          { 
     207            if (!Character.isLetterOrDigit(effectiveFragment.charAt(j))) 
     208            { 
     209              noLetterOrDigitCount++; 
     210            } 
     211            allCharactersCount++; 
     212          } 
     213        } 
     214      } 
     215    } 
     216     
     217    float ratio = (float) noLetterOrDigitCount / (float) allCharactersCount; 
     218     
     219    UsabilityDefectSeverity severity = null; 
     220    if (ratio > 0.1) // every 10th sign 
     221    { 
     222      severity = UsabilityDefectSeverity.HIGH; 
     223    } 
     224    else if (ratio > 0.05) // every 20th sign 
     225    { 
     226      severity = UsabilityDefectSeverity.MEDIUM; 
     227    } 
     228    else if (ratio > 0.02) // every 50th sign 
     229    { 
     230      severity = UsabilityDefectSeverity.LOW; 
     231    } 
     232    else if (ratio > 0.01) // every 100th sign 
     233    { 
     234      severity = UsabilityDefectSeverity.INFO; 
     235    } 
     236     
     237    if (severity != null) 
     238    { 
     239      Map<String, String> parameters = new HashMap<String, String>(); 
     240      parameters.put("noLetterOrDigitRatio", allCharactersCount + " entered characters of " + 
     241                     "which " + noLetterOrDigitCount + " were no letter or digit"); 
     242 
     243      results.addDefect 
     244        (new UsabilityDefect 
     245           (severity, UsabilityDefectDescription.TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO, parameters)); 
     246    } 
     247  } 
     248 
     249  //----------------------------------------------------------------------------------------------- 
     250  /** 
     251   * TODO: comment 
     252   * 
    182253   * @param taskTree 
    183254   * @param statistics 
  • trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectDescription.java

    r475 r496  
    2929{ 
    3030  TEXT_FIELD_INPUT_RATIO, 
    31   TEXT_FIELD_INPUT_REPETITIONS; 
     31  TEXT_FIELD_INPUT_REPETITIONS, 
     32  TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO; 
    3233 
    3334  /** */ 
  • trunk/quest-core-usability/src/main/resources/defectDescriptions_en.xml

    r442 r496  
    22<defectDescriptions 
    33  xmlns="http://quest" 
    4   xmlns:b="http://quest" 
    54  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    65  xsi:schemaLocation="http://quest defectDescriptions.xsd"> 
    7   <b:defectDescription defectId="TEXT_FIELD_INPUT_RATIO"> 
     6   
     7  <defectDescription defectId="TEXT_FIELD_INPUT_RATIO"> 
    88    <textFragment> 
    9       The ratio of interactions that enter text into text fields is 
    10       relatively high in comparison with the other user interactions ( 
     9      The ratio of interactions that enter text into text fields is relatively high in comparison 
     10      with the other user interactions ( 
    1111    </textFragment> 
    12     <b:parameterFragment parameterName="textInputRatio" /> 
     12    <parameterFragment parameterName="textInputRatio" /> 
    1313    <textFragment> 
    14       ). This should be reduced. As an 
    15       example, entering data can also be done using check boxes or combo boxes in the case 
    16       predefined values must be entered. 
     14      ). This should be reduced. As an example, entering data can also be done using check boxes 
     15      or combo boxes in the case predefined values must be entered. 
    1716    </textFragment> 
    18   </b:defectDescription> 
     17  </defectDescription> 
     18   
    1919  <defectDescription defectId="TEXT_FIELD_INPUT_REPETITIONS"> 
    20     <textFragment>Several interactions that enter text into text fields repeat 
    21       tokens such as words or specific signs ( 
     20    <textFragment> 
     21      Several interactions that enter text into text fields repeat tokens such as words or 
     22      specific signs ( 
    2223    </textFragment> 
    23     <b:parameterFragment parameterName="textRepetitionRatio" /> 
     24    <parameterFragment parameterName="textRepetitionRatio" /> 
    2425    <textFragment> 
    25       ). This is an indicator that the same data must be 
    26       entered several times. This could be better supported by</textFragment> 
     26      ). This is an indicator that the same data must be entered several times. This could be 
     27      better supported by using e.g. automatic filling of input fields, provision of combo 
     28      boxes or lists prefilled with data that was already entered previously.  
     29    </textFragment> 
     30  </defectDescription> 
     31   
     32  <defectDescription defectId="TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO"> 
     33    <textFragment> 
     34      Much of the text entered into text fields contains signs other than letters or digits ( 
     35    </textFragment> 
     36    <parameterFragment parameterName="noLetterOrDigitRatio" /> 
     37    <textFragment> 
     38      ). This is an indicator that the entered data has to follow a specific syntax. This should 
     39      be supported by syntax checking, auto completion or even providing the text fields in a way 
     40      that does not require the entering of special signs as they are already included at the right 
     41      positions. 
     42    </textFragment> 
    2743  </defectDescription> 
    2844</defectDescriptions> 
Note: See TracChangeset for help on using the changeset viewer.