\section{Introduction}
Boa is a tool that can be used for data mining repositories of open-source projects. It contains the full history of a repository---from every revision's date and author, data on added, deleted and modified files to the complete state of the repository at the moment of commit. All data can be obtained by using the dedicated language. Boa provides a set of functions, which can be used for advanced data filtering \cite{boaDocumentation}\cite{dyer2013}.

Boa has already been used for a variety of studies, including developers' willingness to adapt new Java features \cite{dyer2014} or the licenses used in open-source projects \cite{vendome2015license}. So far they have not been metrics-oriented, even though the tool is intended to be used this way, as implicated by the inclusion of appropriate examples in the documentation of Boa \cite{boaExamples} (e.g., {\em What are the number of attributes (NOA), per-project and per-type?}, {\em What are the number of public methods (NPM), per-project and per-type?}).

In this paper we focus on using Boa infrastructure to answer three research questions:
\begin{enumerate}
\item Which of the classic, widely known, software engineering metrics can be implemented in Boa?

The implementation of classic software engineering metrics in Boa and publication of calculation scripts will make it easier to extend existing small-scale empirical software engineering research using software metrics, performed usually on a small number of projects, to a large-scale research.

\item What new metrics, that take advantage of the Boa's unique infrastructure, can be proposed?

This paper will serve as a guide, for other researchers and practitioners, which shows how to implement new software metrics taking into account the unique features, as well as limitations, of the Boa large-scale software repository mining platform.

\item What is the feasibility of defect prediction models based on large number of projects data obtained from Boa data sets?

According to our knowledge, this is one of the first attempts (if not the first) to build large-scale software defect prediction models based on a very large number of projects. Existing software defect prediction models usually base on a very limited number of projects.

\end{enumerate}
Presented study refers to state of Boa framework during October 2015 - January 2016 period -- when the source material was gathered.

\section{Research methodology} \label{sec:Methodology}
In this section we introduce briefly into the following topics: how we selected projects for further investigation (see Section~\ref{sec:ProjectsSelection}), how we implemented software metric scripts using the Boa language (see Section~\ref{sec:ImplementationOfSEMetrics}), and how we built software defect prediction models using software metrics from Boa (see Section~\ref{sec:DefectPredictionModel}), including also how we obtained data from the Boa output files (see Section~\ref{sec:weka}).

\subsection{Projects selection}\label{sec:ProjectsSelection}
Boa source code described in this paper has been developed and tested on two Boa data sets: September 2015 GitHub, and September 2013 SourceForge. A special filtering has been applied to select projects passing some entry criteria.
The software projects explored in our study had to pass the following criteria:
\begin{enumerate}

\item \textbf{They have to have a code repository with revisions.} The \textit{2013 September/SourceForge} data set consists of 700k projects. Our analysis with Boa queries has shown that 30\% of them have no code repository ~\cite[Section 2.1]{onlineAppendix}. Out of remaining 489k (amount close to this stated by Boa developers - 494,158 \cite{boaStatistics}) 4,767 projects have two repositories. Repositories in those projects have common history of revisions~\cite[Section 1.1]{onlineAppendix}. In case of projects with multiple repositories, only the first of them is considered during study to avoid data duplication. Out of 489k projects with one code repository, 423k of them had no code revisions (commits)~\cite[Section 1.2]{onlineAppendix}. It is difficult to determine whatever or not Boa is missing some data---the data sets have been defined for a given month in a given year, and current state of the repository might be different.

The \textit{2015 September/GitHub} data set has 7.83 million projects. 95\% of them have no code repository in the Boa framework, even though the majority of them is available from the GitHub website. They are active and public, but most of them have had no commits since 2013 \cite[Section 1.3]{onlineAppendix}. From 380k projects with repository, only 2486 of them had commits in 2015 \cite[Section 1.4]{onlineAppendix}. Out of the entire GitHub dataset, 4\% of projects have code repositories with revisions~\cite[Section 1.5]{onlineAppendix}.

\item \textbf{They have to have over 100 commits.} The projects picked should be mature enough for metrics calculation. A larger number of commits usually means a larger number of \textit{fixing revisions}, which are in turn used for development of software defect prediction models.

\item \textbf{They have to be written in Java.} Java has been picked for this research due to being a mature, object-oriented language, popular among developers.
It is also worth mentioning that Boa is written in Java, as well as provides extra Java-specific options, such as recognizing Java source files with and without parsing errors.
\end{enumerate}

The Boa language implementation of filters to select projects fulfilling the above mentioned criteria is presented in Listing \ref{lst:filtersBoaImpl}.

\lstinputlisting[captionpos=b, caption=Implementation of filters, label={lst:filtersBoaImpl}, basicstyle=\footnotesize]{b_filters.boa.tex}

The final number of projects that passed our entry criteria is presented in Table~\ref{table:datasets}.

\begin{table}[ht!]
\centering
\caption{Data sets}
\begin{tabular}{|l|l|l|}
\hline
\textbf{Dataset} & \textbf{All projects} & \textbf{Accepted projects}\\ \hline
GH small & 7,988 & 29\\ \hline
GH medium & 783,982 & 2485\\ \hline
GH large & 7,830,023 & 25307\\ \hline
SF small & 7,029 & 50\\ \hline
SF medium & 69,735 & 666\\ \hline
SF large & 699,331 & 7407\\ \hline
\end{tabular}
\label{table:datasets}
\end{table}

\subsection{Implementation of SE metrics}\label{sec:ImplementationOfSEMetrics}
All of the metrics are calculated for classes.
Each of the metric is implemented as a different Boa query, and is run on all Boa data sets mentioned in Section~\ref{sec:Methodology}. Due to long execution time, only data from GH small and SF small data sets are used for creating prediction models later on.

The output file of a query has to have the following data:
\begin{itemize}
\item{the ID of the project}
\item{the ID of the class}
\item{the value of the calculated metric or the expected value}
\end{itemize}
This approach makes it possible to effortlessly merge all values gathered as the outputs of Boa queries, so they can be used as an input data set for a prediction model.

\subsection{Defect prediction model}\label{sec:DefectPredictionModel}
Software defect prediction model is aiming to find the classes that cause the most defects. A simple strategy to find them is searching for the classes that had been fixed most frequently.
\subsubsection{Expected value - NCFIX} \label{sssec:expValue}
The expected value in our defect prediction model is Number of Class Fixes.
Based on Boa’s abilities, it is assumed the class has been fixed, if the two following conditions have been met:
\begin{itemize}
\item  the file containing the class has been modified in a revision;
\item  the revision is marked as a fixing revision by the Boa’s function\\ \texttt{isfixingrevision} \cite{boaDocumentation}.
\end{itemize}
The list of classes and their fixes is obtained by the following algorithm:

\begin{enumerate}
\item Create an empty key-value collection for storing respectively: files in projects, number of fixing revisions for each file.
\item Visit a project's repository revision.
\item Check if it’s a fixing revision.
\item Investigate the files changed in this revision.
\begin{enumerate}
\item If a file is marked as deleted, remove it from the collection.
\item If a file is added to the project in the current revision, add it to the collection:
\begin{enumerate}
\item with a value of 1 if the revision is a fixing one;
\item with a value of 0 otherwise.
\end{enumerate}
\item If a file is modified in the current revision, update it in the collection
\begin{enumerate}
\item increment the number of fixes by one, if the revision is a fixing one;
\item leave it otherwise.
\end{enumerate}
\end{enumerate}
\item Repeat steps 2-4 until you reach the most recent revision and there is no more revisions to check.
\item For all files stored in the collection, select only the ones that declare classes. Return the identifiers of the classes, and numbers of fixes corresponding to their files as the output.
\end{enumerate}
The algorithm is inspired by the \texttt{getsnapshot} function implemented by Boa \cite{boaDocumentation}, which returns the state of the repository at given time stamp.

\subsection{The use of Boa API and Weka}\label{sec:weka}
To allow easy management of Boa jobs and connecting job outputs with development of defect prediction models, a simple Java program \cite{sourceCodeGithub} has been written. The software uses Boa Java API \cite{boaAPI} release 0.1.0 to run jobs. Data from Boa is transformed into \texttt{.arff} file of following format:
\begin{lstlisting}[basicstyle=\footnotesize]
@RELATION classes
@ATTRIBUTE classID  string
@ATTRIBUTE M_1   NUMERIC
...
@ATTRIBUTE M_N   NUMERIC
@ATTRIBUTE fixingRevisions   NUMERIC
\end{lstlisting}
where \texttt{classID} is an identifier of a studied class; \texttt{M\_1 ... M\_N} is a vector of calculated metrics for a class from latest repository SNAPSHOT; \texttt{fixingRevisions} attribute is the expected value described in Section~\ref{sssec:expValue}.

\section{Results}
In this section three kinds of contribution are discussed, related to implementation of classic and new software metrics in Boa, as well as development of software defect prediction models on a basis of very large number of software projects. The latter can be seen as a way to address external validity threats common for most of the the empirical studies focused on software defect prediction.
All metrics' implementations are available to download via links provided in appendix \cite[Section 3]{onlineAppendix}.

\subsection{Implementation of classic software engineering metrics}
This section presents how to implement scripts to collect some of the well-known, classic software metrics~\cite{chidamber1994metrics} in Boa. The metrics were chosen based on their popularity and Boa's limitations.

\subsubsection{Obtaining classes}

Using \texttt{getsnapshot} function implemented in Boa, all files available in the most recent revision of the project are gathered. Then, they are filtered so that only the files containing classes are taken into consideration. The data stored in the \texttt{Declaration}~\cite{boaDocumentation} and its attributes are used for calculating the value of a metric.

\subsubsection{Inheritance issue}

Each declaration (class or interface) node in Boa has its array of parents \cite{boaDocumentation}. However, those parents are presented only as \textit{Types}, meaning, they only have \textit{TypeKind} (determining if it’s a class, interface, or something else) and name, without its full package path or any other identifier.
If two classes or interfaces in a project have the same name, but they are in different packages, it is impossible to determine which one is the ancestor of a given declaration.
Therefore, all metrics using inheritance (such as all of the MOOD metrics \cite{moodMetrics}, Depth of Inheritance Tree, Number of Children and Coupling between Object Classes~\cite{chidamber1994metrics}) had to be, unfortunately, excluded from the study.

\subsubsection{Metrics obtained directly from the \texttt{Declaration} node}

Weighted Methods per Class (WMC) in its base version---the sum of methods in a class, Number of Fields (NoF) and Number of Nested Declarations (NoND), presented in Table~\ref{table:declarationmetrics}, have been successfully implemented using the structure of the \texttt{Declaration} node alone.

\begin{table}[ht!]
\centering
\caption{\texttt{Declaration} attributes and associated metrics}
\begin{tabular}{l|c}
\textbf{Attribute} & \textbf{Metric}\\ \hline
methods & WMC\\ \hline
fields & NoF\\ \hline
nested\_declarations & NoND\\
\end{tabular}
\label{table:declarationmetrics}
\end{table}

For each of those metrics, the value is a length of the attribute array.
The execution time for those metrics is relatively small, up to 10 minutes for the biggest data sets, which clearly shows the advantages of using Boa and the approach to calculate metrics using the structure of the \texttt{Declaration} node, presented in this paper.

\subsubsection{Response For a Class (RFC)}
The RFC metric was implemented as a number of methods in the class, added to number of remote methods directly called by methods of the class.
\newline
The issue with the implementation of this metric is that Boa makes it difficult to recognize the difference between class’ inner method and method of the external classes of the same identifier.
For example: the method \texttt{getId()} of \texttt{class A}, called in \texttt{class B}, is seen as the same as method \texttt{getId()} in \texttt{class B}. If \texttt{class A} called two methods of the same name from different classes (\texttt{class B} and \texttt{class C}), those would be indistinguishable as well.
\newline
There is no direct method that would allow to instantly determine the types of called methods' arguments \cite{boaDocumentation} as well as the type of instance of variable from which the method was called \cite[Section 1.6]{onlineAppendix}. Such information can be obtained only by deeper analysis of Boa's AST tree, to the level of single \texttt{Statement}s.

The simplified version of the metric, that ignores this nuance, has been successfully implemented and ran for both Boa's data sets.

\subsection{Implementation of new software metrics}
The metrics presented below have been developed by us upon learning more about the Boa architecture and its tree structure.

\subsubsection{Number of Statements in Methods}

The NoSiM metric is calculated as a sum of all statements in class methods. The nodes calculated are of the Boa type \texttt{Statement}. For studied Java classes, those nodes are either blocks of code marked by \texttt{\{\}} or single code expressions.
The implementation of this metric is a starting point for implementation of a Lines of Code (LoC) metric. To achieve the LoC metric, all class' fields, number of methods, and such, would have to be added.

\subsubsection{Maximum Depth of Declaration Nesting} \label{sssec:MDoDN}
MDoDN is the maximum level of class nesting in a class.
For the following code:
\begin{lstlisting}[basicstyle=\footnotesize]
class A {
    class B {
        class C {}
    }
    class D {}
}
\end{lstlisting}
the result for \texttt{class A} would be 3 (the depth of \texttt{C} class). The metric is not calculated for nested classes (in the example: \texttt{B, C,} and \texttt{D}). For implementation of this metric, Boa's stack functions are used. Every time the node of a nested \texttt{Declaration} is entered, it is pushed onto the stack. The metric value is the stack's element count.

\subsubsection{Number of Anonymous Declarations}
NoAD for Java is a sum of all anonymous children classes in the parent class.
To calculate this metric, the \texttt{Expression} Boa node is tested for having a \texttt{Declaration} with a parameter of \texttt{ANONYMOUS} type.

