{'fraction_non_alphanumeric': 0.03534972052571379, 'fraction_numerical': 0.009754623734812354, 'mean_word_length': 5.013236439138334, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Architectural Decay as Predictor of Issue- and Change-Proneness

Architectural decay imposes real costs in terms of developer effort, system correctness, and performance. Over time, those problems are likely to be revealed as explicit implementation issues (defects, feature changes, etc.). Recent empirical studies have demonstrated that there is a significant correlation between architectural"smells"-- manifestations of architectural decay -- and implementation issues. In this paper, we take a step further in exploring this phenomenon. We analyze the available development data from 10 open-source software systems and show that information regarding current architectural decay in these systems can be used to build models that accurately predict future issue-proneness and change-proneness of the systems' implementations. As a less intuitive result, we also show that, in cases where historical data for a system is unavailable, such data from other, unrelated systems can provide reasonably accurate issue- and change-proneness prediction capabilities.


I. INTRODUCTION
Software systems change regularly, as do their architectures. Over time, a system's architecture is increasingly affected by decay, caused by careless or unintended design decisions [53]. Decay results in systems whose implemented architectures differ in important ways from their designed architectures. Both researchers and practitioners have recognized the negative impact of architectural decay and its role in causing technical debt. Despite this, when developers modify a system during maintenance, they often focus on code and neglect the architecture.
Researchers have proposed a number of techniques to analyze a system at the code level and to predict issues that are likely to appear in the system's future versions. A common approach has been to use historical artifacts, such as data from issue trackers and version control systems, to build prediction models. Early approaches [29], [47], [24], [13] built models to predict implementation issues based on code metrics. Later studies made use of other properties that were reckoned to be potential causes of issues, such as code dependencies [73] and code smells [25].
In contrast to code-level techniques, analogous techniques at the architecture level have not received nearly as much attention, even though recent work has demonstrated that even simple code updates can cause system-wide architectural changes [36]. Frequently, such updates introduce architectural smells in a system (e.g., dependency cycle, ambiguous interface [35]). These smells may have no immediately visible effect, but they are symptoms of architectural decay and accumulated technical debt [64], [18], [36], [35]. As decay compounds in long-lived systems, the number of architectural smells grows, creating unforeseen issues when engineers try to modify a system.
In such cases, engineers are eventually likely to realize the negative effects of the incurred technical debt and the need to refactor their system. However, they usually spot deeper architectural problems only when related implementation-level issues surface. For example, issue #1178 reported for Apache Pig indicates that developers recognize the problem of having a large number of functions in a component: "[The component] has been an area of numerous bugs, many of which have been difficult to fix" [2]. Similarly, issue #223 in Apache CXF acknowledges the need to refactor CXF's architecture to reduce the amount of code changes and improve extensibility [1].
Recent studies have established strong correlations between architectural smells and both (1) a system's proneness to change and (2) the emergence of certain implementation issues [35], [37]. Furthermore, many bugs reported for a system have been shown to have architectural roots [70], [44]. Prior work has also demonstrated that identifying code smells using existing approaches will not help to uncover the underlying architectural issues, and modifications to address thus identified problems run the risk of being inadequate, short-term patches [51]. Despite this, predictive models that leverage architectural characteristics to anticipate the implementation issues or the amount of change a system may experience have been scarce.
In this paper, we propose and empirically evaluate an approach to predict a system's (1) future implementation issues and (2) proneness to change based on the system's current and past architectural characteristics. Our work is inspired in part by the recent finding [35] that architectural smells and implementation issues are strongly correlated. Specifically, we analyze 466 versions of 10 open-source software systems. For each system version, we use 3 different methods to recover its architectures from source code. We analyze thus obtained 1,398 architectural models to detect 11 distinct types of architectural smells. The detected smells are subsequently used as features in our prediction models. We make use of different machine learning techniques to predict a given system's issue-and change-proneness based on the collected architectural features.
Our study has resulted in two principal findings regarding the predictive power of the models obtained in this manner: 1) The architectural smells detected in a system can help to accurately predict both the issue-proneness and change- proneness of that system at a given point in time.
Our models yielded precision and recall scores of at least 70% (and as high as 95%) for specific recovered architectural views of the subject systems. This finding allows maintainers to foresee future problems involving new smell-impacted parts of a system. 2) Different, independently developed software systems tend to share issue-and change-proneness characteristics. This allows developers to use models created using data from a set of existing systems to predict the issue-and changeproneness of an unrelated system for which historical data does not exist (e.g., a newly developed system). While the accuracy of such general-purpose prediction models is lower than the system-specific models, the loss in accuracy is moderate, typically under 10%. Our results indicate that this is a fruitful area for further investigation, and that our models are already usable in practice for making certain types of decisions. Section II introduces foundations for our study. Section III presents the research questions and describes the study. The results are detailed in Section IV. Threats to validity, related work, conclusions, and acknowledgment round out the paper.

