260 likes | 288 Views
This study explores the evolution of five large open-source PHP web applications, analyzing themes, downloads, contributors, and LOC. The research employs survival analysis to identify hotspots and stalactites in function usage, investigating termination events and function removal. The migration to object-oriented programming, library usage impact, and complexity evolution are also examined. The findings suggest that PHP does not impede systematic maintenance in large projects.
E N D
Maintenance Patterns of large-scale PHP Web Applications Panos Kyriakakis1 and Alexander Chatzigeorgiou2 1 Hellenic Open University 2 University of Macedonia, Greece ICSME’2014, Research Track, October 3, 2014
CS101 in: MIT : Python Stanford : Javascript (variant) Berkeley: Python Harvard: C, PHP, Javascript Cornell: Python
Goal of this work Study the evolution of Five large open-source PHP Web Applications
Case Study Design 2,674 themes, 110 million downloads 492 contributors for Drupal 5.0 most widely used open source bulletin board system Started in 2000, 1.8 M downloads in sourceforge, translated in 50 languages, ~ 2577 downloads / week “born” in 1998. > 200,000 downloads / month 669 contributors, estimated effort: 136 person-years
Analyzed Projects 390 official releases Lehman's 6th law confirmed 50 years of evolution >36 million LOC
The Approach Downloading Bergmann’s PHP DCD AST analysis
Survival Analysis Survival analysis models the time it takes for events to occur why do we need survival analysis? censored ??????? censored ??????? censored Start of the study time End of the study
Kaplan-Meier curves Survival function S(ti)=1-di/ri Cumulative Probability of surviving up to time t C(ti)=S(ti)*C(ti-1)
Survival Analysis: function usage in PHP Termination event: a function becomes unused
function usage in PHP (2) Survival Analysis Way of identifyinghotspots Stalactites= hotspots or POI
function usage in PHP (3) Survival function S(ti)=1-di/ri method Additions (%) nuSoap library ADOdblibrary
Hooks /* global array of registered hooks */ $hooks=array(); /* function for registering hooks */ functionadd_action($hook,$funcName){ global$hooks; if(!isset($hooks[$hook])){ $hooks[$hook]=array(); } $hooks[$hook][]=$funcName; } /* function for executing a particular hook */ functiondo_action($hook){ global$hooks; foreach($hooks[$hook]as$fn){ call_user_func($fn); } } /* extensible function */ functionmyFunc(){ /* ... function code ... */ do_action('my_hook'); } /* extension */ functionmyHookFunc(){} Stealth calls /* registering a hook function */ add_hook('my_hook','myHookFunc');
function usage in PHP (3) Stalactive – Stalagmite phenomenon
Survival Analysis: function removal Termination event: a function is removed from the system
function removal in PHP (2) Survival function S(t) Percentage of added methods 45% replaced with methods 62% of removed functions replaced with methods
function removal in PHP (3) However, not all systems convert existing functions to methods Functions are replaced with functions Only new functionality written in OO Why ? Wordpress: > 30,000 plugins, > 2,000 themes Drupal: > 8,000 plugins, >600 themes
Library usage “pre-made building blocks ease and speed up the development of applications” (Tulach, Practical API Design) “external libraries and their usage have a significant impact on the maintenance of the including software”(Bauer et al., ICSM’2012) In PHP library code becomes part of the system’s source code Easy to measure
Library usage (2) added PHPExcel
Interface Stability 0.09% 0.15% 0.02% 0.94% 0.66% 7.46%
Migration to OO Almost OO Turn to OOP
Evolution of Complexity percentage of functions with CCN in three ranges [0,5) [5,10) >10
Conclusion Large PHP projects undergo systematic maintenance PHP does not seem to hinder it
Thank you for your attention!! (and have a safe trip back home) ICSME’2014, Research Track, October 3, 2014