\subsubsection{Cumulative metrics}
\label{sssec:CumulativeMetrics}
Metrics NoM, NoF, NoSiM, NoAD and NoND have been also successfully implemented in cumulative versions (CNoM \cite[Section~1.7]{onlineAppendix}, CNoF \cite[Section~1.8]{onlineAppendix}, CNoSiM \cite[Section~1.9]{onlineAppendix}, CNoAD \cite[Section~1.10]{onlineAppendix}, CNoND \cite[Section~1.11]{onlineAppendix}), where calculated value is a sum of metric for not only a class, but also all its nested and local classes.

\subsection{Defect prediction model}\label{subsec:predictionModel}
The defect prediction model presented below is a single defect prediction model calculated for a high number of Boa projects. This is different from a traditional approach, with a single, or several projects used to develop defect prediction models.

Data obtained from the Boa output files (described in Section~\ref{sec:weka}) is randomly separated into training set and testing set (in 9:1 proportion). The \texttt{fixingRevisions} attribute in the testing set is nulled out, so it can be calculated using prediction model.

We used Random Forest to build defect prediction model. Random Forest generates a lot of random samples which are the subsets of training data set. A decision tree is generated for each of the samples \cite{Breiman2001}. The parameters listed below have been determined experimentally:
\begin{itemize}
	\item {number of trees : 200},
	\item {max depth : 12},
	\item {number of features : 12},
	\item {cross-validation folds: 10},
	\item {random seed: 1}
\end{itemize}
The results of 10-fold cross-validation are presented in Table~\ref{table:evalModelResults}. Pearson product-moment correlation coefficient $r$ shows a low correlation between the results from defect prediction model and real values, with high error ratio. Those results are further analyzed in Section \ref{sec:dicussion}.