II. FOUNDATION
Our work is directly enabled by three research threads: (1) software architecture recovery, (2) definition and analysis of architectural smells, and (3) tracking implementation issues. Figure 1 depicts how these threads are combined to answer our research questions in this paper.

A. Architecture Recovery with ARCADE
Garcia et al. [19] conducted a comparative evaluation of software architecture recovery techniques. Their objective was to measure the existing techniques' accuracy and scalability on a set of systems for which researchers had previously obtained "ground-truth" architectures [20]. To that end, the authors implemented a tool suite, named ARCADE, offering a large set of architecture recovery choices to an engineer. 1 Garcia et al.'s results indicate that two techniques implemented in ARCADE consistently outperformed the rest: 1 The existing techniques implemented within ARCADE support structural clusterings of software systems' elements based on a range of criteria. While the resulting recovered models contain only partial architectural information for a given system, in this paper we will refer to them as "recovered architectures". We note that our use of this term is consistent with existing literature.
ACDC [66] and ARC [23]. We select these techniques for our study. ACDC leverages a system's structural characteristics to cluster implementation-level modules into architectural components, while ARC focuses on the concerns implemented by a system. ACDC relies on static dependency analysis; ARC uses information retrieval and machine learning.
PKG is another technique implemented in ARCADE. PKG extracts a system's implementation package structure. The package structure of a system is considered to be a reliable view of a system's "implementation architecture" [34]. We use it to complement the two selected clustering-based architectural views.

B. Architectural Smells
Architectural smells are instances of poor architectural design decisions [45]. They negatively impact system lifecycle properties, such as understandability, testability, extensibility, and reusability [21]. While code smells [16], anti-patterns [10], or structural design smells [17] originate from implementation constructs (e.g., classes, methods, variables), architectural smells stem from poor use of software architecture-level abstractions -components, connectors, interfaces, patterns, styles, etc. Detected instances of architectural smells are candidates for restructuring [9], to help prevent architectural decay and improve system quality.
Researchers have collected a growing catalog of architectural smells. Garcia et al. [21], [22] identified an initial set of four smells related to connectors, interfaces, and concerns. Mo et al. [46] introduced a new concern-related smell. Ganesh et al. [17] also summarized a catalog of structural design smells, some of which are at the architecture-level. Le et al. [35] described 11 different architectural smells and proposed a set of algorithms to detect them. Table I summarizes a consolidated list of smells that were identified in the above references, after removing duplicates and non-architectural smells.

C. Issue Tracking Systems
Issue tracking systems are commonly used development tools that allow users to report different problems and concerns about a system and monitor their status. All subject systems selected for analysis in this paper use Jira [4] as their issue tracking system. However, this is not a limitation; our approach can be applied to other issue trackers.
When reporting implementation issues, engineers categorize them into different types: bug, new feature, improvement, task Changing a feature modifies multiple system parts Concern Overload Component implements an excessive number of concerns Violates separation of concerns to be performed, etc. We consider all issue types in our study because they may result in relevant changes to a system. In other words, any issue type or individual issue instance may have an underlying architectural cause. Note that it would be possible to perform a finer-grained analysis using the same process we employed that would focus on a specific subset of issues or types.
Each issue has a status that indicates where the issue is in its lifecycle [3]. An issue starts as "open", progresses to "resolved", and finally to "closed". We restrict our study to closed and resolved issues that have been "fixed", and ignore those resolved issues that fall under "won't fix", "cannot reproduce", etc. We do so because any effects caused by the fixed issues presumably appear in certain system versions and disappear once the issue is addressed. Additionally, a fixed issue contains information that is useful for our study: (1) affected versions in which the issue has been found, (2) type of issue, and (3) fixing commits, i.e., the changes applied to the system to resolve the issue. Finding fixing commits is not always easy since there is no standard method for engineers to keep track of this information. Three ways of keeping track of an issue's fixing commits are commonly employed in our set of subject systems: (1) direct links to the commits, (2) specifying pull requests, and (3) specifying patch files. Our implemented tool supports collecting data from all three methods.
Based on the collected information, issues are mapped to detected smells. To do this, first, we find the system versions that the issue affects. Then we find the architectural smells present in those versions. We say the issue is infected by a given smell if and only if (1) both the issue and the smell affect the same system version and (2) the resolution of the issue changes files that are involved in the smell. Based on this relationship, we studied if the characteristics of an issue (e.g. issue type, number of fixing commits) depend on whether the issue is infected by a given smell.
Note that resolving an issue may not remove the smell that led to the issue in the first place. One reason is that developers could find a workaround. The smell may also correlate with more than one issue. In general, it is difficult to identify the exact relationship between a specific architectural smell instance and a specific implementation issue. Fortunately, we do not need to do that in our work, because we are looking for prediction models that uncover smell-issue correlations across most cases.

