COEN 286: Test Design Exercise

Software Testing and Quality Assurance -- winter, 2008

Prof. John Noll

Santa Clara University

$Id: test-design-ex.xpmlbody,v 1.3 2008/02/21 07:40:03 jnoll Exp $
Due $test_cases_due, at the beginning of class.

1. Overview

Many functions have an almost infinite number of input values. For example, the convdate utility takes an integer argument:
%  convdate -c 1230710400
Wed Dec 31 00:00:00 PST 2008
(Note for the Unix novice: the -c above is called a command line switch; it tells the command how to handle the input, in this case to convert the input into a string.) The valid input range comprises several billion values on a 32 bit machine. Testing all of these values is not possible in most cases, and doesn't necessarily tell us more than testing a select few values. How do you choose the best values to test? Equivalence class partitioning can be used to divide the test inputs into classes, thus reducing the number of test cases to a manageable size. Your task for this exercise is to use Equivalence Class partitioning and Boundary Value Analysis to analyze the valid and invalid inputs for the PEOS web interface, then to SPELL CHECK AND PROOFREAD YOUR WORK.

2. Tasks

Perform the following tasks as specified.

  1. Identify Equivalence Classes
  2. Repeat the following tasks until you are satisified with the result:

    1. Identify Categories
    2. Start with the function inventory we used for the risk analysis exercise. For each function, identify one or more input categories that apply to it.

      Don't bother to analyze buttons and menu entries; focus on functions that require input values.

      Be sure to consult the customer or project authority before making assumptions.

      If your class notes about EC partitioning are incomplete, here are mine

    3. Define Equivalence Classes
    4. Repeat the following tasks until you are satisified with the result:

      1. Define Valid And Invalid Classes
      2. For each input category identifed, define the valid and invalid equivalence classes.

        Use crisp, concise mathematical specifications, like regular expressions and set notation.

        Do not specify a test case or specific test input value for the equivalence classes; specify the entire equivalence class.

      3. Define Sub-classes
      4. If appropriate, divide each valid equivalence class into sub-classes based on how the PEOS web interface handles the input.

      5. Identify Boundaries
      6. For equivalence (sub-)classes that have boundaries, identify boundary values for the boundaries between valid and invalid classes, or between valid sub-classes.

        For lower bounds, specify a set {first invalid, lowest valid}; for upper bounds, specify a set {highest valid, first invalid}.

        Do not specify a test case; just specify the boundary values as shown.

  3. Document Results
  4. Document your results in a table, as follows: Note: please follow this table format, to facilitate evaluation and ensure the grader has a favorable attitude toward your work.
    Input Input Type Valid Equivalence (Sub-)Class Invalid EC Lower Bounds Upper Bounds
    switch enum {-s, -n, -c} not {-s, -n, -c} N/A N/A
    number of switches card [0, 1] [2, infinity] {N/A, 0} {1, 2}
    time_t range [0, 2^^32] [-infinity, 0], [2^^32, infinity] {-1,0} {2^^32, 2^^32+1}
    time_t before millennium range [0, 946713599] (sub-class) {N/A,0} [946713599, 946713600]
    time_t after millennium range [946713600,2^^32] (sub-class) {946713599, 946713600} [2^^32, 2^^32+1]
    date string constraint conforms to parsedate(3) spec complement of valid N/A N/A
    Notes:
    • Indent sub-classes from their parent. Also, mark the invalid column ``(sub-class)'' for sub-classes: sub-classes do not have an associated invalid class, because by definition all sub-classes are valid.
    • Use ``N/A'' to indicate that a column does not apply.
    • The examples shown above are only intended to illustrate the table format to use; they are not exhaustive (or necessarily correct).
    • As another example, consider an analysis of an example from the text.

  5. Spell Check Document
  6. SPELL CHECK AND PROOFREAD YOUR WORK.