Koodipohjan refaktorointi ja ylläpidettävyys
Vihlman, Roosa (2022)
Vihlman, Roosa
2022
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-202203304137
https://urn.fi/URN:NBN:fi:amk-202203304137
Tiivistelmä
Tämä opinnäytetyö suoritettiin Profit Software Oy:n toimeksiantona. Opinnäytetyössä käsiteltiin koodipohjan refaktorointia ja ylläpidettävyyttä sekä näiden välistä yhteyttä. Ohjelmistotuotteen elinkaaren vaiheista ylläpitovaihe on pisin, minkä vuoksi koodin laadullisista ominaisuuksista ylläpidettävyys on merkittävä tekijä. Opinnäytetyössä selvitettiin, millaisilla tavoilla refaktorointi vaikuttaa sekä koodin ylläpidettävyyteen että ohjelmistokehityksen eri osa-alueisiin. Työssä nostettiin esille myös automaattisten refaktorointityökalujen maine ohjelmistokehittäjien keskuudessa sekä syitä skeptiselle suhtautumiselle työkaluja kohtaan.
Opinnäytetyön toiminnallinen osuus ja tulosten analysointi toteutettiin Profit Softwarella tehtyjen refaktorointien pohjalta. Toiminnallisessa osuudessa käytiin yhdessä esimerkkien kanssa läpi, miten refaktorointia voidaan toteuttaa koodissa ja kuinka moninaista refaktorointi voi olla. Tuloksissa peilataan refaktorointien vaikutusta koodin ylläpidettävyyteen ja analysoidaan, saavuttivatko Profit Softwarella tehdyt refaktoroinnit niille asetetut tavoitteet.
Johtopäätöksissä todettiin, että refaktorointi olisi hyvä nostaa esille jo ohjelmiston kehitysvaiheessa. Koodia olisi hyvä refaktoroida aina silloin, kun sille on tarve ja mahdollisuus. Kun tarpeellinen refaktorointi otetaan huomioon jo riittävän ajoissa, voidaan välttyä ylimääräiseltä ajan ja vaivan käytöltä tulevaisuudessa. This thesis was commissioned by Profit Software Ltd. This thesis focused on code refactoring and maintainability and the connection between these topics. Maintenance phase is the longest phase of software product’s lifecycle which is the reason why maintainability plays significant role in code quality properties. In this thesis was investigated in which ways refactoring can affect on both code maintainability and different areas of software development. There were also noted the reputation of automatic refactoring tools and reasons why software developers act as skeptical as they do towards these tools.
The practical part of this thesis and result analyzing were based on refactoring made in Profit Software. In the practical part there were introduced together with examples how refactoring can be done in code and how diverse it can be. Effects of refactoring are mirrored in results and analyzed if the refactorings made in Profit Software achieved the goals which were set to them.
There were stated in the conclusions of this thesis that refactoring should be emphasized already in the phase of software development. Code would be good to be refactored when ever it is necessary and there is chance to refactor it. Waste of time and effort can be saved when necessary refactoring is taken noticed in sufficient time.
Opinnäytetyön toiminnallinen osuus ja tulosten analysointi toteutettiin Profit Softwarella tehtyjen refaktorointien pohjalta. Toiminnallisessa osuudessa käytiin yhdessä esimerkkien kanssa läpi, miten refaktorointia voidaan toteuttaa koodissa ja kuinka moninaista refaktorointi voi olla. Tuloksissa peilataan refaktorointien vaikutusta koodin ylläpidettävyyteen ja analysoidaan, saavuttivatko Profit Softwarella tehdyt refaktoroinnit niille asetetut tavoitteet.
Johtopäätöksissä todettiin, että refaktorointi olisi hyvä nostaa esille jo ohjelmiston kehitysvaiheessa. Koodia olisi hyvä refaktoroida aina silloin, kun sille on tarve ja mahdollisuus. Kun tarpeellinen refaktorointi otetaan huomioon jo riittävän ajoissa, voidaan välttyä ylimääräiseltä ajan ja vaivan käytöltä tulevaisuudessa.
The practical part of this thesis and result analyzing were based on refactoring made in Profit Software. In the practical part there were introduced together with examples how refactoring can be done in code and how diverse it can be. Effects of refactoring are mirrored in results and analyzed if the refactorings made in Profit Software achieved the goals which were set to them.
There were stated in the conclusions of this thesis that refactoring should be emphasized already in the phase of software development. Code would be good to be refactored when ever it is necessary and there is chance to refactor it. Waste of time and effort can be saved when necessary refactoring is taken noticed in sufficient time.