
 The   \CompHEP~ authors  have  invented some tools for  testing  the
program.
The positive result of these checks allows us to justify that \CompHEP~
works correctly. Our tests  relate to the symbolic result
level and have been realized with the help of the  \REDUCE~ \cite{REDUCE} 
symbolic manipulation system. All test routines are stored in the 
 {\it \$COMPHEP/test}  directory.  If the user is going to repeat
them he has to  copy the corresponding files  into his 
working directory.
All check commands must be started from the same directory.  

 
\subsection {Check  of the   built-in symbolic calculator}

   The first check is a comparison of results 
produced by  the  \CompHEP~ symbolic calculator (Section \ref{s-output})
 with those by   \REDUCE~ 
evaluation of the corresponding code (Section \ref{r-code}). 
The  positive result of this
comparison    means that our   built-in  symbolic calculator works 
correctly.
  Note that the 
\REDUCE~ code may be viewed through by the user and  the 
\CompHEP~ algorithms for  evaluation of the squared matrix element 
 can be verified in this  way. 

The check is realized by means of the program {\it check.red} which must be 
started from within the \REDUCE~ session by instruction\\
\hspace*{2cm}{\tt in"check.red";}\\
It is assumed that the \REDUCE~ code for diagrams and the corresponding 
expressions evaluated by \CompHEP~ are stored in the {\it results}
directory in advance.  The results of this check are saved in the  
{\it message} file. It consists of a list of diagram  numbers  accompanied 
by the  labels {\it OK} or {\it Error} depending on the  result of comparison.


\subsection{Comparison of results produced  in two different gauges}

The comparison of results produced in  the unitary gauge and in the  
t'Hooft-Feynman gauge 
is a very impressive test of the package. In this way  we
check not only  the \CompHEP~ code for symbolic 
evaluation  but also the  correctness of model implementation. 

To perform this check we evaluate  the symbolic sum of  
diagrams in different versions of the Standard Model and compare 
results. The non-zero 
difference is a signal of mistake.
Symbolic summation is performed by  \REDUCE. This summation    is the
most difficult step of  comparison because the sum of diagrams
can be extremely cumbersome.

The \REDUCE~ program {\it cmp.red}  carries out a  summation of  symbolic 
answers written down in {\it results/symb1.red}  as well as   in  
{\it results\_/symb1.red}  and a comparison of  the sums.
In the case of zero difference  {\it cmp.red} puts down
 {\it OK} into the {\it message} file, otherwise the word {\it Error} 
appears.

\subsection{Automatic check for a set of processes} 

We have created the unix script commands {\tt cycle\_check} and
{\tt cycle\_cmp}  which perform the above checks automatically 
for some set of processes. The {\tt cycle\_check} needs one 
numerical parameter which indicates the number of model which is tested.
 The {\tt cycle\_cmp} needs two 
numerical parameters which indicate the numbers of models which are compared.

In both cases the  list of processes is read  from the standard 
input and  the generated {\it message} files are directed to the 
standard output device.

To simplify these tests we open a possibility to restrict the generated
diagrams by excluding   particles of the  third generation.
To realize this possibility just pass one addition parameter to 
{\tt cycle\_check} and  {\tt cycle\_cmp}. The value of this parameter is
 unessential.     
   
We have created various lists of Standard Model processes for testing. They are

\begin{tabular}{l    l  l}
 22\_0gen.prc  &  {\it Higgs and vector particles sector} &               \\
               &  {\it for 2\verb|->|2} processes         & 11 processes,  \\
 22\_2gen.prc  & {\it 2\verb|->|2   for two generations} & 142~processes, \\
 22\_3gen.prc  &  {\it 2\verb|->|2  for three generations}& 294~processes, \\
 23\_2gen.prc  &  {\it 2\verb|->|3  for two generations}  & 455~processes. \\
\end{tabular}

Each list contains only one representative of the  cross-symmetrical 
processes.

The following tests have been carried out for the current version:\\
\begin{verbatim}
    cycle_check 4      < 22_3gen.prc
    cycle_check 3      < 22_3gen.prc
    cycle_check 4   2g < 23_2gen.prc
    cycle_cmp   3 4    < 22_3gen.prc
\end{verbatim}