III. EMPIRICAL STUDY SETUP
This section describes our study setup. Our hypothesis and research questions are described in Section III-A. We then describe how we pre-processed the raw data in Section III-B.

A. Research Question and Research Hypothesis
Our hypothesis is that it is possible to construct accurate models to predict the impact of architectural decay on a system's implementation. To evaluate this hypothesis, we focus on the predictability of a system's issue-and change-proneness based on the identified architectural smells (i.e., the symptoms of decay). We define two research questions accordingly.

RQ1.
To what extent can the architectural smells detected in a system help to predict the issue-proneness and changeproneness of that system at a given point in time?
The training data used to build the prediction models for a system is collected from different versions of that system. If these models can be shown to accurately predict issue-and change-proneness, this would indicate that architectural smells have consistent impacts on those two properties throughout a system's life span. In turn, this would confirm that the impact of architectural smells is not related to other factors, such as system size, which will change during a system's evolution. In addition, an accurate prediction model will be useful for maintainers to foresee the future issue-and change-proneness of newly smell-affected parts of a system, helping them to decide when and where they may need to refactor the system.

RQ2.
To what extent do unrelated software systems tend to share properties with respect to issue-proneness and changeproneness?
This question investigates whether the issue-and changeproneness of a system can be accurately predicted by a generalpurpose model trained using symptoms of architectural decay from unrelated systems. If such a model can be constructed, it can be reused by developers to predict properties of systems for which historical information is not (yet) available. An affirmative answer to this question would also have a deeper implication: software systems tend to share fundamental properties regardless of system type, application domain, developers, employed tools, programming languages, execution platforms, etc.

B. Building the Data Pipeline
To answer the two research questions, we build multiple prediction models based on different systems' architecturalsmell data and assess the models' accuracy. We rely on ARCADE [36] to collect the underlying raw architectural-smell data, and WEKA[50]-a well-known ML framework-to preprocess the data, build prediction models, and evaluate their accuracy. The data pipeline we use is illustrated in Figure 2. Section III-B1 introduces the list of subject systems and the process of recovering their architectural artifacts with ARCADE. Two main pre-processing tasks are labeling and balancing the raw data, which are discussed in Sections III-B2 and III-B3, respectively. Creating the training and test sets, evaluating prediction models as well as determining the baseline models are discussed in Sections III-B4, III-B5, and III-B6, respectively.

