Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maintenance Patterns of large-scale PHP Web Applications Panos Kyriakakis 1 and Alexander Chatzigeorgiou 2 1 Hellenic Open University 2 University of Macedonia,

Similar presentations


Presentation on theme: "Maintenance Patterns of large-scale PHP Web Applications Panos Kyriakakis 1 and Alexander Chatzigeorgiou 2 1 Hellenic Open University 2 University of Macedonia,"— Presentation transcript:

1 Maintenance Patterns of large-scale PHP Web Applications Panos Kyriakakis 1 and Alexander Chatzigeorgiou 2 1 Hellenic Open University 2 University of Macedonia, Greece ICSME’2014, Research Track, October 3, 2014

2 Ewww, You Use PHP?

3 CS101 in: MIT : Python Stanford : Javascript (variant) Berkeley: Python Harvard: C, PHP, Javascript Cornell: Python

4 Goal of this work Study the evolution of Five large open-source PHP Web Applications

5 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 / month 669 contributors, estimated effort: 136 person-years Started in 2000, 1.8 M downloads in sourceforge, translated in 50 languages, ~ 2577 downloads / week

6 Analyzed Projects ProjectYearsReleases FirstLast ReleaseKLOCCode Blocks ReleaseKLOCCode Blocks WordPress9711.5207633.6.12005154 Drupal121204.0.0146927.231735140 phpBB12372.0.0182563.0.121942389 MantisBt8331.0.06824471.2.151654904 phpMyAdmin91292.9.0396934.1.62485343 Lehman's 6th law confirmed 390 official releases 50 years of evolution >36 million LOC

7 The Approach Downloading Bergmann’s PHP DCD AST analysis

8 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

9 Kaplan-Meier curves Survival function S(t i )=1-d i /r i Cumulative Probability of surviving up to time t C(t i )=S(t i )*C(t i-1 )

10 Survival Analysis: function usage in PHP Termination event: a function becomes unused

11 function usage in PHP (2) Stalactites= hotspots or POI Survival Analysis  Way of identifying hotspots

12 function usage in PHP (3) ADOdb library nuSoap library Survival function S(t i )=1-d i /r i method Additions (%)

13 Hooks /* global array of registered hooks */ $hooks = array(); /* function for registering hooks */ function add_action($hook, $funcName) { global $hooks; if( !isset($hooks[$hook]) ) { $hooks[$hook] = array(); } $hooks[$hook][] = $funcName; } /* function for executing a particular hook */ function do_action($hook) { global $hooks; foreach($hooks[$hook] as $fn) { call_user_func($fn); } /* extensible function */ function myFunc() { /*... function code... */ do_action('my_hook'); } /* extension */ function myHookFunc() { } /* registering a hook function */ add_hook('my_hook','myHookFunc'); Stealth calls

14 function usage in PHP (3) Stalactive – Stalagmite phenomenon

15 Survival Analysis: function removal Termination event: a function is removed from the system

16 function removal in PHP (2) Survival function S(t) Percentage of added methods 62% of removed functions replaced with methods 45% replaced with methods

17 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

18 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

19 Library usage (2) added PHPExcel

20 Interface Stability CategoryImpactSeverity C1Change of mandatory parameters Breaking function's compatibility C2Addition of optional parameters No impact C3Removal of optional parameters Possible breaking of function's compatibility C4Change of default values Possible breaking of function's compatibility C5Change of function's return type Possible breaking of function's compatibility C6Change of function's implementation No impact Freq. 0.09% 0.15% 0.02% 0.94% 0.66% 7.46%

21 Migration to OO Turn to OOP Almost OO

22 Evolution of Complexity percentage of functions with CCN in three ranges [0,5) [5,10) >10

23 Overview of Findings PhenomenonConclusion 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 usage Projects reuse code from third party libraries ✔✔ × ✔✔ Interface stability Interface remains stable ✔✔✔✔✔ Migration to OO Projects migrate to OO ✔✔✔✔✔ Evolution of Complexity Complexity remains stable ✔✔✔✔✔

24 Future Work

25 Conclusion Large PHP projects undergo systematic maintenance PHP does not seem to hinder it

26 ICSME’2014, Research Track, October 3, 2014 Thank you for your attention!! (and have a safe trip back home)


Download ppt "Maintenance Patterns of large-scale PHP Web Applications Panos Kyriakakis 1 and Alexander Chatzigeorgiou 2 1 Hellenic Open University 2 University of Macedonia,"

Similar presentations


Ads by Google