1. Detection of Violation of MVVM Design Pattern in Objective-C Programs
- Author
-
Wat Wongtanuwat and Twittie Senivongse
- Subjects
Computer science ,business.industry ,Team software process ,Programming language ,Design pattern ,Maintainability ,Software development ,computer.software_genre ,Software ,Component (UML) ,Software design pattern ,Software design ,Business logic ,business ,computer - Abstract
In object-oriented software development, several design patterns are used to design software to solve different problems. The Model-View-ViewModel or MVVM pattern is a design pattern that can be used to design structure of software which comprises three components. The Model component holds application data. The View component displays visual elements and controls on the screen. The ViewModel component is the intermediary between the Model and View and transforms model information for display on a view. The advantages of this pattern are that there is a clear separation between domain logic in the Model and the display on the View, and tests and maintenance of different components are facilitated. However, there are several developers in a software development team, and not all developers use the MVVM pattern. This makes the code not compliant with the pattern and affects code maintenance. To help developers to revise the code to comply with the MVVM pattern, this paper has studied the MVVM design pattern, summarized principles of the pattern, and proposed the criteria to detect pattern violation in Objective-C code. An automated tool has been developed to detect MVVM violation and report violation locations in the code so that developers can revise the code to follow the pattern. An experiment shows that the tool performs satisfactorily in pattern violation detection, compared with manual detection, with the precision of 0.81, recall of 0.77, and F1 of 0.79.
- Published
- 2020
- Full Text
- View/download PDF