1) ARCADE and Subject Systems:
We collected data from ten open-source systems from the Apache Software Foundation, shown in Table II. Specifically, our study uses three types of data: (1) architectural smells detected in recovered architectures, (2) implementation issues collected from the Jira [4] issue repository, and (3) code commits extracted from GitHub [5].
Using ARCADE, we recover the subject systems' architectures using the three recovery techniques-ACDC, ARC, and PKG-whose accuracy and scalability have been demonstrated by prior work (recall Section II-A). We then analyze the recovered architectures for the presence of smells identified in the literature (recall Section II-B and Table I), as well as the systems' issue-and change-proneness. Those architectural artifacts are the raw data for building prediction models.
2) Labeling the Data: Data labeling is a key step to ensure the success of prediction models. In our prediction problem, we are interested in two properties-issue-proneness and change-proneness. These properties can be obtained by, first, counting the raw numbers of issues and changes in a system's development history and, then, finding a way of characterizing those numbers. Specifically, we assign nominal labels based on the raw numbers of issues and changes related to source files to represent different levels of issue-and change-proneness. Converting a set of numerical values to nominal labels depends on the values' distribution. In our problem, the numbers of issues and changes follow a heavy-tailed distribution [15], where many files are associated with small numbers of issues and code changes, while comparatively fewer files are associated with large numbers of issues and changes. This is not an uncommon type of distribution [72], [8]. As an illustration, the Pareto chart [68] in Figure 3 depicts the distribution of issues per file in Hadoop: while few files are associated with a large number of issues, the arc, which represents the cumulative percentage of file-groups' sizes, shows a clear heavy-tailed pattern.
One common labeling approach is to segment a heavy-tailed distribution into head and tail segments. A more sophisticated approach is to divide the distribution into three parts-head, body, and tail-which in our case represent the three levels of proneness: low, medium, and high. We choose the latter approach because the numerical values in our study span a wide range. Having these three levels gives developers a better estimation of architectural decay's impact.
To segment a dataset, we use the Pareto principle [52], a popular segmentation method for heavy-tailed distributions, widely used in software engineering (e.g., [8], [30], [61]). To obtain the three segments, we apply the Pareto principle twice, as suggested in literature [6]. Specifically, we divide the original dataset into two portions. The first portion contains 80% of the   original dataset's low-end, while the second portion contains 20% of the high-end. We apply the Pareto segmentation once more to the latter portion, thus obtaining two new portions that respectively contain the next 16% (80% of the 20%) and 4% (20% of the 20%) of the high-end data points.

RQ 1 -Cross-Validation
In order to collect the data regarding architectural decay, for each version of a subject system, we first collect the list of "fixed" issues affecting that version. Next, we collect the files that were changed when fixing the issues. For each file, we gather its associated architectural smells, the number of issues whose fixing commits changed that file (used when determining the system's issue-proneness in Sections IV-RQ1-A and IV-RQ2-A), and the total number of changes (used when determining the system's change-proneness in Sections IV-RQ1-B and IV-RQ2-B). After the raw data is collected, we label it using the Pareto technique mentioned above before feeding it to supervised ML algorithms.
To determine the level of issue-proneness of a source file in a system version, first, the number of issues related to that file is collected. This is one data point. We collect data points for all files in all available versions of a system, and then sort the dataset by the numbers of issues, from low to high. Then, the first 80% of data points are marked with "low" labels; the next 16% and 4%, respectively, are marked with "med(ium)" and "high" labels. To determine the change-proneness of a source file in a system's version, we count the number of commits related to that file and repeat a similar labeling process. Table III shows several data samples in our datasets after labeling. The shown features, i.e., architectural smells in our case, are CO (Concern Overload), SF (Scattered parasitic Functionality), LO (Link Overload), and DC (Dependency Cycle). The output features, i.e., labels, are the levels of issueproneness and change-proneness. The two leftmost columns show the versions and filenames of each data point. The next eleven columns are binary features that indicate the presence (1) or absence (0) of a specific smell (recall Table I) in a given file.  3) Balancing the Data: Due to the distribution of data and the labeling approach, we need to balance our datasets [55]. Recall from Section III-B2 that the low : med : high ratio of our datasets is 80:16:4 (i.e., 20:4:1). If such a dataset were used to train a prediction model, the most likely outcome would be a model that predicts "low" for every data point. As we are more interested in "high" and "med" labels, such a model would be useless. It is thus important to ensure that weighted metrics are not biased by less (or more) frequent labels.
We use SMOTE [11] to balance our dataset, oversampling "med" by a factor of 5 and "high" by a factor of 20. SMOTE is a technique that synthesizes new minority samples based on nearest neighbors between sample data points. Adding new minority samples guarantees that the dataset will be balanced, i.e., that the low : med : high ratio will be 1:1:1.

4) Training and Test Sets:
To build and test our prediction models, we use two different approaches for the two research questions, as illustrated in Figure 4. In the first approach, used for RQ1, one dataset is created for each subject system with a cross-validation setup. Specifically, we use 10-fold crossvalidation, where the dataset is randomly divided into ten equal-sized subsets. Then, we sequentially select one subset and test it against the prediction model built by the other nine subsets. The final result is the mean of the ten tests' results. In the second approach, used for RQ2, we combine all subject systems and then divide them into two independent datasets: a training set, which comprises nine systems, and a test set, which comprises the single remaining system.

