Empirical Studies on Software Refactoring Techniques in the Industrial Setting

Software refactoring is an approach that aims to improve software system quality by restructuring its internal design without altering the functionality of the software system. The software refactoring has gained comprehensive attention from the research community in software engineering since its emerging in 1999. Empirical studies were carried out to investigate whether the software refactoring indeed can achieve improvement in the software system quality. It is widely believed that refactoring has a favorable quality impact. However, several researchers have opposed this belief. This paper presents a systematic literature review (SLR) of the empirical studies that have been conducted in the industrial setting. Twenty studies were chosen and analyzed in depth as primary studies.The objectives of this SLR are to identify the refactoring techniques examined, and software quality attributes investigated as well as to analyze the connection between the refactoring techniques and the software quality attributes based on the selected empirical studies to understand the situation. The findings showed a lack of empirical research on the effect of the refactoring on software quality. Additionally, the relationship between the refactoring techniques and software quality attributes is unclear. Thus, several recommendations have been proposed to address these gaps.


Introduction
Software maintenance is an important component of the process of software development. It involves key operations aimed at evolving current software systems while maintaining their integrity [1].These activities include updating some functionalities or fixing design flaws and bugs [2]. The high complexity is one of the properties of large-scale software systems that makes the maintainability of these systems is complicated task. Indeed, it has been revealed that the cost for a software system due to evolutionary operations and maintenance is more than 80% of the complete software system development cost [3]. Early identification of faults helps to decrease the time, effort and cost of testing [41]. The refactoring considers one of the most trusted techniques that commonly utilized to assist in the maintenance activities [3]. Opdyke introduced the term of "refactoring" for the first time in his PhD thesis [4]within the object-oriented programming context.Fowler described refactoring as a mechanism that reorganizes a software system's inner layout to enhance its quality without altering its functionality [5].Fowler proposed a catalogthat included sixty-eight object-oriented refactoring techniques (e.g. add parameter, extract method, and extract class) [5]. These refactoring techniques aim to reorganize classes, methods, and variables of a software system design to facilitate future modifications and extensions as consequently maintainability becomes easier. Fowler indirectly refers, in his definition of the refactoring, to existence a relation between the refactoring techniques and internal quality factors [6] as the refactoring techniques alter the inner composition of the design of the system. According to [3], software refactoring is one of the most common techniques used to provide a system with high quality attributes to its users. The high quality of the software is very essential for clients [42].
Attributes of software quality have been categorized into two kinds of internal attributes-it is also called internal design properties, internal metrics, internal quality factors-and external attributes [7]. Cohesion, complexity, coupling, and design size are examples of internal quality attributes which can only be measured by artifacts of design or code, whereas maintainability, flexibility, reusability, and understandability are examples of external quality attributes which cannot be directly measured on the basis of design or code artifacts [8]. Software metrics are frequently used to assess the effect of refactoring techniques on software quality. The four most popular suites of metrics that emerged from the need to evaluate distinctive characteristics constructed in object-oriented software are the Chidamber and Kemerer (C&K) metrics suite, Lorenz and Kidd (L&K) metrics suite, metrics for object-oriented designs (MOOD) metrics suite and quality model for object-oriented design (QMOOD) metrics suite [9]. Models and formulas were proposed by researchers such as QMOOD to use the internal quality attributes as an instrument to evaluate the external quality attributes [9]. Therefore, it can be inferred that software system internal and external quality attributes are influenced by the refactoring techniques [10]. In other words, improvement or deterioration in internal quality attributes indirectly influences on pertinent external quality attributes.
In recent years, software refactoring has gained significant interest from the research community in software engineering and has become an important part of the software development process [10]. In the literature, influence of the refactoring on the software quality attributes has been studied and empirical investigations have been conducted through academic and industrial environments to validate or invalidate Fowler's claim that stated the software refactoring always improves the software quality attributes.
We observed a number of empirical studies (e.g. [11], [12], [13]) that validated and confirmed existence positive relation between the software refactoring and software quality as Fowler proposed, in the other side, several empirical studies such as ( [6], [14], [15], [16]) referred that the relation between refactoring techniques and quality of softwarewas unclear. The authors stated that impact the refactoring techniques on the software quality may be positive, negative or no effect. Therefore, we aim in this review to analyze and look deeper into empirical studies relating to the industrial environment to understand the situation. The industry environments mean those empirical studies that have been studied the effect of the refactoring on the quality of real software systems at companies where the developers performed or validated the refactoring process. The industry environment was selected because the industry setting involved real systems with different kind of costs and risks, as well as the refactoring process is usually carried out by the experts.
The objectives of this review are to: 1. Identify the refactoring techniques used and the software quality attributes researched. 2. Analyze the relationship between software refactoring and attributes of software quality depending on industrial-setting empirical research. The results of this review are expected to: • Provide a summary of the relationship between software refactoring and software quality for stakeholders based on this SLR. • Identify the gaps in the literature that need more studies to make the relation between software refactoring and attributes of software quality better and clearer understanding.
In this paper, Section 2 reports the related work.The SLR methodology is outlined in Section 3. The findings are detailed in Section 4. The discussion of this review is described in Section 5 and the conclusion is summarized in Section 6.