\newcommand{\specialcell}[2][c]{\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
\begin{table}[ht!]
\centering
\caption{Results of evaluation of the prediction model}
\begin{tabular}{l|c c}
\textbf{Evaluation attribute} & \textbf{\specialcell{GH 2015\\(small)}} & \textbf{\specialcell{SF 2013\\(small)}}\\ \hline
Correlation coefficient (R) & 0.215 & 0.244\\ \hline
Mean absolute error (MAE) & 2.16 & 0.603\\ \hline
Root mean squared error (RMSE) & 9.96 & 1.32\\ \hline
Relative absolute error (RAE) & 102\% & 93.3\%\\ \hline
Root relative squared error (RRSE) & 100\% & 97.8\%\\ \hline
\end{tabular}
\label{table:evalModelResults}
\end{table}

\subsection{Reference values of software metrics}

The subsequent goal was to characterize a large number of open source projects available from Boa by means of software metrics in order to create reference values of software metrics.
Table~\ref{table:stats} presents descriptive statistics for each of calculated metrics among the data sets.

\begin{table}[ht!]
\centering
\caption{Mean, median and standard deviation for metrics calculated in the study.}
\resizebox{\textwidth}{!}{
\begin{tabular}{l|c|c|c|c|c|c|c|c|c|c|c|c}
\textbf{\specialcell{Metric}} & \multicolumn{3}{|c|}{\textbf{\specialcell{GH2015\\(all)}}} & \multicolumn{3}{|c|}{\textbf{\specialcell{GH2015\\(fixes > 0)}}} & \multicolumn{3}{|c|}{\textbf{\specialcell{SF2013\\(all)}}} & \multicolumn{3}{|c|}{\textbf{\specialcell{SF2013\\(fixes > 0)}}}\\ \hline
\textbf{\specialcell{ }} & \textbf{\specialcell{$\mu$}} & \textbf{\specialcell{$\tilde{x}$}} & \textbf{\specialcell{$\sigma$}}  & \textbf{\specialcell{$\mu$}}  & \textbf{\specialcell{$\tilde{x}$}} & \textbf{\specialcell{$\sigma$}} & \textbf{\specialcell{$\mu$}} & \textbf{\specialcell{$\tilde{x}$}} & \textbf{\specialcell{$\sigma$}}  & \textbf{\specialcell{$\mu$}}  & \textbf{\specialcell{$\tilde{x}$}} & \textbf{\specialcell{$\sigma$}} \\ \hline
NOAD & 0.12 & 0 & 0.86
& 0.15 & 0 & 1.05
& 0.17 & 0 & 1.31
& 0.34 & 0 & 2.40\\ \hline
CNOAD & 0.13 & 0 & 0.93
& 0.17 & 0 & 1.13
& 0.19 & 0 & 1.39
& 0.36 & 0 & 2.51\\ \hline
NOND & 0.32 &  0 & 1.20
& 0.32 & 0 & 1.28
& 0.14 & 0 & 0.83
& 0.22 & 0 & 1.00\\ \hline
NOF & 2.98 & 1 & 15.64
& 3.10 & 1 & 9.29
& 3.75 & 2 & 8.51
& 4.36 & 2 & 11.43\\ \hline
CNOM & 7.10 & 3 & 18.69
& 7.50 & 4 & 13.84
& 8.97 & 5 & 14.21
& 11.48 & 6 & 19.27\\ \hline
MDODN & 0.20 & 0 & 0.44
& 0.22 & 0 & 0.47
& 0.14 & 0 & 0.38
& 0.20 & 0 & 0.45\\ \hline
CNOSIM & 40.33 & 13 & 104.15
& 48.51 & 16 & 126.33
& 65.84 & 26 & 177.32
& 90.83 & 33 & 221.83\\ \hline
NOSIM & 36.80 & 13 & 92.57
& 44.43 & 15 & 116.30
& 61.58 & 24 & 170.26
& 83.28 & 31 & 208.54\\ \hline
NOM & 6.40 & 3 & 16.85
& 6.67 & 3 & 11.64
& 8.15 & 5 & 12.41
& 10.12 & 5 & 17.09\\ \hline
CNOF & 7.10 & 3 & 18.69
& 7.50 & 4 & 13.84
& 8.97 & 5 & 14.21
& 11.48 & 6 & 19.27 \\ \hline
CNOND & 0.33 & 0 & 1.26
& 0.34 & 0 & 1.37
& 0.14 & 0 & 0.87
& 0.23 & 0 & 1.05\\ \hline
RFC & 13.03 & 7 & 23.27
& 15.19 & 8 & 22.55
& 19.06 & 12 & 24.10
& 24.81 & 15 & 32.75\\
\end{tabular}
}
\label{table:stats}
\end{table}

\section{Discussion}
\label{sec:dicussion}

The presented prediction model was tested on small data sets, but with correct resources it can be easily scaled to use full data sets with up to 25k subjects. This use case would be, to the best of our knowledge, the first attempt to create a large-scale defect prediction model, as other examples from literature show prediction models developed using less than 200 projects \cite{JureczkoMadeyski10,JureczkoMadeyski15,Madeyski15SQJ}.

The performance of the prediction model is poor due to the fact that a majority of classes studied has zero fixing revisions and therefore input data is highly unbalanced, see Table~\ref{table:classFixes}.
However, the quality of prediction model and employing methods to deal with the class imbalance problem are not the main objectives of the study.
Our aim was to show that it is possible to collect all the data necessary to build a large-scale software defect prediction model using the Boa platform.

Results from Table~\ref{table:stats} show that not for all metrics standard deviation is lower for filtered datasets. This can be caused by the nature of metrics (such as NoND, NoAD, MDoDN), which are unlikely to have a high mean value in majority of projects.

\begin{table}[ht!]
\centering
\caption{Number of classes with zero and more than zero fixes in datasets}
\begin{tabular}{c|c|c}
\textbf{\specialcell{Amount of\\class fixes}} & \textbf{\specialcell{GH 2015\\small}} & \textbf{\specialcell{SF 2013\\small}}\\ \hline
0 & 13296 (58.9\%) & 30244 (80.1\%)\\ \hline
\textgreater 0 & 9260 (41.1\%) & 7504 (19.9\%)\\
\end{tabular}
\label{table:classFixes}
\end{table}

\subsection{Further research}
It is worth to look at the way the fix in the revision is identified. Boa-provided function \texttt{isfixingrevision} is based only on the commit message text analysis. We assume this function is not ideal and integrating Boa API with outside software, such as bug tracking systems, can be a better solution to determine existing bugs in code revisions.

The data used for building prediction models in our study has big disproportions. Applying different filters and criteria (more mature projects, different languages and so on) could provide better data set for analysis, with more fixing revisions.

An interesting path of further research are process metrics~\cite{Madeyski15SQJ,Madeyski11}, which reflect changes over time and are becoming the crucial ingredients of software defect prediction models.

\section{Conclusions}
Overall, the goal of the research, as described with research questions --- implementation of software metrics in Boa and collecting data sets from a large number of projects, e.g., for the sake of prediction models ---has been achieved. We were able to implement some of the classic software engineering metrics using Boa, we presented some Boa-specific metrics, and we made an attempt to create a defect prediction model with the data we gathered. This proves that Boa can be a useful tool for data mining analysis in this particular field, as well as for creating sophisticated queries regarding its data sets. However, Boa is still a new framework that comes with a few disadvantages, and some of the metrics and operations were impossible to implement at the moment. In the following sections, the challenges met and our solutions are presented.

\subsection{Challenges}
\label{subsection:challenges}
Boa uses visitor pattern---one of Boa's greatest strengths---which sometimes might provide unexpected results if queries are not written properly.

\subsubsection{Local and nested classes}
One of the first issues we encountered creating Boa queries was a different size of output jobs. For our metrics, we gathered all classes from all projects. Therefore, for the same data set, all queries should return the same number of rows.
As it turned out, the difference was caused by the behaviour of the visitor pattern, used by Boa. When source code contains a local class (class defined inside one of the methods) or a nested class (a class declared inside of another class), this class is visited by the visitor pattern before the analysis of the class containing it ends. Upon returning to the class-container, some of it's metrics and calculations had been assigned to the local or nested class.

\textbf{Solution:} Boa offers implementation of stacks, which we started using while visiting local and nested classes. We took advantage of this solution implementing the Maximum Depth of Declaration Nesting metric described in Section~\ref{sssec:MDoDN}.

\subsubsection{Boa code compilers}
Boa uses two different code compilers for SourceForge and GitHub data sets. As the framework is still in early development, sometimes the same query acts differently depending on the data set used.

\textbf{Example:} One of Boa sample queries "How many committers are there for each project?" \cite{boaExampleCommiters} works fine in SF \cite[Section 1.12]{onlineAppendix}, but causes compilation error in GH \cite[Section 1.13]{onlineAppendix}.
\newline
In that case, a small change in the code notation solved the issue \cite[Section 1.14]{onlineAppendix}:

\begin{itemize}
    \item Code resulting with error:
\begin{lstlisting}[basicstyle=\footnotesize]
committers[p.code_repositories[i].revisions[j].committer.username] = true;
\end{lstlisting}
    \item Code resulting with success:
\begin{lstlisting}[basicstyle=\footnotesize]
username : string = p.code_repositories[i].revisions[j].committer.username;
committers[username] = true;
\end{lstlisting}
\end{itemize}

This example shows that a person creating queries with Boa might run into different issues depending on the data set picked.

During our research, we often used Boa dictionaries. Dictionaries are defined by Boa as \texttt{map[key\_type] of [value\_type]}. Boa returns an error, if \texttt{int} is used as a \texttt{value\_type}. We must have stored our integer values as strings, which resulted in converting value to integer each time it was used in calculations, and then back to string to update the map.

\subsubsection{Debugging process}
The errors reported by Boa are often lacking any sort of description. The debugging process comes down to commenting out parts of queries to check which fragments are causing errors. Each code test takes about a minute (and then some follow-up time to check if the output data is correct), and sometimes multiple tests are required to find the source of an error. There is no way of tracking the execution of the queries.

\textbf{Solution:} All variables used during the debugging process have to be initiated, by defining its type and aggregation method, and then returned in the output file.

\subsection{Contribution}
The paper describes our experience with using Boa platform for implementing software engineering metrics and defect prediction models. Our findings can be useful for both researchers---with solutions presented in Section~\ref{subsection:challenges} and provided source codes for metrics we implemented---as well as developer teams and project managers, providing an example for obtaining large-scale SE metrics for projects of particular profile (i.e. number of commits, used programming language and so on).
The metric implementations proposed by us are scalable---calculated for classes, but could be as well implemented for packages or projects.

Based on our findings, we confirm that Boa can be a powerful data mining tool, which can be used for a variety of research, alone and with usage of other software, like Weka, as demonstrated in Section~\ref{sec:weka}.


\section{I\lowercase{ntroduction}}
In the present work we investigate the cosmological evolution of
the brane-bulk system in the framework of the Randall-Sundrum
$(A)dS_5$ scenario [1]. The effective 4D gravitational  equations
in the brane without curvature correction terms were first
obtained by Shiromizu, Maeda and Sasaki [2]. These equations
have been later recovered and generalized both on the brane and
in the bulk taking into account the  effect of a general bulk
energy-momentum tensor and either the asymmetric embedding [3] or
the accelerations of normals [4]. However, even employing  more
generalized gravitational actions, the derived 4D Einstein
equations do not in general form a closed system due to the
presence of a Weyl term which can only be specified in terms of
the bulk metric, so other equations are to be written down and
different procedures arise in splitting the non-Einsteinian terms
between bulk and brane [5]. We assume omogeneity and isotropy in
the three ordinary spatial dimensions but these symmetries cannot
be extended to the extra dimension due to the presence of the
brane, so all the physical quantities will depend on time and on
the extra dimension. The solutions of the 5D Einstein equations
that we shall obtain will be valid strictly in the bulk.  Then we
project on the brane at $y=0$ those equations and making use of
the junction conditions, modified by an additional term coming
from the $^{(4)}R$ curvature correction, as the boundary
conditions imposed for the embedding of the brane in the bulk
we obtain the effective 4D Einstein  equations on the brane
consistent with the bulk geometry. The method used here of
deriving the 5D solution that is then projected  onto the brane
to study the brane dynamics was used extensively in the early
days of braneworld cosmology by P.Kanti et al [6]. The  paper
is organised as follows. In the next Section, before giving a
brief account of our method, we summarize the results  obtained
by Kofinas [7] when the $^{(4)}R$ term is included in the 5D
action. Such a term, that was considered by a number of authors
in the literature (see [8],[9],[10] and references therein), is
generically introduced by quantum corrections coming from the
bulk gravity and its coupling with matter confined to the brane,
moreover its inclusion brings a convenient decomposition of the
matter terms.  In Section 3 we find  the related  equations  in
the brane, assumed infinitely thin and $\mathbf{Z_2}$ symmetric
in the bulk. In Section 4 we use the flexibility of the 5D
solution to describe some cosmological models in 4D.  Finally,
in the Appendix we show how the 5D dynamical solution we adopt
can be obtained starting from a 5D static solution.\par\noindent
\textit{Conventions}. Throughout  the  paper the 5D metric
signature is taken to be $(+,+,+,-,\varepsilon)$ where
$\varepsilon$ can be $+1$ or $-1$ depending on whether the extra
dimension is spacelike or timelike, while the choice of the 4D
metric signature is $(+,+,+,-)$. The spacetimes coordinates are
labelled $x^i=(r,\vartheta,\varphi), x^4=t$. The extra coordinate
is $x^5=y$. Bulk indices will be denoted by capital Latin letters
and brane indices by lower Greek letters. In what follows we
choose units such that $\hbar = c = 1$.
\section{B\lowercase{raneworld} E\lowercase{instein field
equations}} In this section we recall the results obtained by
Kofinas [7], which we shall use in the following, giving a brief
account of their derivation. Once we have solved the equations in
the bulk, the form of the induced equations will allow us finding
brane solutions following the methods of General Relativity with
a well defined energy-momentum tensor. The starting point in [7]
is a three-dimensional brane $\Sigma$ embedded in a
five-dimensional spacetime $M$. For convenience the coordinate
$y$ is chosen such that the hypersurface $y = 0$ coincides with
the brane. The total action for the system is taken to be
\begin{eqnarray} \mathcal{S} && = \dfrac{1}{2\,\kappa_{5}^2}\,
\int_M\, \sqrt{-\varepsilon\,^{(5)}g} \,(^{(5)}R -
2\Lambda_5)\,d^5x + \dfrac{1}{2\,\kappa_{4}^2} \,\int_\Sigma\,
\sqrt{-\,^{(4)}g} \,(^{(4)}R - 2\Lambda_4)\,d^4x \nonumber\\ &&
\,\, +  \int_M\, \sqrt{-\varepsilon\,^{(5)}g} \,L_5^{mat}\,d^5x +
\int_\Sigma\, \sqrt{-\,^{(4)}g} \,L_4^{mat}\,d^4x
\end{eqnarray}
The constants $\kappa_5^2$ and $\kappa_4^2$ are given by
\begin{equation}
\kappa_5^2 = 8\pi G_5 = M_5^{-3} \quad,\quad  \kappa_4^2 = 8\pi
G_4 = M_4^{-2}
\end{equation}
where  $M_5$ and $M_4$ are the Planck masses.
Varying (1) with respect to the
bulk metric $g_{AB}$ one obtains the equations
\begin{equation}
^{(5)}G_A^B = - \Lambda_5 \delta_A^B + \kappa_5^2\, (^{(5)}T_A^B
+ ^{(loc)}T_A^B \delta(y))
\end{equation}
where
\begin{equation}
^{(loc)} T_A^B = -\,
\dfrac{1}{\kappa_4^2}\,\sqrt{\dfrac{-\,^{(4)}g}{-\varepsilon\,^{(5)}g}}\,
(^{(4)}G_A^B - \kappa_4^2\,{^{(4)}}T_A^B + \Lambda_4h_A^B)
\end{equation}
is the localized energy-momentum tensor of the brane.
$^{(5)}G_{AB}$ and $^{(4)}G_{AB}$ denote the Einstein tensors
constructed from the bulk and the brane metrics respectively,
while the tensor $h_{AB} = g_{AB} -\varepsilon n_An_B$ is the
induced metric on the hypersurfaces $y$ = constant, with $n^A$
the normal unit vector on these
\begin{equation}
n^A = \dfrac{\delta_5^A}{\Phi}, \hspace{0.5in} n_A =
(0,0,0,0,\varepsilon \,\Phi)
\end{equation}
The scalar $\Phi$ which normalizes $n^A$ is known as the lapse
function and in a cosmological scenario which we shall consider
later, it will depend on $t$ and $y$.  The way the  coordinate
$y$ has been chosen allows to write the five-dimensional line
element, at least in the neighborood of the brane, as
\begin{equation}
dS^2 = g_{AB}\, dx^A dx^B = g_{\mu\nu}\, dx^\mu dx^\nu +\varepsilon
\,\Phi^2dy^2
\end{equation}
Using the methods of   canonical analysis [11] the Einstein eqs.
(3) in the bulk  are split into the following sets of equations
\begin{subequations}
\begin{eqnarray}
K_{\mu;\nu}^\nu -\, K_{;\mu}  &&=\, \varepsilon\, \kappa_5^2\,
\Phi\,^{(5)}T_\mu^y \label{equation20}\\
K_\nu^\mu K_\mu^\nu - K^2 +\, \varepsilon\,{^{(4)}R}  &&=\,
 2\, \varepsilon \,(\Lambda_5 -\, \kappa_5^2\,{^{(5)}}T_y^y)
\label{equation21}\\ \hspace{-0.3in} \dfrac{\partial
K_\nu^\mu}{\partial y} + \Phi\,K\,K_\nu^\mu -\, \varepsilon\,
\Phi\,^{(4)}R_\nu^\mu + \varepsilon\,
g^{\mu\lambda}\,\Phi_{;\lambda\nu} &&=\, -\,\varepsilon
\kappa_5^2\,\Phi\,\left(^{(loc)}T_\nu^\mu -\,
\dfrac{1}{3}\,^{(loc)} T\,\delta_\nu^\mu\right)\,\delta(y)
\nonumber\\  &&\quad\, -\, \varepsilon\,
\kappa_5^2\,\Phi\,^{(5)}T_\nu^\mu
+\dfrac{\varepsilon}{3}\,\Phi\,(\kappa_5^2\,{^{(5)}T} -\,
2\Lambda_5)\,\delta_\nu^\mu \label{equation22}
\end{eqnarray}
\end{subequations}
where $K_{\mu\nu}$ is the extrinsic curvature of the
hypersurfaces $y$ = constant:
\begin{equation}
K_{\mu\nu} = \dfrac{1}{2\,\Phi}\,\dfrac{\partial
g_{\mu\nu}}{\partial y}, \quad K_{A y} = 0
\end{equation}
The Israel junction conditions [12] for the singular part
in eq. (7c) are
\begin{equation}
[K_\nu^\mu] = -\varepsilon\,
\kappa_5^2\,\Phi_0\,\left(^{(loc)}T_\nu^\mu -\,
\dfrac{1}{3}\,^{(loc)} T\,\delta_\nu^\mu\right)
\end{equation}
where the square brackets mean discontinuity of the quantity
across $y = 0$ and $\Phi_0$ represents $\Phi$ at $y=0$.
Consequently, considering a $\mathbf{Z_2}$ symmetry on reflection
around the brane, (9) becomes
\begin{equation}
^{(4)}G_\nu^\mu = - \Lambda_4\,\delta_\nu^\mu + \kappa_4^2\,
{^{(4)}T_\nu^\mu}  + \dfrac{2 \varepsilon}{r_c}\,(\overline{K}_\nu^\mu
- \overline{K}\delta_\nu^\mu)
\end{equation}
where \,$\overline{K}_\nu^\mu = K_\nu^\mu(y=0^+) =
-\,K_\nu^\mu(y=0^-)$\, and \,$r_c =
\kappa_5^2/\kappa_4^2$\, is a crossover term which determines
the region of validity of conventional  four-dimensional General
Relativity. From eq. (7a) it follows that the tensor
$^{(4)}T_\nu^\mu$ satisfies the  conservation
law $^{(4)}{T_\nu^\mu}_{;\mu} = 0$
provided $^{(5)}T_\mu^y =0$, which means no exchange of energy
between brane and bulk. The quantities $\overline{K}_\nu^\mu$ are
still undetermined and should be obtained from some exact
solution of the global five-dimensional spacetime. To determine
the equations on the brane one can follow the method suggested
in ref. [2], but this will reveal a difficult task due to the
necessity of taking into account the evolution of the Weyl term
to close the system of equations. A different approach, as
discussed by Bin$\grave{e}$truy et al. [13], is to solve the 5D
Einstein equations strictly in the bulk ($y\neq 0$) and then to
take the brane into account by using the Israel junction
conditions. In this work we shall keep in mind this latter
approach but, having added the $^{(4)}R$ term, we shall make  a
different use of the junction conditions. More in detail, we
start projecting on the brane the  solution obtained in the bulk
without considering the  distributional part at $y=0$. This will
be done using the geometrical identity
\begin{equation}
^{(4)}R_{BCD}^A =\,
^{(5)}R_{NKL}^M\,h_M^A\,h_B^N\,h_C^K\,h_D^L +
\varepsilon \, (K_C^A\,K_{BD} - K_D^A\,K_{BC})
\end{equation}
and taking suitable contractions from  the above relation. So it
is possible to construct the four and five-dimensional Einstein
tensors and to get finally the parallel to the brane equations
\begin{eqnarray}
^{(4)}G_\nu^\mu = && -\,\dfrac{1}{2}\,\Lambda_5 \delta_\nu^\mu
+ \dfrac{2}{3}\,\kappa_5^2\, \left({}^{(5)}\overline{T}_\nu^\mu +
\left({}^{(5)}\overline{T}_y^y -
\dfrac{1}{4}\,{}^{(5)}\overline{T}\right) \delta_\nu^\mu  \right)
\nonumber \\
&& +\varepsilon \, \left(\overline{K}\,\overline{K}_\nu^\mu -
\overline{K}_\lambda^\mu\, \overline{K}_\nu^\lambda \right) +
\dfrac{\varepsilon}{2}\, \left(\overline{K}_\lambda^\kappa\,
\overline{K}_\kappa^\lambda - \overline{K}^2\right)
\delta_\nu^\mu - g^{\kappa\mu}\,{}^{(5)}\overline{C}_{\kappa y
\nu}^y
\end{eqnarray}
Here ${}^{(5)}C_{\kappa y \nu}^y$ is the ``electric'' part of
the bulk Weyl tensor, while $\overline{T}$ and $\overline{C}$ are
the limiting values of those quantities at $y = 0^+$ or $0^-$.
Once we have solved the Einstein equations strictly in the bulk
we can make explicit the various terms appearing in the
right-hand side of (12). Now we impose to the above solution
boundary conditions to take into account the physical presence of
the brane. This can be done if we consider equations  (10) as the
boundary conditions imposed for the embedding of the brane in the
bulk so  we  have to  equate the two independent equations (10)
and  (12). In this way, however, we would obtain the ``bare''
quantities $\Lambda_4$ and ${^{(4)}T_\nu^\mu}$ but not  the
effective quantities as seen by an observer  confined to the
brane. For a brane observer eqs. (10) are instead written as the
usual Einstein equations
\begin{equation}
^{(4)}G_\nu^\mu = - \Lambda_{4,eff}\,\delta_\nu^\mu + \kappa_4^2\,
\left({^{(4)}T_\nu^\mu}\right)_{eff}
\end{equation}
So  the cosmological constant  $\Lambda_{4,eff}$ and the
effective energy-momentum tensors
$\left({^{(4)}T^\mu_\nu}\right)_{eff}$ can be obtained
equating the right-hand sides of eqs. (12) and (13).
\section{D\lowercase{ynamics in the brane-bulk system}} We
consider the 5D metric in the form commonly used in cosmological
applications
\begin{equation} dS^2 = a^2(t,y)\,d\sigma_k^2 -
n^2(t,y)\,dt^2 + \varepsilon\,\Phi^2(t,y)\,dy^2
\end{equation}
where
\begin{equation}
d\sigma_k^2 = \dfrac{dr^2}{1-k r^2} + r^2
(d\vartheta^2+\sin^2\vartheta d\varphi^2)
\end{equation}
and $k = +1, 0, -1$ is the curvature index. Having specified the
form of the metric, we now turn to the 5D Einstein equations (3)
considered strictly in the bulk, that is, without the
energy-momentum tensor at $y=0$. These equations  can be solved
once the structure and the content of the bulk come as a result
of a physically acceptable theory in higher dimensions. Exact
time-dependent solutions which generalize the static solutions
were constructed using diffeomorphism invariance [14,15].
Kehagias and Tamvakis [16] transformed the static Randall-Sundrum
$(A)dS_5$ solution  into a dynamical one by considering boosts
along the fifth dimension and  found a time-dependent 5D solution
for a bulk with vacuum energy but otherwise empty and with
vanishing Weyl tensor. In the  present work we want instead to
consider (see (12)) a bulk where the non-localized
energy-momentum tensor and the ``electric'' part of the Weyl
tensor are different from zero, so we should start by a well
defined bulk matter content described by the tensor
$^{(5)}T_A^B$ and then solve the field equations. However
our aim is to overcome  the problem  of the brane field equations
being non-closed so, to give an illustrative example of our
method, we shall proceed in a bit unhorthodox way. In
order to have a simple and non-trivial dynamical 5D solution we
start from a static Randall-Sundrum $(A)dS_5$ bulk and we
construct, generalizing the transformations in [16] a dynamical
5D line element with non-vanishing 5D Weyl tensor. Subsequently
we obtain the correspondent energy-momentum content using the
Einstein equations. This manner of proceeding  may be justified
by the fact that this work is mainly focused on the brane
phenomenology of the model. Here we anticipate the main results
of the procedure and defer to the Appendix for detailed
calculations.  Our dynamical line element will be obtained
transforming the static Randall-Sundrum $(A)dS_5$ metric, where
the three-space is not necessarily flat but has a curvature index
$k = +1, 0, -1$, into a dynamical one by considering boosts along
the fifth dimension. Then we take into account the Einstein
equations in the bulk, away from the brane at $y=0$,  and
require that there is no energy flow from the brane towards the
bulk and vice-versa, which implies ${}^{(5)}G_t^y = 0$. The
above constraint is easily satisfied if one  chooses wave-like
expression for the metric coefficients so, assuming the $Z_2$
symmetry $y \to -\,y$, it follows that  $a(t,y)$, $n(t,y)$ and
$\Phi(t,y)$ in the line element (14) will be function of
$w=t-\,\lambda\, |y|$ with $\lambda$ a dimensionless constant.
Metric coefficients in the form of plane waves propagating in the
fifth dimension have previously been used in the literature in
somewhat different contexts [17,18,19,20]. Finally, the bulk line
element away from the brane was found to depend only by the scale
factor $a(t,y) = a(t-\,\lambda\, |y|)$ in the form
\begin{eqnarray}
dS^2 = a^2\, d\sigma_k^2
\hspace{-.3cm}  &&-\, \dfrac{1}{2\,\gamma^2 \lambda^2}\,
\left(\kappa^2 a^2 + \sqrt{\kappa ^4 a^4 + 4\,\varepsilon\,
\gamma^2 \lambda^2\, ({\overset{\ast}{a}})^2}\right)\, dt^2
\nonumber \\ &&+\, \dfrac{1}{2\,\gamma^2}\, \left(-\, \kappa^2
a^2 + \sqrt{\kappa ^4 a^4 + 4\,\varepsilon\, \gamma^2 \lambda^2\,
({\overset{\ast}{a}})^2}\right)\, dy^2
\end{eqnarray}
where $\kappa$ is the constant scale factor for the extra
dimension, the superscribed asterisk $\overset{\ast}{\frac{}{}}$
denotes derivative with respect to $w$ and $\gamma$ is a
dimensionless constant which comes from the constraint
${}^{(5)}G_t^y = 0$, namely ${\overset{\ast}{a}} =
\gamma\,n\,\Phi$. It should be noted that $a(t - \lambda \,
|y|)=0$ corresponds to a scale factor singularity for the 5D
model which is similar to those that occur in the 4D
Friedmann-Robertson-Walker models. From the following
curvature invariants
\begin{equation}
\hspace{-0.5cm}^{(5)}R=-20\epsilon\kappa^2+
\dfrac{6k}{a^2(t-\lambda \, |y|)}\hspace{0.5cm}
^{(5)}R_{AB}{^{(5)}R^{AB}}=80\epsilon\kappa^4-\dfrac{48\epsilon k
\kappa^2}{a^2(t-\lambda \,|y|)}+\dfrac{12k^2}{a^4(t-\lambda \,|y|)}
\end{equation}
\begin{equation}
^{(5)}R_{ABCD}{^{(5)}R^{ABCD}}=40\epsilon\kappa^4-\dfrac{24\epsilon
k\kappa^2}{a^2(t-\lambda \,|y|)}+\dfrac{12k^2}{a^4(t-\lambda
\,|y|)}
\end{equation}
we see that there is no other singularity except the  one which
may unaivodably occur if the scale factor of the fifth dimension
vanishes in some $(t,y)$ hyperplane.\par\noindent Now we calculate the
5D Einstein tensor and from the field equations  considered
strictly in the bulk we obtain the cosmological constant
$\Lambda_5$  and the  energy-momentum tensor $^{(5)}T_A^B$ as
\begin{equation}
\Lambda_5 = -\,6\,\varepsilon\,\kappa^2 , \qquad ^{(5)}T_A^B =
\textrm{diag}(p_B,p_B, p_B,-\,\rho_B,p_\perp)
\end{equation}
where
\begin{equation} \kappa_5^2\,p_B =
-\,\dfrac{k}{a^2(t-\lambda \,|y|)},  \quad \kappa_5^2\,\rho_B =
-\,\kappa_5^2\,p_\perp = \dfrac{3\,k}{a^2(t-\lambda \,|y|)}
\end{equation}
the subscript ${}_B$ referring to the bulk. A comment is needed
about the cosmological fluid described by the energy-momentum
tensor which arises  from the curvature index $k$ in eq. (15).
It obeys an equation of state $p_B = (\gamma - 1)\,\rho_B$ with
barotropic index $\gamma = 2/3$, its pressure and energy density
are proportional to $k$ and scale as $a^{-2}$. All these features
lead to the interesting possibility that the energy-tensor (20)
can describe a fluid composed of cosmic strings, as discussed by
a number of authors [21].  We can
use the flexibility  of the metric (16) to choose many different
5D scale factors, but clearly each choice must meet the necessary
requirements to give models acceptable on physical grounds.\par\noindent
Let us now deal with the brane dynamics. We consider homogeneous
and isotropic geometries in the brane so the effective tensor
$\left({^{(4)}T^\mu_\nu}\right)_{eff}$ will describe a
cosmological fluid endowed with pressure $p_{eff}$ and energy
density $\rho_{eff}$.  Equating eqs. (12) and (13)  we obtain
\begin{eqnarray}
-\, \Lambda_{4,eff} +
\kappa_4^2\, p_{eff} &=& -\,\dfrac{\Lambda_5}{2} -
\dfrac{\epsilon}{\Phi_0^2} \left(\dfrac{1}{a}\dfrac{\partial
a}{\partial y}\right)_0 \left(\dfrac{1}{a}\dfrac{\partial
a}{\partial y} + \dfrac{2}{n}\dfrac{\partial n}{\partial
y}\right)_0 - \dfrac{k}{a_0^2} \\
-\, \Lambda_{4,eff}
-\,\kappa_4^2 \,\rho_{eff} &=& -\,\dfrac{\Lambda_5}{2}  -\,
\dfrac{3\,\epsilon}{\Phi_0^2} \left(\dfrac{1}{a}\dfrac{\partial
a}{\partial y}\right)_0^2 -\,\dfrac{3 k}{a_0^2}
\end{eqnarray}
The effective  cosmological constant  $\Lambda_{4,eff}$ may
be different from $\Lambda_5/2 = -3\,\epsilon\,\kappa^2$, its
value being modified by possible additive constant   terms
contained in (21) and (22). The Einstein tensor $^{(4)}G_\nu^\mu$
which appears in the left-hand sides of (12) and (13) is
constructed from the brane metrics
\begin{equation}
ds^2 = \widetilde{a}^2(t)\,d\sigma_k^2 - \widetilde{n}^2(t)\,
dt^2 \end{equation}
Now, in higher-dimensional theories there is the question of
which metric frame is the correct representation of our
four-dimensional spacetime. In  many braneworld theories, the
physical metric in 4D is identified with the induced one, while
in other approaches the physical metric either is assumed to be
conformally related to the induced one or is determined by the
condition of classical confinement in the absence of
non-gravitational forces [22]. For the sake of simplicity, here
we choose to identify  the metric (23) with the induced one, so
we have $\widetilde{a}(t) = a(t,0) \equiv a_0(t)$  and
$\widetilde{n}(t) = n(t,0)\equiv n_0(t)$. It follows that eqs.
(12) and (13) are identically satisfied by the Einstein tensor
$^{(4)}G_\nu^\mu$ constructed from (23). From the knowledge
$a_0(t)$ and $n_0(t)$ one can also obtain other cosmological
quantities such as the Hubble parameter $H=\dot{a_0}/(n_0 a_0)$
or the deceleration parameter $q = -\,
(a_0\,\ddot{a_0})/\dot{a_0}^2 + (a_0\,
\dot{n_0})/(\dot{a_0}\,n_0)$. Difficulties may instead arise from
the exact evaluation of the 4D proper time $\tau$ when dealing
with  the integral $\tau = \displaystyle{\int}
n_0\,dt$ and a generic value of $n_0(t)$. Finally, if we define
\begin{equation}
\kappa_4^2\,p_\phi = \kappa_4^2\,p_{eff} +
\dfrac{k}{a_0^2} \quad \mathrm{and} \quad \kappa_4^2\,\rho_\phi =
\kappa_4^2\,\rho_{eff} - \dfrac{3 k}{a_0^2}
\end{equation}
we can model the fluid  in terms of a scalar field $\phi$,
minimally coupled to Einstein gravity and self-interacting
through a potential $V(\phi)$, with pressure and energy density
given by \begin{eqnarray} p_\phi & = &  \pm\,\dot{\phi_0}^2/(2
n_0^2) - V \\ \rho_\phi & = & \pm\, \dot{\phi_0}^2/(2 n_0^2) + V
\end{eqnarray}
where the upper (lower) sign corresponds to a standard (phantom)
scalar field.
\section{S\lowercase{ome possible brane scenarios}}
In this section we describe two of the possible brane scenarios
consistent with our bulk solution. We shall  choose
simple values for the scale factor $a(t,y)$ and then determine
$\Lambda_{4,eff}$ and $\left({^{(4)}T^\mu_\nu}\right)_{eff}$
together with the parameters $q$ and $H$.  In the following we
shall consider a spacelike fifth dimension, so $\epsilon=1$ and
give  relevant 4D quantities as a fuction of the 4D  proper time
$\tau$. \par\noindent
\textbf{A)}\,  Let us first  consider
the case $a(t,y) = (\gamma \lambda/\kappa)\, \sin{\kappa
(t-\lambda |y|)}$.\par\noindent This choice gives $n_0(t) = 1$ so the
coordinate time $t$ now coincides with the 4D proper time $\tau$
and therefore \begin{equation}
a_0(\tau)= (\gamma \lambda/\kappa)\, \sin{\kappa\,\tau}, \quad
q(\tau)=\tan^2{\kappa\, \tau}, \quad
H(\tau)=\kappa\,\cot{\kappa\,\tau} \end{equation}
The evolution of the universe begins with a big bang at $\tau =
0$, reaches a maximum $\left({a_0}\right)_{max} =
(\gamma\,\lambda)/\kappa$ and terminates with a big rip at
$\kappa\,\tau =\pi$. We do not give numerical values for $\gamma$
and $\lambda$ while $\kappa$ depends on the scale factor of the
fifth dimension. The cosmological constant  $\Lambda_{4,eff}$ and
the tensor $\left({^{(4)}T^\mu_\nu}\right)_{eff}$ are given by
\begin{equation}
\Lambda_{4,eff} = -\,3\,\kappa^2, \quad
p_{eff} = -\, \dfrac{(\gamma^2\,\lambda^2+k)}{\kappa_4^2\,
a_0^2(\tau)},\quad
\rho_{eff} = \dfrac{3\,(\gamma^2\,\lambda^2+k)}{\kappa_4^2\,
a_0^2(\tau)}
\end{equation}
As to the standard scalar field, we have:
\begin{equation}
\phi = \dfrac{\sqrt{2}}{\kappa_4}\,\ln{\tan{\frac{\kappa\,
\tau}{2}}}, \quad
V = \dfrac{2\,\kappa^2}{\kappa_4^2 \sin^2{\kappa\,\tau}}, \quad
V(\phi)=  \dfrac{2\,\kappa^2}{\kappa_4^2}\,
\cosh^2{\dfrac{\kappa_4\,\phi}{\sqrt{2}}}
\end{equation}
The same results, starting from different points
of view, were obtained in [23]. \par\noindent
\textbf{B)}\, Now let us consider the case $a(t,y) = (\gamma
\lambda /\kappa)\,(1-\kappa (t -\lambda |y|)^{-\,1}$.\par\noindent
This choice gives $n_0(t) = \sqrt{2/(\sqrt{5}-\,1)}\,
(1-\kappa\,t)^{-1}$ so the relation between the
coordinate time $t$ and the 4D proper time $\tau$ is
$(1-\kappa\,t) = \exp{\left[-\,
\sqrt{(\sqrt{5}-\,1)/2}\,\,\kappa\,\tau\right]}$. Therefore
\begin{equation}
a_0(\tau) = \frac{\gamma \,\lambda}{\kappa}  \,\exp{\left(\sqrt
{\dfrac{\sqrt{5}-1}{2}}\,\kappa\, \tau\right)},\quad
q=-\,1, \quad H = \sqrt{\dfrac{\sqrt{5}-1}{2}}\,\kappa
\end{equation}
The cosmological constant  $\Lambda_{4,eff}$ and
the tensor $\left({^{(4)}T^\mu_\nu}\right)_{eff}$ are given by
\begin{equation}
\Lambda_{4,eff} = \dfrac{3\,(\sqrt{5}-1)}{2}\,\,\kappa^2,
\quad p_{eff} = -\, \dfrac{k}{\kappa_4^2\, a_0^2(\tau)},\quad
\rho_{eff} = \dfrac{3\,k}{\kappa_4^2\, a_0^2(\tau)}
\end{equation}
The values of  $a(t,y)$ chosen in the previous illustrative
examples reproduce results already known in the literature.
Less simple choices for the 5D scale factor may describe new
brane scenarios but also may require a more involved treatment.
In conclusion, this paper investigates the influence of the
$^{(4)}R$ term included in the bulk action on the spherically
symmetric braneworld solutions. The brane dynamics is made closed
by using the modified junction conditions as the boundary
conditions for the embedding of the brane in the bulk, so it is
possible to obtain brane cosmological solutions consistent with
the bulk geometry. We started from a particularly simple
time-dependent solution in the bulk away from the brane, but
other physically acceptable solutions in the bulk can be
considered provided that the related brane dynamics is in
accordance to the observations on the brane.