5) Evaluation Metrics:
To evaluate the accuracy of our models, we use precision and recall [54]. Precision is the fraction of correctly predicted labels over all predicted labels. Recall is the fraction of correctly predicted labels over all actual labels.
For illustration, consider the sample confusion matrix, shown in Table IV, that is produced after classifying 25 samples into "high", "med", and "low". The precision for the "high" label is the number of correctly predicted "high" samples (4) out of all samples predicted to be "high" (4+3+6=13), i.e., 30.8%; its recall is the number of correctly predicted "high" samples (4) out of the number of actual "high" samples (4+1+1=6), i.e., 66.7%. We can similarly calculate the precision and recall for "med" and "low". Finally, we compute the average values of all labels. If a model predicts the correct labels, we consider this a true positive. On the other hand, if the model predicts any of the three labels ("high", "med", or "low") incorrectly, we consider this a false positive. This is the standard way of measuring the accuracy of multi-label problems [65].
6) Determining Baseline Models: To determine the effectiveness of the prediction models, we need to compare them to a baseline. In this case, we consider a baseline model to be the simplest possible prediction. The model can be obtained through different approaches. For some problems this may be a random result, and for others in may be the most common prediction. As our dataset has been balanced (Section III-B3), the simplest approach is "uniform" -generate predictions uniformly at random. This implies a prediction in which Table IV has equal values in all cells, giving us a model with both precision and recall of 33.3%.

IV. EMPIRICAL STUDY RESULTS
In this section, for each of the two research questions we discuss the validation method and the associated findings.

RQ1:
To what extent can the architectural smells detected in a system help to predict the issue-proneness and changeproneness of that system at a given point in time?
In this prediction problem, all input features are binary (recall Table III), indicating whether a file contains an architectural smell. For this reason, decision-based techniques are most likely to yield good results [41]. Metrics collected from a range of models we built and evaluated using four different classification techniques-decision table [31], decision tree [56], logistic regression [39], naive bayes [28]-confirmed this. We thus only discuss the results obtained by the decision-table models.

A. Issue-Proneness
Recall from Section III-B that, to compute issue-proneness, for each file in each version of a given system, we gather the file's associated architectural smells and number of issues whose fixing commits changed the file. Table V shows the precision and recall of the models for predicting the issue-proneness of our subject systems from Table II. These metrics are computed using 10-fold cross-validation [32]. The bottom-most row shows the average values across all systems. For each system, we built different prediction models based on smells detected in the three architectural views (ACDC, ARC, and PKG). In total, 30 prediction models per system were created and evaluated. In general, the prediction models that relied on architectures recovered by ACDC and ARC were comparable in terms of accuracy: the average (precision, recall) for the ACDC and ARC models were (76.2%, 74.4%) and (76.6%, 75.9%) respectively. On the other hand, the models emerging from PKG yielded accuracy that was up to 13% lower. The models yielded very high predictive power in the cases of certain systems. For example, the ARC-based models for Struts2 achieved ≈95.0% and the ACDC-based models ≈90.0% for each of the two metrics.
As discussed in Section III-B3, our dataset has been balanced to ensure that the trained models will accurately predict "high" and "med" labels, in which we are interested. Table VI shows the precision and recall of issue prediction for all three labels. While there are variations across the three labels, the average precision and recall for the "high" label-79.6% and 85.9%, respectively-outstrip the average values for the other two labels. Figure 5 shows the comparison of our prediction models with the baseline model. Our prediction models are at least 1.5× better (2× in a majority of cases) than the baseline's 33.3%, further confirming that our models are useful for predicting files with high numbers of related issues.
Our results confirm that architectural smell-based models can accurately predict the issue-proneness of a system. In other words, architectural smells have a consistent impact on a system's implementation with respect to issue-proneness over the system's lifetime. This finding means that architectural decay can be a powerful indicator of the health of a system's implementation. It serves as a direct motivator for software engineers to pay more attention to the architecture, and architectural smells, in their systems. For example, system maintainers can use our models to foresee future problems, to devise refactoring plans, to prioritize their activities, etc.  The comparatively poorer performance of PKG in answering RQ1 suggests that implementation-package structure is not effective for measuring architectural decay and it can mask deeper architectural problems. This observation is in line with previous findings [36], which showed that, compared to ACDC and ARC, PKG is markedly less useful for understanding the underlying architectural changes and their impact.
This leads to another observation. Recall the categorization of architectural smells in Section II-B and Table I: two of the four categories are dependency-based and concern-based smells. This suggests that ACDC (dependency-based recovery) and ARC (concern-based recovery) should inherently outperform PKG when such smells are encountered. It further suggests that targeting specific recovery techniques to specific types of smells, and then finding a way to combine their results, may yield even higher accuracy in our prediction models. We are exploring this hypothesis in our ongoing work.

