Return to search

How does refactoring affects performance? / Refaktoreringens påverkan på prestanda

The biggest field in the recent decade in software development has been a subject known as Agile Development. In Agile development the construction of the software is an iterative process and is done with close contact with the costumer. One of the most well-known agile methods is Extreme Programming, which suggests a number of practices to develop software. One of those practices is test-Driven Development, which is the writing of the test code before you write the actual code. This means that one can test the code after it is finished. This creates an opportunity to change the design of the code and then test it again with your test code and discover if any functionality has been lost. The purpose of refactoring is the improvement of the design of existing code. How refactoring affects the performance is not widely discussed and therefore this thesis is going to examine that field. Code examples with and without refactoring principles have been tested. The investigation has been divided into two parts, part one tests individual refactoring principles and part two tests a test application. There are many opinions how to interpret the results of a performance test. After an extensive investigation the arithmetic mean was chosen, mainly because it reflects the total runtime for a series of executions. To test the hypothesis that total execution time will change with refactoring the Students t-test was used. It was chosen because it can be applied even when the variance is unknown. The results were clear, the arithmetic mean increased in five out of six refactoring principles. The test application also increased, but with only 4 %. The reason for the small increase was that it is not possible to go from a non refactored application to a fully refactored application. Another reason is that is was developed with Swedish Rail Administration’s framework which of course was not refactored. The conclusion of this thesis was that one should be careful with refactoring the parts of the code that is executed the most. One should have the “90-10 rule” in mind, it states that 90 % of the execution time is done in 10 % of the code. Another important aspect is that very often is an existing framework used, if you only refactor the new code and not the framework it leads to that only a subset of the code is being refactored. This means that the application does not get fully refactored and therefore the consequences of the refactoring mitigates.
Date January 2010
CreatorsHögberg, Jonas
PublisherUppsala universitet, Data- och systemvetenskap
Source SetsDiVA Archive at Upsalla University
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
RelationUPTEC F, 1401-5757 ; 10 012

Page generated in 0.0024 seconds