A Design Science Tool to Improve Code Maintainability for Hypertext
Total Page:16
File Type:pdf, Size:1020Kb
A DESIGN SCIENCE TOOL TO IMPROVE CODE MAINTAINABILITY FOR HYPERTEXT PRE-PROCESSOR (PHP) PROGRAMS Grant Trudel livepro Australia, Brisbane, [email protected] Australia Samuel Sambasivam* Woodbury University, Burbank, [email protected] CA, USA *Corresponding author ABSTRACT Aim/Purpose A design science tool to improve code maintainability for PHP programs. Background This paper addresses this issue by providing an enhancement to an existing tool that specifically addresses and improves program maintainability for PHP programs. Methodology This paper uses design science research which involves creating or modifying one or more artifacts. In this case, the artifact is PHP Code Sniffer, which was modified to improve code maintainability of PHP programs. Contribution This paper provides a method of improving code maintainability of PHP programs. Findings Code quality in terms of maintainability is a modern-day issue. No tool spe- cifically addresses maintainability. When updating PHP code that has poor maintainability, there is a much higher likelihood that errors will be intro- duced than with code that is more maintainable. Recommendations For PHP developers and project leaders dealing with PHP programs, running for Practitioners the modified PHP Code Sniffer will improve code maintainability. Recommendations Examine ways to improve other code quality aspects such as reliability, secu- for Researchers rity, usability, efficiency, and so on. Impact on Society PHP programs, which run the background processes behind most web pages, will be more robust, reliable, and correct. Future Research Expand this to investigate improving maintainability for other common pro- gramming languages. Accepted by Editor Michael Jones │ Received: December 20, 2020 │ Revised: April 2, 2021 │ Accepted: April 19, 2021. Cite as: Trudel, G., & Sambasivam, Sam. (2021). A design science tool to improve code maintainability for Hy- pertext Pre-processor (PHP) programs. In M. Jones (Ed.), Proceedings of InSITE 2021: Informing Science and Infor- mation Technology Education Conference, Article 1. Informing Science Institute. https://doi.org/10.28945/4769 (CC BY-NC 4.0) This article is licensed to you under a Creative Commons Attribution-NonCommercial 4.0 International License. When you copy and redistribute this paper in full or in part, you need to provide proper attribution to it to ensure that others can later locate this work (and to ensure that others do not accuse you of plagiarism). You may (and we encour- age you to) adapt, remix, transform, and build upon the material for any non-commercial purposes. This license does not permit you to use this material for commercial purposes. Design Science Tool to Improve Code Maintainability Keywords software quality, software development, PHP, programming, quality assur- ance, maintainability, metrics, design science, refactoring INTRODUCTION Software maintainability is an important aspect of software quality that deserves close attention (Coleman et al., 1994; or evi , 2017). Software development has experienced rapid changes in the past decade (Denning, 2016; Rodríguez et al., 2017). New tools, languages, platforms, and paradigms have presented softwareĐ developersđ ć with a constantly shifting landscape (Denning, 2016; Wang et al., 2012). At the same time, there have been increasing demands for software solutions, particularly for the Internet (Mazaika, n.d.; McKendrick, 2015). Organizations are requiring developers to keep up with the latest trends in technology while meeting deadlines, to remain competitive and keep up with a continuously growing customer base (Johnson, 2018). Poorly maintained software has dire conse- quences, resulting in systems that are rife with software bugs and code that has to be debugged or re- written from scratch, leading to high costs and lost customers (Freyja, 2017; Jones, 2015). Research is needed to examine ways to improve this situation. The goal of this study was to evaluate the effectiveness of modifying an existing artifact to improve the maintainability of Personal Home Page Hypertext Preprocessor (PHP) programs. Despite the high availability of programming tools on the Internet, as well as training and development programs, questions arise regarding the trend of the maintainability of the software being written by developers in the most popular Internet programming language, PHP (Netcraft, 2016). Maintainability is an as- pect of code quality that should be of primary concern to programmers since they proportionally spend a great deal more time maintaining existing code than writing new programs (Campbell et al., 2012; Stephens, 2015). It is noteworthy that code that is difficult to maintain leads to issues such as software bugs (Coleman et al., 1994). The purpose of this design science exploratory study was to discover the architectural changes to the current existing quality improvement tool that were needed to establish better maintainability for PHP programs. The research method was design science, and the research design was exploratory. The study’s method of conveying learning was to explore and explain the architecture changes in an existing quality improvement tool that improved code maintainability for PHP programs. The central phenomenon of the study was exploring a way to improve the maintainability of the PHP code. The data source used in this study was open source PHP programs. The primary idea driving the study was that PHP code maintainability could improve by using an automated tool. The PHP programming language was created in 1994 by Rasmus Lerdorf, released to the public in 1995, and evolved into a complete programming language in 1996 (PHP Group, 2018b). In 2009, the Framework Interoperability Group (FIG) was formed to recommend PHP coding standards known as PHP Standard Recommendations (PSRs) (Independent Software, 2016; PHP Framework Interop Group, 2018). Given the more than ten-year gap from when the language was released until the for- mation of the group to suggest coding standards for PHP, it seems likely that a lot of PHP was coded without a lot of structure, forethought, and quality in mind particularly regarding maintainabil- ity. By 2010, PHP made up 72.5 percent of all server-side languages for websites worldwide (W3Techs, 2018). Despite the efforts of the FIG, the quality of code developed by programmers working in PHP has not improved significantly (Ricca & Tonella, 2005; Xu & Chen, 2001). In order to help alleviate this situation, the PHP Code Sniffer tool has been developed to improve coding standards such as adher- ence to PSRs (PHP Group, 2018a). Standards, when followed, enhance the maintainability of pro- grams (Thomas, 2017). Further, a piece of software called PHP Code Sniffer was developed to 2 Trudel & Sambasivam change PHP code to conform to coding standards. However, PHP Code Sniffer does not focus spe- cifically on maintainability. This study sought to address this shortcoming by enhancing PHP Code Sniffer to improve the maintainability aspect of PHP programs. SIGNIFICANCE OF THE STUDY The quality of PHP programming is worth studying for three reasons. First, PHP is a free open- source programming language for developing server-side functionality for web pages (Brookshear & Brylow, 2014). Since its launch in 1995 by Rasmus Lerdorf, PHP has grown in popularity to become the most widespread web programming language, running on well over 200 million websites (Net- craft, 2016). The setting in which this research occurred is in software development in the PHP pro- gramming language which embeds into HyperText Markup Language (HTML) pages (Aryanto et al., 2015). Typically, PHP is used as a server-side system, housing business rules and interacting with a database such as MySQL via an application programming interface (Lu et al., 2011). According to re- search studies, the quality and reliability of web applications are often sub-standard or unsatisfactory (Ricca & Tonella, 2005; Xu & Chen, 2001). The consequences of inferior quality code include resources spent to fix them, security holes, and maintainability. Poor software quality leads to developers spending excessive amounts of time on tracking down and fixing software bugs (Jones, 2015). Misleading or obsolete information that is readily available on the internet can mislead these upcoming PHP developers to create code that does not meet basic standards of security and maintainability (Lockhart, 2016). Security concerns have been on the rise, and traditional approaches to locking down websites with one-time fixes have been ineffective (Vashist & Gupta, 2014). Second, the answers to the research questions can help programmers fulfill their duties to produce software that is highly maintainable. In order to achieve this, various control processes should be in place, and quality must be the focus of the entire project team throughout the software development lifecycle (Conboy, 2010; Irani, 2010; Moha, 2007). Quality improvements in a software development company are possible by examining project data, characterizing productivity and quality, and deriving strategic and tactical options (Siok, 2008). Third, this study attempted to fill a gap in the literature. From the researcher’s perspective, there are no tools available that modify PHP code to improve its maintainability. There have been no design science research studies that seek to address the problem of software maintainability by designing a solution that could be applied and produce measurable