\section{The Models}\label{sec:models}
This section describes our predictors
(for full details, see~\cite{me05e}). Each description 
includes notes on the space of known tunings within that model. In the sequel,
STAR1 will explore that space.

\subsection{Effort Prediction with COCOMO}

COCOMO predicts development effort in calendar months where one month is 152
hours (and includes development and management hours). 
In COCOMO, the  {\em scale factors} $SF_i$ of \fig{cparems}
affect effort exponentially (on KSLOC, i.e. Thousand Source Lines of Code)
while {\em effort multipliers} $EM_j$
affect effort linearly:

{\small\begin{equation}\label{eq:coc2}
months=a*\left(KSLOC^{\left(b+0.01*\sum_{i=1}^{5}SF_i\right)}\right)*\left(\prod_{j=1}^{17}EM_j\right)
\end{equation}}
where KSLOC is estimated
directly or computed from a function point analysis;
 $SF_i$ and $EM_j$ are the {\em scale factors};
{\em effort multipliers} of \fig{cparems};
and
$a$ and $b$ are  domain-specific parameters. In our NASA data,
these ranges\begin{equation}\label{eq:ab}
\left( 2.2 \le a \le 9.18 \right) \wedge \left(0.88 \le b \le 1.09\right) 
\end{equation} 
With the effort multipliers, off-nominal ranges (i.e. \{vl=1, l=2, h=4, vh=5, xh=6\}) change the prediction by some amount.
In the special case of the nominal range (i.e. \{n=3\}), that amount is one; i.e. the nominal
range make no change to the prediction.
Hence, these  ranges  can be modeled as a straight line $y=mx+b$
passing through the point $\{x,y\}$=$\{3,1\}$. Such a line has a y-intercept
of $b=1 - 3m$. Substituting this value of $b$ into $y=mx+b$ yields:
\begin{equation}\label{eq:lineem}\small
\begin{array}{l}
\forall x \in \{1..6\}\; EM_i=m_a(x-3) + 1
\end{array}
\end{equation}
where  $m_a$ denotes the effect of effort multiplier $a$ on {\em effort}.

The effort multipliers form
into two sets:
\be
\item
The {\em positive effort EM} features, with slopes $m^+_a$, that are proportional to effort. 
These features are:
cplx,
data,
docu,
pvol,
rely,
ruse,
stor, and
time.
\item
The
{\em negative effort EM} features, with slopes $m^-_{a}$,
are inversely proportional to effort.
These features are 
acap,
apex,
ltex,
pcap,
pcon,
plex,
sced ,
site,
tool.
\ee
Based on prior work~\cite{boehm00a}, we can describe
the
space of known tunings for COCOMO effort multipliers to be 
\begin{equation}\label{eq:mem}\small
\left(0.073 \le m^+_a \le 0.21\right) \wedge
\left(-0.178 \le m^-_a \le -0.078\right)
\end{equation}
Similarly, using experience from 161 projects~\cite{boehm00a},
we can say that the space of known tunings for the COCOMO scale factors 
(prec, flex, resl,team, pmat)
are:
\begin{equation}\label{eq:linesf}\small
 \forall x \in \{1..6\}\; SF_i=m_b(x - 6) \wedge \left(
-1.56	\le m_b \le -1.014\right)
\end{equation}
where  $m_b$ denotes the effect of scale factor $b$ on {\em effort}.

Note that the above ranges for the slopes were obtained by finding the average slope for each COCOMO attribute for both effort multipliers and scale factors over the range of values of that attribute.

\subsection{Defect Prediction with COQUALMO }
COQUALMO has two core models, used three ways:
\bi
\item
 The {\em defect introduction} model is similar to
\eq{coc2}; i.e. settings to \fig{cparems}'s effort multipliers and scale factors
map to predictions about number of defects
 that will be introduced in a given phase of development.
\item
The {\em defect removal} model represents how various tasks (peer reviews, execution-based
testing, and automated analysis) decrease the 
number of defects that escape detection (i.e., flow through to the next stage of development).
\item
The above two models are repeated 
for each of the three development phases of
requirements, design, or coding.
\ei
COQUALMO follows the same convention as COCOMO for the effort multipliers; i.e.
nominal values ($n=3$) add nothing to the predicted number of defects. As
above, COQUALMO is:
\begin{equation}\label{eq:linedefintro}\small
\begin{array}{l}
 \forall x \in \{1..6\}\; EM_i=m_c(x-3) + 1