Related Work
Several literature reviews have been conducted relevant to software refactoring field in which different aspects of refactoring were discussed. Mens and Tourwe [17] conducted a survey of software refactoring research. They discussed five various criteria which included:supported refactoring activities,types of refactored software artifacts, characteristics that require to be considered when developing refactoring tools, the impact of software refactoring on the software development process, particular formalisms and techniques utilized to support refactoring activities. However, only three studies on the influence of refactoring on quality were reviewed and these studies were not in the industrial settings. Abebe and Yoo [18] carried out an SLR to uncover the challenges, trends, and opportunities relevant to software refactoring. They concluded that researches on the software refactoring need more attention, due to there are still a lot of unresolved issues that need more research to address them in the future. Their review addressed the influence of the refactoring on the quality of the software generally.Misbhauddin and Alshayeb [19]conducted a review of studies for UML model refactoring. They analyzed the primary studies based on different criteria which are: UML diagrams regarded for refactoring, the formalities used to assist the refactoring of UML diagrams, suggestions for the development of refactoring tools and the effect of refactoring on the quality of the UML model. Regarding the influence of the refactoring on model quality, five studies only evaluated the impact on the model quality and these studies were not in the industrial settings.Almogahed, Omar, and Zakaria [20] conducted SLR that aimed to determine and analyze studies which tightly related to categorizing the refactoring techniques depending on their influence on software quality.Al Dallal and Abdin [21] presented an SLR on the influence of object-oriented code refactoring on quality attributes. The primary studies were evaluated on the basis of five distinct criteria that included: quality attributes and measures, refactoring activities, approaches to assessment, datasets, and the effect outcomes.
The SLR presented in this study is extending our previous work [43] and does not overlap with [21] review due to the following reasons which are: 1) their SLR limited to the studies published before the end of 2015, whilst this SLR has been included papers published till April 2018, 2) they included only empirical research relating to the influence of code refactoring on quality, while this SLR included empirical research relating to the influence of software refactoring on quality in the industrial setting, and 3) they also studied the effect of code refactoring to remove bad smell while this SLR investigated the effect of refactoring generally.

Methodology
A systematic literature review (SLR) is a well-described methodology for analyzing, identifying and interpreting all the relevant evidence and guidelines linked to a research question in an impartial and repeatable way. The systematic review procedure requires the entire procedure to be clearly described and documented. We carried out the review in this study on the basis of the instructions givenby Kitchenham and Charters [22]. Several stages we have taken into consideration for this systematic review procedure as shown in Figure 1. Each stage is explained in the following subsections.