B. Change-Proneness
Recall from Section III-B that, to compute change-proneness, for each file in each version of a given system we gather (1) the file's associated architectural smells and (2) the total number of changes to the file reflected in the implementation issues' fixing commits. We used the same approach to evaluate the accuracy of the 30 architectural models for each system in predicting change-proneness as we did for predicting issue-proneness. 3.x. In other words, the changes in most of these 36 versions were "patches". It is reasonable to expect that the architectures and detected smell instances between patches within a single minor version will be very similar. The prediction model for Struts2 benefits from this similarity and thus achieves very high accuracy in the crossvalidation test. This suggests a promising strategy for building prediction models: to increase the accuracy of models used to predict properties of a system version, one should select recent versions instead of all versions across the entire system lifespan.
In summary, our results confirm that the historical data of a software system regarding its architectural smells, issues, and changes can be used to develop models to accurately predict the issue-and change-proneness of that system. The results also indicate that architectural smells have a consistent impact on software system implementations throughout the systems' lifetimes. Our architecture-based prediction approach, whose performance is usually two times better than the baseline, is useful for software maintainers to foresee likely future problems in newly smell-impacted parts of their system. The approach can also help in creating maintenance plans that can help to effectively reduce the system's issue-and change-proneness. Lastly, ACDC and ARC outperform PKG, emphasizing the importance of selecting the appropriate architecture recovery techniques and targeting them to the task at hand.

RQ2:
To what extent do unrelated software systems tend to share properties with respect to issue-and change-proneness?
The results obtained in answering RQ1 showed that architectural smells consistently impact the issue-and change-proneness of a software system during its lifetime. In that sense, RQ2 can be considered an extension of RQ1: we aim to understand whether architectural smells have consistent impacts across unrelated software systems, more specifically, whether the issueand change-proneness of a system can be accurately predicted by models trained with data from unrelated systems. More deeply, this research question tries to assess whether there are fundamentally shared traits across software systems, regardless of their developers and development processes, implementation features, application domains, underlying designs, etc.
To answer this question, instead of using 10-fold crossvalidation, we selected each subject system as the test system and used its dataset as the test set; the training set was then created by combining datasets of the remaining nine systems. For reference, we also built a prediction model by combining all ten systems, i.e., including the test systems. Note that the datasets of different subject systems have different sizes; we had to resample those datasets to the same size before combining them.

A. Issue-Proneness
Tables VIII, IX, and X summarize the precision and recall values of RQ2 experiments with regard to predicting issue-  proneness under ACDC, ARC, and PKG, respectively. The leftmost columns of these tables show the lists of systems. The precision and recall values are presented for three different cases: 1) "10-fold" column -10-fold cross-validation on the test set. We reproduce this result from RQ1 for easy reference. 2) "All 10" column -Models trained by datasets from all 10 systems, including the test set. 3) "9 Others" column -Models trained by 9 other systems' datasets, not including the test set. In total, beside the 300 issue-proneness prediction models per system that emerged from RQ1's analysis, we built and evaluated 60 additional issue-proneness models to answer RQ2.
We found several consistent trends across all three architectural views. First, a prediction model built by combining data sets of multiple different software systems, even if the test system itself is included, has lower accuracy than the model built for that specific test system. This can be seen in all three Tables VIII, IX, and X, where the "All 10" columns have lower values for precision and recall than the corresponding "10-fold" (results from RQ1) columns.
More interesting is the case where the test system is excluded and the model is trained on the datasets from the remaining nine systems (the "9 others" column). This represents the scenario of using a generic predictive model comprising entirely different systems. The precision and recall values predictably decrease further across all three architectural views. These results are reflective of the intuition that using datasets from different systems can create a more general-purpose model, but is also likely to add noise and reduce the model's ability to predict the properties of a specific system. Therefore, if a sufficiently large dataset for a given system is available, the system's prediction models should be trained only on that dataset.
At the same time, it is interesting to note that the loss of accuracy between the "10-fold" and "9 Others" models is relatively moderate: with few exceptions, it is on the order of 10-20%. On the lower end, one example exception is PKG's precision for Wicket's issue-proneness (Table X-top), where the discrepancy is only 3.5%. On the higher end, an interesting exception are the precision and recall values obtained by ARC for Struts2 (Table IX), which are both more than 30% lower for the "9 Others" models. This ties to the above discussion of the limited types of smells that exist in Struts2: its uniqueness decreased the ability of other systems to predict its issueproneness, just like it helped ensure highly accurate models when using only its own historical data. Figure 6 shows a comparison of precision and recall between different combinations of ACDC based models. We observe that using data from "9 Others" systems can yield a relatively good prediction model with at least 50% improvement compared to the baseline (0.5 vs. 0.33). In addition, the accuracy of "All 10" models lends support to a hypothesis that if a system has a short history of development, then including generic data can help improve predictive performance. We are currently evaluating this hypothesis more extensively.

