<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Untangling Source Code Changes Using Program Slicing</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Ward</forename><surname>Muylaert</surname></persName>
							<email>ward.muylaert@vub.be</email>
							<affiliation key="aff0">
								<orgName type="laboratory">Software Languages Lab</orgName>
								<orgName type="institution" key="instit1">Vrije</orgName>
								<orgName type="institution" key="instit2">Universiteit Brussel</orgName>
								<address>
									<settlement>Brussels</settlement>
									<country key="BE">Belgium</country>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Coen De Roover</orgName>
							</affiliation>
							<affiliation key="aff2">
								<orgName type="laboratory">Software Languages Lab</orgName>
								<orgName type="institution" key="instit1">Vrije</orgName>
								<orgName type="institution" key="instit2">Universiteit Brussel</orgName>
								<address>
									<settlement>Brussels</settlement>
									<country key="BE">Belgium</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Untangling Source Code Changes Using Program Slicing</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">D98FA93969CDB185AE4A82F782238510</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T21:55+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Version control systems (VCS) are widely used to manage the history of code bases. These histories in turn provide opportunities for research. Researchers expect the commits in these version control systems to be atomic. That is, each commit performs one task. This is however not always the case. To remedy this, we propose a commit untangling technique using program slicing. In particular, we posit that all related changes are part of the same program slice. To do so, we perform program slicing on changes. Preliminary results using intra-procedural slicing have proven to be encouraging. We are currently working on expanding our work to be inter-procedural.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>Version control systems (VCS) are widely used to manage the history of code bases. Prominent examples include Git, SVN, or Mercurial. A developer may "save" their changes into units called commits. Best practice suggests each commit should only contain changes related to one task. Such commits are called atomic commits <ref type="bibr" target="#b1">[2]</ref>, <ref type="bibr" target="#b13">[14]</ref>. In this manner, the version control system can be used to keep track of how the program under development evolves. The version control system can also be applied to, for example, revert individual changes or port changes to other versions of the code base. On the research side, version control systems provide a trove of software evolution information open to analysis.</p><p>However, developers do not necessarily follow the best practice of creating only atomic commits <ref type="bibr" target="#b8">[9]</ref>. For example, a small bug may be quickly fixed while working on another feature and placed in the same commit. Floss refactoring is another problem: refactoring in order to implement a new feature. These situations make for larger commits in which many unrelated changes are tangled together. Such commits are called tangled commits.</p><p>Tangled commits occur on a regular basis. A study by Herzig et al. found that up to 15% of Java bug fixes contain tangled changes <ref type="bibr" target="#b2">[3]</ref>. <ref type="bibr">Tao et al.</ref> found that between 17% and 29% of investigated revisions were tangled <ref type="bibr" target="#b13">[14]</ref>. <ref type="bibr">Nguyen et al.</ref> found that 11% to 39% of all the fixing commits used for mining archives were tangled <ref type="bibr" target="#b9">[10]</ref>.</p><p>Tangled commits lead to problems on many fronts. We provide four examples. A developer will have problems reverting particular changes if they are a part of a bigger commit. A developer may also have problems integrating particular changes from another developer if the desired change is part of many different changes in a tangled commit. A code reviewer will have a harder time understanding larger commits of unrelated changes <ref type="bibr" target="#b12">[13]</ref>. This in turn will lead to lower quality feedback <ref type="bibr" target="#b0">[1]</ref>. A researcher interested in historical analysis, finally, will need to decide on the "one" function of a commit even though many unrelated changes may be present in the commit.</p><p>In light of these difficulties, we propose an automated commit untangling technique. Our technique employs program slicing around changes. Program slicing is a technique to answer questions about the influence of program statements on other program statements <ref type="bibr" target="#b14">[15]</ref>, <ref type="bibr" target="#b10">[11]</ref>. We extend this idea. We posit that all related changes are part of the same program slice. Thus, a commit may be untangled by means of the created slices. A preliminary implementation of our technique performs intra-procedural slicing. Despite this limitation, early results are encouraging. We are currently in the process of expanding the implementation to work on an inter-procedural level.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. ARCHITECTURE</head><p>Our technique consists of four major parts. First, the commit is distilled into fine-grained changes to the program's abstract syntax tree (AST). Second, a program dependence graph of the program is created. Third, a slice of the program dependence graph is produced for every fine-grained change. Finally, changes are grouped by means of the slices and the commit is partitioned accordingly. We have implemented our technique to work on Java programs. The rest of this section provides further detail into each of the four steps.</p><p>For the first step, we make use of ChangeNodes <ref type="bibr" target="#b11">[12]</ref>. ChangeNodes works on the AST of a Java program. Given two versions of a program, ChangeNodes provides a list of Insert, Update, Move, and Delete operations. In our case the two versions are the version before and the version after the commit under analysis. Applying the obtained list of changes to the AST of the earlier version results in the AST of the later version. ChangeNodes thus provides fine-grained changes describing the commit.</p><p>For the second step, we make use of TinyPDG <ref type="bibr" target="#b5">[6]</ref>, <ref type="bibr" target="#b6">[7]</ref>, <ref type="bibr" target="#b4">[5]</ref>. TinyPDG creates a program dependence graph (PDG) of a Java program. TinyPDG does this intra-procedurally. Our main motivation for choosing TinyPDG is that it makes use of Eclipse libraries to create the underlying AST. ChangeNodes also employs the Eclipse libraries for this purpose. This makes it more straightforward to link these two parts together.</p><p>In the third step, our technique performs forward and backward slicing on the program dependence graph. This is done for every distilled fine-grained change obtained in step one. Thus for every change c i a slice S(c i ) is obtained. We implemented the intra-procedural slicing algorithm as described by Horwitz et al. <ref type="bibr" target="#b7">[8]</ref> on top of the PDG created by TinyPDG. The algorithm by Horwitz et al. performs backward slicing. We adjusted the algorithm so that it also performs forward slicing. When we refer to slicing, we consider the combination of forward and backward slicing.</p><p>Finally, our technique considers the following relation R between changes. Changes c i and c j are related (notation: c i Rc j ) if and only if c i 2 S(c j ) _ c j 2 S(c i ). By definition of how slicing works, this relation is reflexive. The relation is also clearly symmetric due to its symmetric definition. The relation is however not necessarily transitive. We cannot state that if c i Rc j and c j Rc k , then c i Rc k . Consider for this the following simplified situation. c j is part of the root node of a PDG with two children. c i is part of one of the child nodes. c k is part of the other child node. Slicing in this situation results in S(c i ) = {c i , c j }, S(c j ) = {c i , c j , c k }, and S(c k ) = {c j , c k }. Then c i Rc j and c j Rc k , but ¬(c i Rc k ). The relation R is thus not an equivalence relation. Instead, we partition the set of changes into subsets by means of the following steps.</p><p>1) If a change is not in relation with any change in any of the existing subsets, create a new subset with that change in it. 2) If a change is in a relation with (an) element(s) of exactly one existing subset, place the change in that subset. 3) If a change is in a relation with two (or more) elements of different subsets, join the subsets together and add the change to it. The last step fakes transitivity and effectively "widens" the relation R: more changes are considered related than they would be by our original definition of R. In terms of these subsets, we rephrase our hypothesis as: A commit is atomic if and only if our technique does not split up the commit into different subsets of changes.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. EVALUATION</head><p>To evaluate our hypothesis, we make use of a dataset of five Java programs as used by Herzig et al. in <ref type="bibr" target="#b2">[3]</ref>, <ref type="bibr" target="#b3">[4]</ref>. The programs in question are: ArgoUML, GWT, Jaxen, JRuby, and Xstream. These projects were chosen for meeting certain quality criteria. For each of the projects, Herzig et al. manually identified atomic commits using commit and issue information. Using the atomic commits, Herzig et al. also created artificial tangled commits for each of the projects.</p><p>We used this dataset to perform a preliminary evaluation of our hypothesis and technique. This preliminary evaluation has one obvious limitation. Due to the current implementation of our technique being intra-procedural, only atomic and tangled commits affecting just one method could be analysed. This limits the number of commits that can be analysed, the large majority of commits cover more than one method. In the case of the Jaxen project, no commits are left to be analysed. This limitation will be solved by our (current and) future work in which we are expanding the implementation to work interprocedurally. The setup of our evaluation will remain the same for the inter-procedural evaluation.</p><p>We apply our technique to every atomic and tangled commit affecting just one method. We consider three separate outcomes for the analysis of a commit, regardless of it being atomic or tangled.</p><p>1) The commit is correctly identified as atomic or tangled.</p><p>Our technique and the dataset agree on what kind of commit it is.</p><p>2) The commit is not correctly identified. Our technique identified the commit as atomic/tangled while the dataset calls the commit tangled/atomic respectively. 3) No result. This happened when the memory overhead made the analysis crash. We have not yet played around with this overhead in order to solve or analyse it. In the case of atomic commits, the results are promising. For each of the projects except JRuby, the ratio of correctly analysed atomic commits is larger than 90%. For JRuby nearly 20% of commits could not be analysed. Incorrectly identified commits happened largely through statements like throw or catch not being supported by TinyPDG.</p><p>Our technique falters on certain types of tangled commits. Except for the GWT project, more tangled commits were incorrectly identified as atomic than they were correctly identified as tangled. However, the large majority of these incorrect identifications are due to formatting changes or changes to comments. Our technique does not take formatting nor comments into account, only code. As such, a commit handling both one code related task and one formatting task would be classified as tangled in the dataset, but identified as atomic by our technique.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. FUTURE WORK</head><p>We are currently in the process of making the implementation of our technique inter-procedural. To do so, we need to make two major changes.</p><p>First, our program dependence graph needs to consider the entire program. Rather than a procedure dependence graph, we require a system dependence graph (SDG) or class dependence graph (ClDG). To achieve this, we need to extend TinyPDG to work inter-procedurally. The main hurdle here is creating the summary edges via the algorithm as described in <ref type="bibr" target="#b7">[8]</ref>. These are necessary to avoid the calling context problem as described there.</p><p>Second, our slicer needs to be adjusted to work on the interprocedural system dependence graph. These adjustments are also described by <ref type="bibr" target="#b7">[8]</ref>.</p><p>Once our implementation works inter-procedurally, we will perform the evaluation described in section III again.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. CONCLUSION</head><p>We wanted to untangle commits performing more than one task. For this, we considered the hypothesis that related changes belong to one and the same program slice. We created a first implementation to test this hypothesis. This implementation works intra-procedurally. Despite this limitation, initial results are promising. Incorrect identifications happen largely either due to parts of the program our implementation does not handle (e.g., throw statements) or due to formatting and comment changes which our technique does not consider. We are currently working on expanding the implementation of our technique to work inter-procedurally. Once this is done, we will redo the evaluation with the complete dataset.</p></div>		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>ACKNOWLEDGMENT</head><p>Ward Muylaert is an SB PhD fellow at FWO, project number 1S64317N.</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Expectations, outcomes, and challenges of modern code review</title>
		<author>
			<persName><forename type="first">A</forename><surname>Bacchelli</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Bird</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Software Engineering (ICSE)</title>
				<imprint>
			<date type="published" when="2013">2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Untangling fine-grained code changes</title>
		<author>
			<persName><forename type="first">M</forename><surname>Dias</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Bacchelli</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Gousios</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Cassou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Ducasse</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Software Analysis, Evolution, and Reengineering</title>
				<imprint>
			<publisher>SANER</publisher>
			<date type="published" when="2015">2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">The impact of tangled code changes on defect prediction models</title>
		<author>
			<persName><forename type="first">K</forename><surname>Herzig</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Just</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Zeller</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Empirical Software Engineering</title>
		<imprint>
			<biblScope unit="volume">21</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="303" to="336" />
			<date type="published" when="2015-04">Apr. 2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m" type="main">Untangling changes</title>
		<author>
			<persName><forename type="first">K</forename><surname>Herzig</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Zeller</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<monogr>
		<title level="m" type="main">Tinypdg: A library for building intraprocedural pdgs for java programs</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Higo</surname></persName>
		</author>
		<ptr target="https://github.com/YoshikiHigo/TinyPDG" />
		<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Enhancing quality of code clone detection with program dependency graph</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Higo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Kusumoto</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Working Conference on Reverse Engineering</title>
				<imprint>
			<date type="published" when="2009">2009</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Code clone detection on specialized pdgs with heuristics</title>
	</analytic>
	<monogr>
		<title level="m">European Conference on Software Maintenance and Reegineering</title>
				<imprint>
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Interprocedural slicing using dependence graphs</title>
		<author>
			<persName><forename type="first">S</forename><surname>Horwitz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Reps</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Binkley</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Transactions on Programming Languages and Systems</title>
		<imprint>
			<biblScope unit="volume">12</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="26" to="60" />
			<date type="published" when="1990-01">Jan. 1990</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Untangling development tasks with software developer&apos;s activity</title>
		<author>
			<persName><forename type="first">M</forename><surname>Konopka</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Navrat</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">IEEE/ACM 2nd International Workshop on Context for Software Development</title>
				<imprint>
			<date type="published" when="2015-05">2015. May 2015</date>
			<biblScope unit="page" from="13" to="14" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Filtering noise in mixed-purpose fixing commits to improve defect prediction and localization</title>
		<author>
			<persName><forename type="first">H</forename><forename type="middle">A</forename><surname>Nguyen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">T</forename><surname>Nguyen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">N</forename><surname>Nguyen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Computer</surname></persName>
		</author>
		<author>
			<persName><surname>Department</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Symposium on Software Reliability Engineering (ISSRE)</title>
				<imprint>
			<date type="published" when="2013">2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">A vocabulary of program slicing-based techniques</title>
		<author>
			<persName><forename type="first">J</forename><surname>Silva</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Computing Surveys</title>
		<imprint>
			<biblScope unit="volume">44</biblScope>
			<biblScope unit="issue">3</biblScope>
			<date type="published" when="2012-06">Jun. 2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Extracting executable transformations from distilled code changes</title>
		<author>
			<persName><forename type="first">R</forename><surname>Stevens</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">De</forename><surname>Roover</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Software Analysis, Evolution and Reengineering</title>
				<imprint>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">How do software engineers understand code changes? -an exploratory study in industry</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Tao</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Dang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Xie</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Zhang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Kim</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Symposium on the Foundations of Software Engineering (FSE)</title>
				<imprint>
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Partitioning composite code changes to facilitate code review</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Tao</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Kim</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Mining Software Repositories (MSR)</title>
				<imprint>
			<date type="published" when="2015">2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">Program slicing</title>
		<author>
			<persName><forename type="first">M</forename><surname>Weiser</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Software Engineering (ICSE)</title>
				<imprint>
			<date type="published" when="1981">1981</date>
			<biblScope unit="page" from="439" to="449" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