\end{array}
\end{equation}
where  $m_c$ denotes the effect of $c$ on {\em defect introduction}.

The effort multipliers and  scale factors form two sets:
\be
\item The {\em positive defect} features, with slopes $m^+_c$, that are proportional
to the estimated introduced defects. These features are 
flex,
data,
ruse,
cplx,
time,
stor, and 
pvol.
\item The {\em negative defect} features, with slopes $m^-_c$, that are inversely proportional
to the estimated introduced defects. These features are 
acap,
pcap,
pcon,
apex,
plex,
ltex,
tool,
site,
sced,
 prec,
resl,
team,
pmat,
rely, and
docu.
\ee
The space of tunings for  defect introducing features are:
\begin{equation}\label{eq:coq}\small
\begin{array}{c}
requirements\left\{
\begin{array}{c}
0 \le m^+_c \le 0.112\\
-0.183 \le m^-_c \le -0.035
\end{array}
\right. \\
~\\
design \left\{
\begin{array}{c}
0 \le m^+_c \le 0.14\\
-0.208 \le m^-_c \le -0.048
\end{array}
\right. \\
~\\
coding \left\{
\begin{array}{c}
0 \le m^+_c \le  0.140\\
-0.19 \le m^-_c \le -0.053
\end{array}
\right.
\end{array}
\end{equation}

\noindent
The space of tunings for  defect removal features are:
\begin{equation}\label{eq:linedefrem}\small
\begin{array}{rl}
\forall x \in \{1..6\} &SF_i=m_d(x - 1)\\
requirements: 	& 0.08 	\le m_d \le 0.14 \\
design: 		& 0.1 	\le m_d \le 0.156 \\
coding: 		& 0.11 	\le m_d \le 0.176 \\
\end{array}
\end{equation}
where  $m_d$ denotes the effect of  $d$ on {\em defect removal}.

\subsection{THREAT: Predicting Overrun}\label{sec:threat}

The THREAT model
returns a heuristic estimate of the threat of a
schedule over run in the project. 
This estimation model is dependent upon
the COCOMO effort multipliers

Internally, THREAT contains dozens of tables of the
form of \fig{madeg}. Each such table  adds some ``threat'' value
to the overall project risk when multiplied by
the effort multiplier values of the corresponding COCOMO attributes.
Basically, the relationship between the attributes can potentially add to the THREAT associated with the project.
For \fig{madeg} for example, if sced is very low and rely is very high, that would add twice the product of the attribute values
(values that are derived from the COCOMO II tables) to the THREAT estimate.


\begin{figure}[!t]
{\scriptsize
\begin{center}
\begin{tabular}{|p{0.8in}|c|c|c|c|c|}\cline{2-6}
\multicolumn{1}{c|}{} &rely=&rely=&rely=&rely=&rely=\\
\multicolumn{1}{c|}{}& very & low &nominal & high & very\\
\multicolumn{1}{c|}{}&  low&  & &  &  high\\\hline sced= very
low& 0 & 0 & 0  &1  &2\\\hline sced= low     & 0 &0  & 0 &
0&1\\\hline sced= nominal& 0 & 0 & 0  &0  &0\\\hline sced= high&
0& 0 & 0  & 0 &0\\\hline sced= very high& 0 & 0 & 0  &0 &0\\\hline
\end{tabular}
\end{center}
} \caption{An example risk table}\label{fig:madeg}
\end{figure}

\fig{madeg} can be represented as
an exponentially decaying function that peaks in one corner of the risk table
at a value of two.
All the tables peak at either a value of two  or four.
Since this model is heuristic in nature, the exact height of the peak is
not certain.
When we perform Monte Carlo simulations over THREAT, we vary the height of
the peak by 
a random factor $0.5 \le x \le 1$ if the peak is four, and $0.5 \le x \le 1.5$ if the peak is two.
This is done assuming that the highest peak that can exist for this model is four, and that to lowest
is one.
 
There are six major THREAT categories: schedule, product, personnel, process, platform and reuse.
After the threat for each category is calculated, the sum is
normalized to produce the final threat rating.\\