B. Change-Proneness
We observed analogous trends to those discussed above in the experiments that attempt to predict the change-proneness using unrelated systems' datasets. We elide this data for space.
In summary, the results of the experiments conducted in the context of RQ2 confirm that software systems tend to share properties with respect to issue-and change-proneness. The accuracy of general-purpose models is lower than that of specific models, but the gap is not prohibitive. Our results suggest that developers can use general-purpose models to get an overall sense of the likely issue-and change-proneness of a new software system in the early stages of its development, before sufficiently large numbers of system versions become available. Similarly, developers can use such models to predict important properties of any existing systems for which historical data is missing, spotty, or unreliable.
An interesting question is whether restricting general-purpose models to systems that are likely to share certain key characteristics can improve the models' predictive power. This is something we have not done in our current study: while the set of test systems we used share some characteristics (e.g., Java-based enterprise systems and Apache Projects), they are also inherently different systems targeting a variety of domains. Our ongoing work is investigating whether taking into account factors such as the role of the employed development processes, off-the-shelf frameworks, system design principles and patterns, application domains, etc. can be used to increase the accuracy of the general-purpose models.
Overall, the predictive models we developed provide developers another tool to check and maintain their software system's health and track technical debt. A straightforward way to identify "unhealthy" parts of a system is to look for long-lived smelly files, i.e., files that have been involved in architectural smells across a large number of system versions. These files have a high potential to introduce new issues. Figure 7 shows examples of such files from Hadoop and Struts2. The x-axes in both plots indicate system versions, while the the y-axes indicate the numbers of smells in which each of the files is involved.
From the collected data such as that depicted in Figure 7, we have observed that long-lived smelly files are repeatedly involved in new issues during a system's lifetime. For example, DFSClient.java is mentioned in ≈2,900 Hadoop issues to date; JobTrackers.java is mentioned in ≈2,200 Hadoop issues; Dispatcher.java is mentioned in ≈670 Struts2 issues; and so on. We posit that stemming such trends and properly addressing the underlying problems will require considering the architectural causes of these issues.