Formulating the Research Questions
This study is aimed at analyzing the review outcomes to answer the research questions outlined below. For each research question, the reason why these certain questions were selected for this review is included. RQ1: What are the techniques of refactoring, inner and external quality attributes researched in industrial settings? Reason: There are many techniques for refactoring (e.g. 68 techniques proposed by Fowler), internal quality metrics, and attributes of external quality. It should therefore be understood which refactoring technique has been used and its influence on which internal and/or external quality attributes have been implemented. We can decide on the basis of this data whether or not we can reach a thorough conclusion on the relationship between refactoring and quality. RQ2: What is the relationship between the software refactoring and the attributes of software qualityin the industrial setting? Reason: As prior mentioned, existence different opinions regarding the refactoring impact on the software quality is the main reason to come up with this question. Hence, collect, review, and analysis of previous empirical studies is required to answer the question.

Determining Sources and Strategies of the Search
Research papers that were published in literature regarding the empirical studies of refactoring impact on the software quality in industrial environment were retrieved and selected for review from appropriate science databases. In this review, several scientific databases were considered include: • IEEE eXplore (http://ieeexplore.ieee.org/). • ScienceDirect (http://www.sciencedirect.com/). • ACM Digital Library (http://dl.acm.org). • Springer (http://www.springer.com/in/). • Google Scholar (https://scholar.google.com/). The search keywords that were used in the searching process are: • "Refactoring" for IEEE, ACM, and ScienceDirect databases. • ('Empirical study' and 'software refactoring' and 'software quality') for Springer, and Google Scholar databases.

Identifying Inclusion and Exclusion Criteria
We used the following inclusion and exclusion criteria to pick the primary studies from the associated studies collected.

• Inclusion Criteria
Any study is permitted be part of the analysis if it satisfies all the next inclusion criteria which are: • The study has been published in journal article or conference paper between 2000 and February 2018 and retrieved from one of the five databases. • The study revealed an empirical examining the effect of any type of software refactoring on inner or external quality attributes in industrial settings

• Exclusion Criteria
The study that matches any of following criteria must be excluded from the analysis. Listed below are the exclusion criteria: • Studies are not applicable to the subject of software refactoring. • Studies are not written in the English language. • Papers duplicated. • Studies such as dissertation, thesis, concept paper, workshop, book, or tutorial. • Studies which are written before the year 2000.

Selecting the Primary Studies
The total number of studies that were retrieved from the five databases was 4430 based on the research keywords. The selection process of studies passed through two stages based on guidelines provided by [22] which are Pre-selection and selection. In the preselection stage, studies were filtered based on the titles. Consequently, 227 studies were the result of the filtering process in the Pre-selection stage.In the second stage, criteria for inclusion and exclusion, the abstracts, and conclusions for the rest of the papers were utilized to discover those papers that were still qualified to the study. Due to this filtering process, we ruled out 207 papers and only 20 papers were selected as primary studies that met the inclusion criteria. Table 1 demonstrates statistical data of the number of retrieved, pre-selected, selected papers for each database.

Extracting the Data
All papers selected as primary studies were analyzed in depth. Data were extracted from the primary studies based on the research questions mentioned above. Data extraction included the following items: • Publisher (paper's indexing source). • Title. • Summary of the paper. • Refactoring techniques used in an investigation.
• Internal software quality metrics /properties /attributes were studied under the influence of the refactoring.
• Linking inner quality metrics/ properties/ attributes to attribute of external quality. • External quality attributes were studied under the effect of the refactoring. • The industrial domains where the empirical studies were conducted.
The extracted data enabled us to analyze in depth of the 20 studies that were selected in this systematic review to address the research questions. Figure 2 demonstrates the mapping of the number of published papers for a specific year combined with their publishers.

Synthesis of the Results
In this section, the primary studies obtained resulting from the systematic review process were summarized. These findings were analyzed in order to identify refactoring techniques, inner quality attributes, external quality attributes, the influence of refactoring on inner and external quality characteristics, constraints of the study being reviewed, and suggestions for future study.

Results
This part describes the primary studies below.
Geppert, Mockus, and Rossler [23] presented a case study to investigate the refactoring impact on changeability in a legacy system. Several non-standard refactoring techniques were applied. Software changes, for this system, which include code change, a customer report, and change requests were identified based on information collected during system development and utilized to measurements. The outcomes showed that change effort and the client report defects reduced after the refactoring.
Kolb, Muthig, Patzke, and Yamauchi [24] carried out a case study at Ricoh company based on Image Memory Handler (IMH) components. Refactoring activities performed on IMH led to improving reusability and maintainability. Several software metrics were used to evaluate the improvement such as cyclomatic complexity, Fan-In, Fan-Out, and maximum nesting.
Moser, Sillitti, Abrahamsson, and Succi [25] conducted case study similar to the industrial setting to investigate the effect of refactoring on the reusability. They focused on two different set of internal quality metrics that were used to measure the reusability. These metrics were McCabe's cyclomatic complexity and CK (CBO, LCOM, WMC, RFC, DIT, NOC) object-oriented metrics. In their case study, they observed a small development team formed four developers-three students and one professional engineer-to develop a project for mobile applications under monitoring. The Extreme Programming method was followed by the development process and the team completed the work for eight weeks. The findings showed that refactoring significantly helped to improve internal quality measures for software reliability.
Another replication investigation by Moser et al. [12] aimed to test the effects of refactoring on attributes of inner quality-in particular, complexity, coupling, and cohesion-and the agile team's productivity. They conducted their study on same the case study that described in their work [25]. CK metrics (CBO, WMC, RFC, and LCOM) have been used to assess the effect of refactoring. The finding confirmed that refactoring helps improve team productivity and internal code quality where it increases cohesion; reduce coupling and complexity that led to improve the software maintenance. These findings support their prior statement that the quality is positively affected by the refactoring. However, these results may not be applicable to large development teams. Hence, additional investigation is required to guarantee that these findings can be generalized them.
Gatrell, Counsell, and Hall [26] explored the difference between applying the refactoring in production classes and test classes. An empirical study presented to compare the findings from two prior refactoring studies by using versions anonymous commercial C# system from a large company. Authors developed a tool to compare each release with the prior and identify existing of 15 refactoring techniques in the production and test classes. Bespoke tool was used to extract refactoring techniques. The result showed that the refactoring applied to the test classes was similar to the production classes.
Ghaith and Ó Cinnéide [27]relied on search-based refactoring to propose an automated approach that aimed to enhance the software security before deployment. Security metrics based on cohesion (CAAI, CAIW, CMAI, CAIW, and CMW), coupling (CCC), composition (CPCC), extensibility (CME and CCE), inheritance (CAI, CSP, CMI, CSI, and CSP), design size (CDP), and data encapsulation (COA, CIDA, and CCDA) were used to measure a ratio of improvements of software security. They selected an industrial banking system as sample to test the approach. Fourteen refactoring techniques were applied on the system to identify their impact on the security metrics. The results reported that impact of refactoring on the actual improvement in the security metrics was 15.5 %. Additional tests with larger systems, more refactoring techniques, and more metrics are needed to completely explore this approach.
Kim, Zimmermann, and Nagappan [28] studied benefits and challenges of refactoring at Microsoft company by using three complemental methods: interviews, survey, and quantitative analysis for Windows 7 version history. The overall obtained results showed that the benefits of refactoring were an improvement of the quality while its challenges were costs and risks.
Dibble and Gestwicki [29] described a case study to demonstrate how readability and maintainability are affected by refactoring. Project under analysis was developed by eleven members of a team over five months. The refactoring process was carried out after one year of deployment by two members of the team. There were two causes to drive the refactoring: improve the design patterns and software metrics. Refactoring proceeded in two stages. First, refactoring was performed automatically by ReSharper tool, but it could not able to identify all. Therefore, second stage refactoring was conducted by researchers manually. Five software metricsmaintainability index, class coupling, cyclomatic complexity, depth of inheritance, and lines of code (LOC)-were used to analyze the importance of improvement in the readability and maintainability. The findings indicate that the manual refactoring enhanced readability and maintainability considerably better than the ReSharper tool.
Kim et al. [11] studied the benefits and challengesof the refactoring from the perspective of the developers at Microsoft Company to know the de-facto definition of refactoring in the practice. They used three methods of investigation which are: survey, interviews, and quantitative analysis. They conducted a survey of with 328 expert software engineers and interviewed with a refactoring team that has led for several years the effort on the refactoring of windows 7. The quantitative analysis performed on a case study which was a version history data of the refactoring of windows 7. Different software metrics such as complexity (e.g. fan-in and fan-out) and size (e.g. LOC) metrics used for statistical analysis. The results of the quantitative analysis, their survey and interview showed that developers used eleven refactoring techniques, but they mostly performed them manually due to developers mentioned that the tools used to perform the refactoring automatically was often inadequate and no safe to check the correctness of the refactoring. In addition, based on developers experienced, maintainability, readability, modularity, performance, and testability quality attributes have been improved by applying the refactoring techniques. It was also found that the refactoring's definition in an industrial context different from its definition in the academic context. In the industrial context, developers defined the refactoring as rewriting program code to improve it in some manner. Behaviour's preservation of a system did not mention in their definition While the definition of the refactoring in the academic context confirmed on the behaviour's preservation of the system. Developers in practice perceived that refactoring is broader than preserving of program behaviour processing. The developers also considered the refactoring process involves large cost and risks. Therefore, it can be concluded that there is a gap in understanding of definition, benefits and challenges of the refactoring, between the practice and research community. It is recommended the researchers pay more attention to an industry-based investigation on the refactoring.
Niu, Bhowmik, Liu, and Niu [30] suggested an approach to trace the requirements to identify accurately the locations in a system that need to be refactored and the refactoring that should to be applied. To assess the approach, an industrial case study was used. The results demonstrated that this approach suggested refactoring techniques adequately.
Szőke, Antal, Nagy, Ferenc, and Gyimothy [31] conducted a case study to explore whether the quality of the software could be improved or deteriorated by refactoring and whether it could actually recognize the quality change caused by a single refactoring technique. Complexity (e.g. McCabe's cyclomatic complexity) and size (e.g. LOC) metrics were examined. Five large industrial software projects were analyzed and measured a number of revisions for specific time periods. SourceAudit tool was utilized to analyze the quality of source code relevant to the five software systems. The findings showed that the influence of a single refactoring technique on the quality of a system's software is scarcely predictable; moreover, it could sometimes have an adverse effect on the quality. In other words, it was found that applying only one refactoring technique may make few improvements in the quality or sometimes deteriorate it, but when applying the refactoring techniques in blocks, it can significantly improve the quality. It given an important beneficial impact on quality whenever developers systematically refactured their code. Not only because they improved the quality of their software, but also because the designers who conducted the refactoring techniques were able to pay more attention to writing improved quality code.
Another replicated study conducted by Szőke et al. [13] was to discover how the developers executed the refactoring in an industrial environment in case they have time and money resources. Five large-scale industrial projects were utilized in their experiments for investigation. They found that developers used the optimization in the process of refactoring to improve quality of these projects that really led to positively improve their quality.
Ammerlaan, Veninga, and Zaidman [32] conducted experiment in industrial setting to evaluate whether "clean code" refactoring helped to increase productivity of developers in term of understandability. They observed that understandability was not always improved due to the developers have different styles in coding.
Gatrell and Counsell [33] conducted a research to identify whether the refactoring process helps in mitigating of maintenance efforts; consequently, reducing both faults and changes proneness. They analyzed a large software project over a year and identified a group of refactored classes through the mid-four months of assessment; a bespoke too was used to define occurrences of 15 refactoring techniques of refactoring. They analyzed the software fault and changed for the same group of refactored classes to see if there was a decrease in fault or change activity during or before or after the refactoring period. Moreover, they compared the classes analyzed with the classes that were not refactored at the same time in the project. The findings indicated that there was a significant reduction in fault-prone and change-proneness in the refactored classes. This study gave solid proof the advantages of refactoring in both senses.
Szőke, Nagy, Hegedűs, Ferenc, and Gyimóthy [34] investigated automatic refactoring techniques impact on maintainability of five industrial projects. Eleven metrics was used to measure the improvements. The outcomes showed that all except one project were achieved improvement in the maintainability by the refactoring.
Lin, Peng, Cai, Dig, Zheng, and Zhao [35] presented a refactoring navigator approach which uses the assigned implementation as an original point, a required design as an ideal point, and then a series of refactoring measures were suggested iteratively to achieve the required design. The design quality was measured by coupling between objects (CBO) and lack cohesion of methods (LOCM). A case study was carried out in an industry to assess the approach and the findings acquired indicated that the approach could assist in practice to refactor.
Ouni et al. [3] suggested a multi-objective search-based method to automate the recommended refactoring techniques. The method was directed at finding the appropriate series of refactoring techniques that improved quality by decreasing design flaws. To assess this approach, they performed an empirical experiment using six open-source projects and 11 refactoring techniques. Additionally, a large industrial system provided by their industrial partner was used for the validation. The results showed that software quality was improved this approach. The limitation of this approach was that one input was a base of recorded code changes on previous releases.
Wahler, Drofenik, and Snipes [36] carried out a case study in which refactoring applied for DID software application to improve its maintainability. The initial version of DID was showed several deficiencies regarding maintainability. The refactoring activities were applied based on combining both results came from automatic analyses of the code and the guidance of developer. These combined evaluations were also utilized to measure the effectiveness of the refactoring techniques. The results showed that maintainability was improved in term of reducing the duplicate codes.
Kessentini, Dea, and Ouni [37] described a search-based method that used the changes' history of a system to suggest refactoring techniques that should apply by developers. MoveMethod, MergePackage, PullUpMethod, ExtractInterface were randomly suggested by the method. The obtained findings on two industrial systems indicated important enhancement of the relevance of suggested refactoring techniques, as assessed by the system developers.
Szőke, Antal, Nagy, Ferenc, and Gyimóthy [38] investigated a large number of refactoring commits from the period of refactoring for six largeindustrial software systems. They also examined the impact of these commits upon the code maintainability using its measurements, which included coupling, complexity, and size metrics, depending on the ColumbusQM maintainability model. SourceAudit tool was used to analysis maintainability. They claimed that the result of one refactoring technique applied on software maintenance was very difficult to predict. Furthermore, it may at times have a negative effect. Nevertheless, the whole refactoring approach was capable of having a significant impact on the maintenance, which was measurable utilizing a maintainability model. Table 2 summarizes the above studies in terms of the type of industrial domain, findings, limitations, and gaps.

Discussion
In thisreview of studies concentrating on relation between software refactoring and software quality in industrial setting, we noted that few studies existed that have been conducted in the industrial environment. This is because the refactoring process requires changing the internal structure of a system and that makes it difficult for a company at allowing to refactor its system but if a researcher is working at a company, it easy for him to investigate as a result to conduct the refactoring periodically for maintainability at a company. For instance, Kim et al. [11] carried out an empirical study at Microsoft because he works there. Another difficulty to conduct research in the industry is that the developers believe that refactoring entails large risks and cost such as producing new bugs or raising the complexity( [11], [39], [40]).
We found out 20 relevant studies that were chosen as primary studies and analyzed them to answer the determined research questions outlined below.

RQ1
:What are the techniques of refactoring, inner and external quality attributes researched in industrial settings?
We identified, based on the extracted data from the primary studies, the refactoring techniques that have been applied, attributes of inner and external quality investigated through empirical studies. In addition, several gaps in the existing studies regarding the refactoring techniques, attributes of inner and external quality were recognized. The next paragraphs will answer the RQ2.

• Applied Refactoring Techniques
Many of the empirical studies explored the effect of the refactoring techniques on the internal and external quality attributes in general without determining types of the refactoring techniques. Statistically, thirteen out of twenty studies (i.e. 65%) did not identify any type of refactoring techniques proposed by Fowler ([12], [13] [23], [24], [25], [28], [29], [30], [31], [34], [32], [36], [38]). Moreover, two out of these thirteen studies ( [23], [34]) did not use the refactoring techniques from Fowler's catalog. On the other side, seven out of twenty studies (i.e. 35%) have identified types the refactoring techniques applied in their investigation as shown in Table  3. Only few refactoring techniques from Fowler's catalog have been applied in these studies. Additionally, the researchers in these seven studies did not examine an effect each refactoring technique specifically on the software quality attributes.

Table 3.Overview of the Used Refactoring Techniques
It worth referring to two important gaps: Firstly, few refactoring techniques have been tested for their effect on software quality; secondly, most of the studies reviewed have explored the overall effect of refactoring techniques on software quality. Therefore, in order to fill these gaps, the effect of each refactoring technique, individually, on each inner and external quality attribute needs to be studied in order to understand the effect of each technique on each attribute separately.

RQ2:
What is the relationship between software refactoring and software quality attributes in the industrial setting? Table 4. Analysis of the Existing Studies of Impact Refactoring on the Internal and External Software Quality in the Setting the refactoring techniques have positive and negative influence on the software quality.Moreover, based on the obtained results, we summarized the following very important points: • Few refactoring techniques have been investigated for their effect on the software quality, however, impact each technique on the internal and external quality attributes individually was not identified (see answering RQ 1). • Few internal quality attributes were studied with the refactoring techniques (see answering RQ 1).
• Few external quality attributes were examined with the refactoring techniques (see answering RQ 1).
Therefore, based on the arguments above, the relationship between the software quality attributes and the refactoring techniques was uncertain. In order to draw a general conclusion on the relationship between the refactoring techniques and the quality attributes, it is recommended that researchers conduct more research on the influence of the refactoring techniques on the external quality attributes that have been studied. This is because most external quality attributes were investigated only once (Referring to answer RQ 1). The purpose of repeating is to generalize the results achieved.
In addition, it is recommended that scientists undertake fresh research on the effect of refactoring techniques individually on external quality attributes that lack research (Referring to answer RQ 1). This is because the current studies are not sufficient to draw a conclusive result about benefits the refactoring due to shortcomings in the reviewed studies.

Conclusion
We presented a systematic review regarding the relationship between the software refactoring and software quality through the empirical studies conducted in the industrial setting. Twenty papers were selected as the primary studies and analyzed in depth. There are two objectives for this review: first, to identify the applied refactoring techniques, internal and external quality attributes investigated in the industrial environment, and the second objective is to analyze the relationship between the refactoring techniques and the software quality. As shown in Table 4, the obtained results showedthat the relationship between refactoring and software quality attributes was unclear. This is because most of the reviewed studies investigated the influence of refactoring techniques in general on the software quality without determining the type of the technique.
In addition, several studies reported a negative effect of the refactoring on the quality. Furthermore, there are a lack of empirical studies regarding the applied refactoring techniques, the internal and externalquality attributes, and the relationships between them Researchers are recommended to fill up these gaps by conducting more empirical studies on the quality attributes studied to generalize the results and those quality attributes that have a lack of studies to cover them.