Code smells in cascading style sheets : an empirical study and a predictive model

Cascading Style Sheets (CSS) is widely used in today's web applications to separate presentation semantics from HTML content. Despite the simple syntax of CSS, the language has some characteristics, such as inheritance, cascading and specificity, which make authoring and maintaining CSS a chall...

Full description

Bibliographic Details
Main Author: Gharachorlu, Golnaz
Language:English
Published: University of British Columbia 2014
Online Access:http://hdl.handle.net/2429/51364
Description
Summary:Cascading Style Sheets (CSS) is widely used in today's web applications to separate presentation semantics from HTML content. Despite the simple syntax of CSS, the language has some characteristics, such as inheritance, cascading and specificity, which make authoring and maintaining CSS a challenging task. In this thesis, we describe a set of 26 CSS smells and errors, collected from various development resources and propose an automated technique to detect them. Additionally, we conduct a large empirical study on 500 websites, 5060 CSS files in total which consist of more than 10 million lines of CSS code, to investigate which smells and errors are more prevalent and to what extent they occur in CSS code of today's web applications. Finally, we propose a model based on the findings of our empirical study that is capable of predicting the total number of CSS code smells in any given website which can be used by developers as a CSS code quality guidance. A study of unused CSS code on 187 websites and its results are also described in this thesis. === Applied Science, Faculty of === Electrical and Computer Engineering, Department of === Graduate