V. THREATS TO VALIDITY
The key threats to external validity include our subject systems. Most of the steps in our data gathering process are automated. However, manual intervention is required since each system has different implementation conventions. Due to the manually-intensive data gathering process, we have used data from ten subject systems in our dataset. We mitigate a possible threat stemming from the number of systems by using data from their 466 versions and evaluating 720 prediction models.
All our subject systems are Apache projects, implemented in Java, and use the Jira issue tracking system. The reason for this is that it helped to simplify our data gathering and analysis workflow. In our on-going work, we are expanding our analysis beyond Apache. The diversity of the chosen systems, however, helps to reduce this threat, as does the wide adoption of Apache software, Java, and Jira. Further, all the recovery techniques and smell definitions in this paper are language-independent.
Our study's construct validity is threatened by (1) the accuracy of the recovered architectural views, (2) the detection of architectural smells, and (3) the relevance of implementation issues. To mitigate the first threat, we applied three architecture recovery techniques (ACDC, ARC, and PKG) that had previously exhibited the greatest usefulness in an extensive comparative analysis of available techniques [19] and in a study of architectural change during system evolution [36], [7], [62]. The three techniques were developed independently and use different strategies for recovering a system's architecture. To mitigate the second threat, we selected architectural smell types that were previously studied on a smaller scale [42], [46], [38], [22], [21], and were shown to be strong indicators of architectural problems. Finally, to mitigate the third threat, we only collected "resolved" and "closed" issues, i.e., those issues that have been independently verified and fixed by developers.
The primary threat to our study's internal validity and conclusion validity involves the predictability relationship between reported implementation issues and architectural smells. Our prediction models are built based on significant correlations between architectural smells and implementation issues, which have been confirmed in other work [35]. Although correlation does not imply causality, we have shown examples of the causal relationship's existence. Prior work has also confirmed the causality between implementation issues and architectural smells via manual inspection [70], [44]. In addition, our observations are consistent across the ten systems.
VI. RELATED WORK Predicting implementation issues and code change have been widely studied research problems in software maintenance. The main type of implementation issues that researchers were interested early on were defects. Li et al. [40] used OO metrics as predictors of software maintenance effort. Subramanyam et al. [63] also demonstrated that a set of metrics [12] has significant implications on software defects. Nagappan et al. [49] found a representative set of code complexity measures to determine failure-prone software entities. However, the metrics considered in prior work cannot prevent defects at higher abstraction levels, such as architectural problems.
Issue prediction based on bug-fixing history is also an established area. Rahman et al. [58] developed an algorithm that ranks files by their numbers of past changes. The algorithm helps developers find hot spots in the system that need developers' attention. There are more sophisticated methods that combine historical information and software change impact analysis to increase the efficiency and accuracy of the prediction [67], [27], [57]. However, as before, these approaches do not explain higher-level defects caused by architectural decay.
Code changes have a close connection with defects in software. Nagappan et al. [48] used code churn to predict the defect density of software systems. Hassan et al. [26] used complexity metrics based on code changes to predict faults. Code change has been used in a number of other research efforts [71], [14], [37], [36] to evaluate system maintainability.
To predict code changes, Romano et al. proposed two approaches, relying on code metrics [59] and anti-patterns [60]. Xia et al.'s approach [69] predicts a system's change-proneness using co-change information of unrelated systems. While their approach is similar to the one we employed in the context of RQ2, it yields relatively low accuracy. Malhotra et al. [43] used hybridized techniques to identify change-prone classes. However, their empirical study is relatively small. Kouroshfar et al. [33] do use architectural information to study the correlation between co-changes across architectural models and defects. However, they restrict their study to cross-module changes.

VII. CONCLUSION
This paper's contributions are twofold. First, we have developed an approach that can identify parts of a software system that are likely targets of future maintenance activities based on architectural characteristics as well as the change-and issue-proneness of different architectural elements. Second, we have conducted an empirical study that highlights the impact of architectural decay on ten well known open-source systems.
We leverage the identified correlations between symptoms of architectural decay and reported implementation issues to develop an architecture-based approach that accurately predicts a system's issue-and change-proneness. Our approach has been validated on ten existing systems, considering 11 different types of smells under three different architectural views. This is the first study of its kind and, as such, its results can be treated as a foundation on which subsequent work should build. At the same time, the study has resulted in several important findings regarding the predictive power of architecture-based models.
Our study confirmed that architectural smells consistently impact a system's implementation during the system's lifecycle. In other words, the impact does not change significantly with other factors such as system size. This means that the detected architectural smells can help to accurately predict the issueproneness and change-proneness of a system at any relevant point in time. In turn, such architecture-based prediction can serve as a useful tool for maintainers to recognize future problems associated with newly smell-impacted parts of the system and to plan their activities.
As a perhaps more unexpected result, we have shown that unrelated software systems tend to share properties with respect to issue-and change-proneness. This allows developers to use general-purpose models created with the available data from a set of existing systems to predict the properties of systems for which such information is missing. Unsurprisingly, the accuracy of such general-purpose models is lower than that of system-specific models, but not prohibitively so. Our results suggest that it is possible to develop such models sufficiently accurately to use them as a basis of actionable advice.
It is important to keep in mind that this was an initial attempt at constructing general-purpose prediction models. Our models were trained using all architectural smells and software systems without particular prior planning. Our future work will investigate how to select an appropriate set of systems to improve the accuracy of these models. We will also explore whether further accuracy improvements can be achieved by restricting the types of architectural smells on which the models are trained.