Refactoring in PHP While Going Open Source. A Case Study

Post on 04-Dec-2014

2.037 views 5 download

Tags:

description

When OXID eSales decided in early 2008 to open source its then 5 years old ecommerce system, they knew that it needed to be refactored before releasing it to the public. The reason being that only a refactored system would allow for shorter release cycles and attract new developers due to higher code quality.

Transcript of Refactoring in PHP While Going Open Source. A Case Study

© 2009 OXID eSales

Refactoring in PHP While Going Open Source

A Case Study ..

OXID eSales AGBerlin, 26. June 2009

Erik KortChief Software Architect

© 2009 OXID eSales

OXID eSales AG

eCommerce Software… nothing else!

Located in Freiburg, Halle and Kaunas (Lithuania)

50+ employees… more than half PHP-Developers

© 2009 OXID eSales

About Me

Key facts

OXID eSales AG Chief Software Architect

15+ Years of experience in Software Development

Wide field:

– from Petrochemical industries to eCommerce– From mobile devices to large servers

Passion: Architecture and Object Oriented Design

© 2009 OXID eSales

OXID eShop 4 Open Source

what does this exactly mean?

OXID eShop Professional Edition is available also as OXID eShop Community Edition

Licensed under GPLv3

© 2009 OXID eSales

The Past

© 2009 OXID eSales

© 2009 OXID eSales

© 2009 OXID eSales

Module snap in

Multiple inheritance possible

Best prepared for extension due to small and atomic functions

Prepared for multilanguage usage

eShop Extensions

ES

EN

DE

© 2009 OXID eSales

Connecting OXID eShop

Various connectors to ERP already exist

– Microsoft Dynamics NAV– Büroware– SAP– Generic SOAP interface– Generic CSV interface– and many more

Also connectors to various CRM systems exist

– Drupal– Typo3– and many more

350+ third party extensions in existence

© 2009 OXID eSales

Time to change

© 2009 OXID eSales

XP – eXtreme Programming

© 2009 OXID eSales

eXtreme Programming in OXID

Iteration length: 1 week

Only useful elements of XP are taken (e.g. pair programming only if needed/wanted)

Iteration planning at the beginning of each week

Change of plans possible every time – even late in development process

Monitoring release by using burndown charts

Team velocity is constant

Leads to predictable schedules

– Release dates are fixed in advance and kept

© 2009 OXID eSales

Doing the XP - Goals

Porting to PHP 5

Common code base

Significantly improve quality of source code

Remove „Big Ball of Mudd“ elements

Reduce release efforts

Automatic build system

Measure code quality (code metrics)

© 2009 OXID eSales

Tools

© 2009 OXID eSales

Risks …

© 2009 OXID eSales

Lessons learned

© 2009 OXID eSales

Psychology ! – „the Gap“

© 2009 OXID eSales

Narural Cleaner Architecture

Model-View-Controller pattern (MVC)

© 2009 OXID eSales

Results

© 2009 OXID eSales

Memory consumption CE/PE

© 2009 OXID eSales

Memory consumption EE

© 2009 OXID eSales

Response Time CE/PE

© 2009 OXID eSales

Load

Scales well under high load

© 2009 OXID eSales

Performance under load

© 2009 OXID eSales

Unit tests

© 2009 OXID eSales

Source Code dispersion

© 2009 OXID eSales

Code coverage

© 2009 OXID eSales

Cyclomatic Complexity

© 2009 OXID eSales

If you are not developing with an agile methodology today, be warned.

It is not about deciding if you want it or not, only about when

Conclusion

© 2009 OXID eSales

Questions?

© 2009 OXID eSales

Press comments

„Der eShop überzeugt durch seinen schlanken Aufbau mit sehr guter Performance, ohne diese mit zu wenig Out-Of-The-Box-Funktionen oder mangelnder Erweiterbarkeit kompensieren zu müssen.“ t3n, 12/ 2008

Die Software überzeugt v.a. durch Usability auf Shop-nutzerseite.ix, 01/2009

„Der OXID eShop bringt von Haus aus alle für einen Online-Shop wichtigen Features mit: SEO URLs, Crossselling, Produktvarianten, beliebig verschachtelbare Kategorien, Mehrsprachigkeit, Web 2.0 Features etc.“„Wer ein flexibles Shop-System für höchste Ansprüche sucht, sollte sich den OXID eShop genauer ansehen.“PHP Journal 1/2009

© 2009 OXID eSales

Let‘s eCommerce…

Thank‘s for joining me!

Erik Kort (erik.kort@oxid-esales.com)

together!