Return to search

Passive MVC och MVVM designmönster i Android : En jämförelse av kodkomplexitet mellan Passive MVC och MVVM / Passive MVC and MVVM design pattern in Android : A comparison of code complexity between Passive MVC and MVVM

Det mobila operativsystemet Android är idag ett ganska dominerande operativsystem på den mobila marknaden dels på grund av sin öppenhet men också på grund av att tillgängligheten är stor i och med både billiga och dyra telefoner finns att tillgå. Men idag har Android inget fördefinierat designmönster vilket leder till att varje utvecklare får bestämma själv vad som ska användas, vilket ibland kan leda till onödigt komplex kod i applikationerna som sen blir svårtestad och svårhanterlig. Detta arbete ämnar jämföra två designmönster, Passive Model View Controller (PMVC) och Model View View-Model (MVVM), för att se vilket designmönster som blir minst komplext med hjälp av att räkna fram mätvärden med hjälp av Cyclomatic Complexity Number (CCN). Studien är gjord utifrån arbetssättet Design & Creation och ämnar bidra med: kunskap om vilket mönster man bör välja, samt om CCN kan peka ut vilka delar i en applikation som kommer att ta mer eller mindre lång tid att testa. Under studiens gång tog vi även fram skillnader på om man anväder sig av den så kallade Single Responsibilyt Principle (SRP) eller inte. Detta för att se om separerade vyer gör någon skillnad i applikationernas komplexitet. I slutändan så visar studien på att komplexiteten i små applikationer är väldigt likvärdig, men att man även på små applikationer kan se skillnad på hur komplex koden är men också att kodkomplexitet på metodnivå kan ge riktlinjer för testfall. / Today the mobile operating system Android has a firm grip on the mobile market due to its open source code and the availability due to the variety of phones available, from very cheap models to the high-end exclusive ones. However, Android currently has no defined design pattern which causes a bit of a problem during the initial stages of development because the developer has to make that decision before the initial development starts. This sometimes causes excessive complexity in the finished application, which then becomes difficult to test and manage. In this report we compare the two design patterns Passive Model View Controller (PMVC) and Model View View-Model (MVVM) to decide which one is the least complex. For this we used so called metrics to show the complexity of the finished applications. The metrics were calculated using the existing library of functions called Cyclomatic Complexity Numbers (CCN). The study is based on the workflow Design & creation and aim to contribute with: knowledge that will make it easier to choose design pattern when developing an Android application, and if you can with CCN point out which areas in an application will take more or less time to conduct tests on. During the study we also analyzed how big of an impact the Single Responsibility Principle (SRP) had on the complexity. This was part of the study so that we could see the difference of separated views versus non-separated views. The study shows us that the complexity in small applications is very similar, no matter which design pattern you're using. However, it also shows that there are certain parts of the applications that are diverse in their complexity and that code complexity on method-level can give directions to test cases.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:du-21219
Date January 2016
CreatorsPettersson, Tom, Bulai, Tobias
PublisherHögskolan Dalarna, Informatik, Högskolan Dalarna, Informatik
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.0024 seconds