Return to search

Kodkommentarer som hjälper eller stjälper : En fallstudie om systemutvecklares inställningar till kodkommentarer och dess bakomliggande orsaker

Software documentation, including code comments, is by many considered an important aspect in the process of software development. In the scientific literature, the perception that code comments increase the understanding of the code appears to be widely accepted. There are however studies indicating that this is not the case and that code comments often are inadequate and erroneous. In order to find out what the opinions on the subject of code comments are amongst software developers themselves, this study intends to investigate their attitudes towards code commenting and the reasons behind these attitudes. A qualitative case study containing eight semi-structured interviews with software developers from a large company in the IT-consulting business have been conducted. The data from the interviews have been analyzed in relation to the Reasoned Action Approach (RAA) in order to gain a deeper understanding of the underlying causes of the software developers’ attitudes. The study found that the majority of the software developers carried an attitude that was considered predominantly negative towards code comments, whereas a small minority displayed a more positive attitude. Some of the attitudes identified from the interview data were that code comments can convey information that is not apparent in the code, comments should only be added when there is a clear need, that the correctness and up-to-dateness of code comments cannot be relied upon and that comments make the code more difficult to read. / Systemdokumentation, och däribland kodkommentarer, är något som av många anses vara viktigt i systemutvecklingsprocessen. I litteraturen inom området verkar det råda en allmänt accepterad uppfattning om att kodkommentarer ökar förståelsen för koden. Det finns dock studier som visar på att så inte är fallet och att kodkommentarer ofta är bristfälliga och felaktiga. För att ta reda på vad systemutvecklare själva har för åsikt när det kommer till kodkommentarer ämnar denna studie undersöka systemutvecklares inställningar till kodkommentarer och de bakomliggande orsakerna till dessa. Genom en kvalitativ fallstudie har åtta semistrukturerade intervjuer utförts med systemutvecklare på ett stort konsultföretag inom IT. Det insamlade intervjumaterialet har sedan analyserats och relaterats till The Reasoned Action Approach (RAA) för att få en djupare förståelse för de bakomliggande orsakerna till systemutvecklarnas inställningar. Studien kom fram till att majoriteten av systemutvecklarna hade en övervägande negativ inställning till kodkommentarer, men ett fåtal visade på en något mer positiv inställning. Några av de inställningar som gick att identifiera från det empiriska materialet var bland annat att kommentarer kan förmedla sådant som inte framgår i koden, kommentarer ska endast skrivas när det finns ett tydligt behov, kommentarers riktighet och aktualitet går inte att lita på, samt att kommentarer försvårar kodens läsbarhet.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:uu-467171
Date January 2022
CreatorsClaesson, Hanna, Hansen, Johanna
PublisherUppsala universitet, Institutionen för informatik och media
Source SetsDiVA Archive at Upsalla University
LanguageSwedish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess

Page generated in 0.0021 seconds