maintenance patterns of large-scale php web applications panos kyriakakis 1 and alexander...
TRANSCRIPT
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
Serious v
ersus
Scripting
Languages
Scripting languages
not suitable for
proper software
engineering
Java Makes Scripting
Languages Irrelevant?
"good PHP programmer" considered an oxymoron
Ewww, You Use PHP?
Scripting Languages increase productivity by a factor of two
CS101 in:MIT : PythonStanford : Javascript (variant)Berkeley: PythonHarvard: C, PHP, JavascriptCornell: Python
Case Study Design
2,674 themes, 110 million downloads
492 contributors for Drupal 5.0
most widely used open source bulletin board system
“born” in 1998. > 200,000 downloads / month669 contributors, estimated effort: 136 person-years
Started in 2000, 1.8 M downloads in sourceforge, translated in 50 languages, ~ 2577 downloads / week
Analyzed Projects
Project Years Releases
First Last
Release KLOC Code Blocks
Release KLOC Code Blocks
WordPress 9 71 1.5 20 763 3.6.1 200 5154Drupal 12 120 4.0.0 14 692 7.23 173 5140phpBB 12 37 2.0.0 18 256 3.0.12 194 2389MantisBt 8 33 1.0.0 68 2447 1.2.15 165 4904phpMyAdmin 9 129 2.9.0 39 693 4.1.6 248 5343
Lehman's 6th law confirmed
390 official releases
50 years of evolution
>36 million LOC
Survival Analysis
Survival analysis models the time it takes for events to occur
why do we need survival analysis?
Start of the study
End of the study
time
censored
censored
???????
???????censored
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)
function usage in PHP (2)
Stalactites= hotspots or POI
Survival Analysis Way of identifying hotspots
function usage in PHP (3)
ADOdb library
nuSoap library
Survival function S(ti)=1-di/ri
method Additions (%)
function removal in PHP (2)
Survival function S(t)
Percentage of added methods
62% of removed functions
replaced with methods
45% 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
Interface Stability
Category Impact SeverityC1 Change
of mandatory parameters
Breaking function's compatibility
C2 Addition of optional parameters
No impact
C3 Removal of optional parameters
Possible breaking of function's compatibility
C4 Change of default values
Possible breaking of function's compatibility
C5 Change of function's return type
Possible breaking of function's compatibility
C6 Change of function's implementation
No impact
Freq.
0.09%
0.15%
0.02%
0.94%
0.66%
7.46%
Overview of Findings
Phenomenon Conclusion
Survival regarding function usage
Main source of unused code is library usage. × ✔ × ✔ ✔
Unused code appears in major versions ✔ ✔ ✔ ✔ ✔
Survival regarding function removal
Function removal appears in major versions ✔ ✔ ✔ ✔ ✔
Only new features are implemented with OO × × ✔ ✔ ×
Functional code replaced with OO code ✔ ✔ × × ✔
Library usageProjects reuse code from third party libraries ✔ ✔ × ✔ ✔
Interface stability Interface remains stable ✔ ✔ ✔ ✔ ✔
Migration to OO Projects migrate to OO ✔ ✔ ✔ ✔ ✔
Evolution of Complexity Complexity remains stable ✔ ✔ ✔ ✔ ✔