Design: 05.01.01/P02

This is an abstract, language-independent design. Grim details may be found in the corresponding source code. You may return to the documentation for the module containing this program design, or to the entire hierarchical table of topics covered by the PVT.


PROGRAM 2: Simple open and close of a single workstation

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

wkopen = true = workstation state is WSOP
wkclos = true = workstation state is WSCL
oneopn = true = one workstation identifier in 'set of open
                workstations'
inset  = true = correct workstation identifier in 'set of open
                workstations'
noopwk = true = no workstations open
valok  = true = state value either WSOP or WSCL
typdif = true = workstation type different

<inquire workstation state value> to determine
   wksval = workstation state value
if (wksval not= WSCL or WSOP) then
   valok = false
   message about wksval
endif

Do for each accessible workstation
   <open workstation>

   <inquire workstation state value> to determine wksval
   if (wksval not= WSOP) then
      wkopen = false
      if (wksval not= WSCL) then
         valok = false
      endif
   endif

   <inquire set of open workstations> to determine
      numopw = number of open workstations
      lopwk = list of open workstations
   if (numopw not= 1) then
      oneopn = false
   endif

   owkid = current workstation identifier
   if (owkid not in lopwk) then
      inset = false
   endif

   <inquire workstation connection and type> to determine
      specwt = specific workstation type
   wtype = generic workstation type from configuration file
   if (specwt = wtype) then
      typdif = false
   endif

   <close workstation>

   <inquire set of open workstations> to determine
      numopw = number of open workstations
   if (numopw not= 0) then
      noopwk = false
   endif

   <inquire workstation state value> to determine wksval
   if (wksval not= WSCL) then
      wkclos = false
      if (wksval not= WSOP) then
         valok = false
      endif
   endif
next workstation

*** *** *** actual tests go here *** ***

TEST: #SR 3 4 5
      "In all circumstances, the reported workstation state
       values should be either WSOP or WSCL."
pass/fail depending on (valok)

TEST: #SR 3 5
      "After <open workstation>, the workstation state value
       should be WSOP."
pass/fail depending on (wkopen)

TEST: #SR 6 7
      "If no workstations are open, then immediately after <open
       workstation>, the number of workstation identifiers in the
       set of open workstations should be 1."
pass/fail depending on (oneopn)

TEST: #SR 6 7
      "Immediately after <open workstation>, the set of open
       workstations should contain the workstation identifier
       just opened."
pass/fail depending on (inset)

TEST: #SR 8
      "The specific workstation type of an open workstation
       should be different from the generic type with which it
       was opened."
pass/fail depending on (typdif)

TEST: #SR 7 12
      "If only one workstation is open, then <close workstation>
       should result in the set of open workstations being empty."
pass/fail depending on (noopwk)

TEST: #SR 3 4
      "If no workstations are open, then the workstation state value
       should be WSCL."
pass/fail depending on (wkclos)

END PROGRAM 2