SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
So gelingt der Umstieg von PHP4 auf
PHP5: Erneuerung von
Geschäftsanwendungen unter
Qualitätsaspekten
Lars Jankowfsky, CTO, swoodoo GmbH
Lars Jankowfsky?
• Software Architect, CTO seit 1992
• PHP seit 1998
• Viele erfolgreiche Projekte von 2 bis 20
  Entwickler.
• CTO and (Co)Founder swoodoo.com
• (Co)Founder of OXID eSales. Refactored
  OXID eShop during 1.5 years with 10
  developers.



Lars Jankowfsky, swoodoo.com
What about your projects?
- What‘s your average project lifetime?
- Is there PHP code more than 5 years old?
- How many lines of code?
- How many change requests per year?
- Has there been a specification?
- Were all features in the first released version
  implemented like they‘re specified in the
  specification?

Lars Jankowfsky, swoodoo.com
Legacy Code?

Wikipedia says „Legacy code is source code that
 relates to a no-longer supported or
 manufactured operating system or other
 computer technology. The term can also mean
 code inserted into modern software for the
 purpose of maintaining an older or previously
 supported feature“



Jankowfsky, Rinne – Mayflower/swoodoo
Why upgrade?
    • MySQL 4 support will end
       • Active support already ended by the end of 2006
       • Only extended support until 2008 for MySQL 4.0 and
         2009 for MySQL 4.1
       • MySQL 5 has more and advanced features like stored
         procedures, trigger, better SQL support
    • PHP 4 support did end
       • PHP 4 is dead, dead, dead
       • Only security relevant fixes until 2008-08-08
       • PHP 5.2 is faster and more stable than every PHP 4
         version
       • PHP 5.3 upcoming


Lars Jankowfsky, swoodoo.com
Why upgrade?
- change requests get more and more expensive
- bug rate is increasing
- clearly a dead-end street!
- team motivation decreases
- hard to bring in new members into the team
- deprecated functions cause problems in future
  PHP releases


Lars Jankowfsky, swoodoo.com
Typical problems?
- Typical legacy applications
- Started some years ago with PHP 4
- written in Spaghetti code
- half procedual, half object-orientated
- „PHP 4“ OOP
- using old, unmaintained libraries like PEAR::DB



Lars Jankowfsky, swoodoo.com
PHP, made in 2000
- no coding standards
- no PHPDoc
- no Design Patterns
- few separation of concerns
- has been changed a lot
- no refactoring, because „it worked“
- updated to run with php 4 in 2003
- updated to run with php 5 in ... ?
Lars Jankowfsky, swoodoo.com
PHP 4 OOP - strategy
- Maybe you‘re lucky and there are no problems.
  Maybe.
- If you see problems, they are fatal errors like
    - Objects are referenced by value
    - $foo =& new Foo();
- Solution:
    - Use standard APIs
    - Fix the PHP 5 problems


Lars Jankowfsky, swoodoo.com
„Half procedual –halb
                                object-orientated“
- Code with different quality
- Just a few documentation
- Maybe some tests ... maybe ...
- „the typical current PHP 4 project“
- Found everywhere! Really everywhere!




Lars Jankowfsky, swoodoo.com
„Half procedual –half object-
                              orientated“ - strategy

- Add inline documentation for all classes and
  methods
- Improve the re-using of duplicate code
- Improve every code part with PHP 5 functions,
   for example using file_put_contents()
   instead of fopen(), fwrite(), and
   fclose().



Lars Jankowfsky, swoodoo.com
Spaghetti Code?

  - Very old code, maybe developed in the last PHP 3 century
  - a lot of redundant copy-paste code
  - missing separation of concerns
  - No or just minor separation of code and layout
  - No use of libraries like PEAR, Zend Framework or eZ
    components
  - No or outdated documentation
  - No tests at all



Lars Jankowfsky, swoodoo.com
Spaghetti Code - strategy
- Identify recurring code parts and implement
   classes
- Use of standard libraries like Zend Framework
  or eZ components
- Add inline documentation
- Fix your coding styles!




Lars Jankowfsky, swoodoo.com
Requirements

- No new features
- No technical changes like new database layer
  or new template engine
- No influences for productive services like
  External systems
- Minimization of time and effort



Lars Jankowfsky, swoodoo.com
What you should never do!
Please don‘t try a complete rewrite!


- Too expensive
- Takes too long
- the old codebase is used, tested & bugfixed
- Developers love to rewrite:
  new code is more fun, code is easier to write
  than to read

Lars Jankowfsky, swoodoo.com
Remember?

    Netscape 6?                                Rewrite....


    dBase for Windows?                         Rewrite....



    Quattro Pro?                               Rewrite....



                                                    Access refatored...

                                                    Excel

Jankowfsky, Rinne – Mayflower/swoodoo
Porting


Lars Jankowfsky, swoodoo.com
What is porting?

                               Innovation potential




                                             ve
                                        iti
                                                             Rewrite



                                        s
                                     po
                                             Reengineering




                                                                        e
                                                                       tiv
                                                                 ga
                                                               ne
                                   Porting


                                                                        complexity



Lars Jankowfsky, swoodoo.com
What is porting?

            • Reasons
               • Most simple form of migration
               • Manageble risks
               • Small complexity because of the lack of
                 qualitive and technical changes
            • Requirement
               • Minor differences between current and future
                 application platform




Lars Jankowfsky, swoodoo.com
Refactoring



Lars Jankowfsky, swoodoo.com
Refactoring?
- Modifying code without changing it‘s behaviour
- „cleaning up“


     “Refactoring is the process of changing a software system
     in such a way that it does not alter the external behavior of
     the code yet improves its internal structure.” (Martin Fowler)




Lars Jankowfsky, swoodoo.com
Modifying without... ?????
- if you refactor you need tests to proove that
  you did not break any functionality
- Have tests first. Then change code.
- legacy code ? There are no tests!!




Lars Jankowfsky, swoodoo.com
And now ?
- Write tests first.
- You will need to refactor your application while
  writing tests.


                                    -   Write selenium tests for
                                        your application. - no :(




Lars Jankowfsky, swoodoo.com
Preparations
          • Targets
             • Porting without any technical or qualitative
                changes
             • Recovery of support (MySQL/PHP)
             • Minimizing the interferences of services and
                reduction of change times
          • Interferences
             • Porting problems between MySQL and PHP
                versions
             • Application complexity
             • missing documentation and missing contact
                persons
             • Communication between all team members

Lars Jankowfsky, swoodoo.com
Process model

- Reducing of complexity with a planned
  procedure
- Coverage of the complete porting
- Methodical description of the process




Lars Jankowfsky, swoodoo.com
How do we start?
- Identify the nastiest, ugliest and...
- probably most important piece of code and
  let‘s start with this one.
- if you take the easy files you won‘t solve the
  critical issues and...
- move the risk to the end.




Lars Jankowfsky, swoodoo.com
While porting ...
- adjust coding style
- add missing documentation
- remove redundant code / copy & paste-code
- remove unused(!) code
- maintain a list of future todos with priorities




Lars Jankowfsky, swoodoo.com
PHP and Unit Testing
- Layout & UI code is hard to unit-test,
  acceptance-test instead
- test maintenance costs:
  - unit test work fine with stable APIs
  - high change rate in PHP results in API changes
  - tests need to be changed, too
- slows down development, increases initial
  development costs
- ... but your software survives more than 4 years

Lars Jankowfsky, swoodoo.com
Test Driven Adoption
1. Unit tests for existing code with PHPUnit
2. experience of confidence in own code
3. Insight: Tests are easier if written before
  software
4. Insight: Tests help documenting the code
5. Insight: Tests define the real API




Lars Jankowfsky, swoodoo.com
Tools?
- CruiseControl for continous integration
    - PHPUnit
    - SeleniumRC and SeleniumIDE
    - PHP Code Sniffer
    - PHP CodeBrowser




Lars Jankowfsky, swoodoo.com
Golden rules
- know your budget: what are your maintenance
  costs? What are the things you can‘t do now?
- there is no silver bullet. It takes time.
- Confident developers are efficient developers
- There is no way around proper coding style and
  documentation




Lars Jankowfsky, swoodoo.com
Questions?




Lars Jankowfsky, swoodoo.com
Thank you for your interest!



              eMail: lars.jankowfsky@swoodoo.com




Lars Jankowfsky, swoodoo.com

Weitere ähnliche Inhalte

Andere mochten auch

TOITURE TERRASSE SUR SUPPORT BOIS
TOITURE TERRASSE SUR SUPPORT BOISTOITURE TERRASSE SUR SUPPORT BOIS
TOITURE TERRASSE SUR SUPPORT BOISgervais PIACENTINI
 
Le Progressiste n° 2122
Le Progressiste n° 2122Le Progressiste n° 2122
Le Progressiste n° 2122guest7b6b16
 
D:\Boletin Oficial-5 04 10
D:\Boletin Oficial-5 04 10D:\Boletin Oficial-5 04 10
D:\Boletin Oficial-5 04 10diluro
 
¿Cuál es el estado actual de las tic en la educación datos para reflexionar..
¿Cuál es el estado actual de las tic en la educación  datos para reflexionar..¿Cuál es el estado actual de las tic en la educación  datos para reflexionar..
¿Cuál es el estado actual de las tic en la educación datos para reflexionar..Juan Carlos Sánchez
 
Bloc info families curses 2015 (1)
Bloc info families curses 2015 (1)Bloc info families curses 2015 (1)
Bloc info families curses 2015 (1)coless
 
Pj Retail Solutionsonline
Pj Retail SolutionsonlinePj Retail Solutionsonline
Pj Retail Solutionsonlinepaulj17947
 
Prevención del riesgo de ictus cardioembólico
Prevención del riesgo de ictus cardioembólicoPrevención del riesgo de ictus cardioembólico
Prevención del riesgo de ictus cardioembólicoECGPersonal
 
Telos (107 Paginas)
Telos (107 Paginas)Telos (107 Paginas)
Telos (107 Paginas)guest7655e1
 
FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...
FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...
FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...Univention GmbH
 
Pautas para el trabajo.
Pautas para el trabajo.Pautas para el trabajo.
Pautas para el trabajo.ruthemartina
 
Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013
Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013
Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013Platts
 
IR Website Best Practices - April 30, 2009
IR Website Best Practices - April 30, 2009IR Website Best Practices - April 30, 2009
IR Website Best Practices - April 30, 2009Darrell Heaps
 
OI REALTOR EN IBIZA
OI REALTOR EN IBIZAOI REALTOR EN IBIZA
OI REALTOR EN IBIZAOI REALTOR
 
How To Get Paid Faster & Improve Cashflow
How To Get Paid Faster & Improve CashflowHow To Get Paid Faster & Improve Cashflow
How To Get Paid Faster & Improve CashflowChinwe Maureen Chidobem
 
Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...
Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...
Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...ESPAÑA PRECONCILIAR
 
Consenso brasileiro de psoríase 2009
Consenso brasileiro de psoríase   2009Consenso brasileiro de psoríase   2009
Consenso brasileiro de psoríase 2009Arquivo-FClinico
 
Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)
Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)
Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)Riccardo Guidetti
 
Trabajo final yehizzy riscardo
Trabajo final   yehizzy riscardoTrabajo final   yehizzy riscardo
Trabajo final yehizzy riscardoRiscardo Pitti
 

Andere mochten auch (20)

TOITURE TERRASSE SUR SUPPORT BOIS
TOITURE TERRASSE SUR SUPPORT BOISTOITURE TERRASSE SUR SUPPORT BOIS
TOITURE TERRASSE SUR SUPPORT BOIS
 
IMÀGENES DE MOSAICO
IMÀGENES DE MOSAICOIMÀGENES DE MOSAICO
IMÀGENES DE MOSAICO
 
Le Progressiste n° 2122
Le Progressiste n° 2122Le Progressiste n° 2122
Le Progressiste n° 2122
 
D:\Boletin Oficial-5 04 10
D:\Boletin Oficial-5 04 10D:\Boletin Oficial-5 04 10
D:\Boletin Oficial-5 04 10
 
Dossier fm
Dossier fmDossier fm
Dossier fm
 
¿Cuál es el estado actual de las tic en la educación datos para reflexionar..
¿Cuál es el estado actual de las tic en la educación  datos para reflexionar..¿Cuál es el estado actual de las tic en la educación  datos para reflexionar..
¿Cuál es el estado actual de las tic en la educación datos para reflexionar..
 
Bloc info families curses 2015 (1)
Bloc info families curses 2015 (1)Bloc info families curses 2015 (1)
Bloc info families curses 2015 (1)
 
Pj Retail Solutionsonline
Pj Retail SolutionsonlinePj Retail Solutionsonline
Pj Retail Solutionsonline
 
Prevención del riesgo de ictus cardioembólico
Prevención del riesgo de ictus cardioembólicoPrevención del riesgo de ictus cardioembólico
Prevención del riesgo de ictus cardioembólico
 
Telos (107 Paginas)
Telos (107 Paginas)Telos (107 Paginas)
Telos (107 Paginas)
 
FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...
FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...
FileWave in 5 Minuten - Softwareverteilung, Inventarisierung, Update-Manageme...
 
Pautas para el trabajo.
Pautas para el trabajo.Pautas para el trabajo.
Pautas para el trabajo.
 
Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013
Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013
Shale Gas, Crude and Their Impact on Global Petrochemicals - December 2013
 
IR Website Best Practices - April 30, 2009
IR Website Best Practices - April 30, 2009IR Website Best Practices - April 30, 2009
IR Website Best Practices - April 30, 2009
 
OI REALTOR EN IBIZA
OI REALTOR EN IBIZAOI REALTOR EN IBIZA
OI REALTOR EN IBIZA
 
How To Get Paid Faster & Improve Cashflow
How To Get Paid Faster & Improve CashflowHow To Get Paid Faster & Improve Cashflow
How To Get Paid Faster & Improve Cashflow
 
Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...
Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...
Cronologia de la Iglesia (II): Reyes Catolicos, Austrias, Borbones, Liberalis...
 
Consenso brasileiro de psoríase 2009
Consenso brasileiro de psoríase   2009Consenso brasileiro de psoríase   2009
Consenso brasileiro de psoríase 2009
 
Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)
Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)
Van Gogh: l'entusiamo che nasce dall'attrattiva delle cose (28 marzo 2012)
 
Trabajo final yehizzy riscardo
Trabajo final   yehizzy riscardoTrabajo final   yehizzy riscardo
Trabajo final yehizzy riscardo
 

Ähnlich wie So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendungen unter Qualitätsaspekten

Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
Os Koziarsky
Os KoziarskyOs Koziarsky
Os Koziarskyoscon2007
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Ivo Jansch
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Ivo Jansch
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseOSSCube
 
PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...
PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...
PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...Codemotion
 
PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolAlessandro Cinelli (cirpo)
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
Why Architecture in Web Development matters
Why Architecture in Web Development mattersWhy Architecture in Web Development matters
Why Architecture in Web Development mattersLars Jankowfsky
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 
Web APIs, the New Language Frontier
Web APIs, the New Language FrontierWeb APIs, the New Language Frontier
Web APIs, the New Language FrontierRestlet
 
Web APIs, the New Language Frontier
Web APIs, the New Language FrontierWeb APIs, the New Language Frontier
Web APIs, the New Language FrontierJerome Louvel
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-stepMichelangelo van Dam
 
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...andreaslubbe
 
Os Paesdosreistutorial
Os PaesdosreistutorialOs Paesdosreistutorial
Os Paesdosreistutorialoscon2007
 
ruote stockholm 2008
ruote stockholm 2008ruote stockholm 2008
ruote stockholm 2008John Mettraux
 
Php Inspections (EA Extended): realtime static code analysis
Php Inspections (EA Extended): realtime static code analysisPhp Inspections (EA Extended): realtime static code analysis
Php Inspections (EA Extended): realtime static code analysisVladimir Reznichenko
 

Ähnlich wie So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendungen unter Qualitätsaspekten (20)

Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
Os Koziarsky
Os KoziarskyOs Koziarsky
Os Koziarsky
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
C# 4.0 - Whats New
C# 4.0 - Whats NewC# 4.0 - Whats New
C# 4.0 - Whats New
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for Eclipse
 
PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...
PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...
PHP is the king, nodejs is the prince and Python is the fool - Alessandro Cin...
 
PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the fool
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Why Architecture in Web Development matters
Why Architecture in Web Development mattersWhy Architecture in Web Development matters
Why Architecture in Web Development matters
 
Symfony for non-techies
Symfony for non-techiesSymfony for non-techies
Symfony for non-techies
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 
The Power of Refactoring
The Power of RefactoringThe Power of Refactoring
The Power of Refactoring
 
Web APIs, the New Language Frontier
Web APIs, the New Language FrontierWeb APIs, the New Language Frontier
Web APIs, the New Language Frontier
 
Web APIs, the New Language Frontier
Web APIs, the New Language FrontierWeb APIs, the New Language Frontier
Web APIs, the New Language Frontier
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-step
 
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
 
Os Paesdosreistutorial
Os PaesdosreistutorialOs Paesdosreistutorial
Os Paesdosreistutorial
 
ruote stockholm 2008
ruote stockholm 2008ruote stockholm 2008
ruote stockholm 2008
 
Php Inspections (EA Extended): realtime static code analysis
Php Inspections (EA Extended): realtime static code analysisPhp Inspections (EA Extended): realtime static code analysis
Php Inspections (EA Extended): realtime static code analysis
 

Mehr von Lars Jankowfsky

Caching, sharding, distributing - Scaling best practices
Caching, sharding, distributing - Scaling best practicesCaching, sharding, distributing - Scaling best practices
Caching, sharding, distributing - Scaling best practicesLars Jankowfsky
 
Agile Development with PHP in Practice
Agile Development with PHP in PracticeAgile Development with PHP in Practice
Agile Development with PHP in PracticeLars Jankowfsky
 
Agile Entwicklung OXID Commons
Agile Entwicklung OXID CommonsAgile Entwicklung OXID Commons
Agile Entwicklung OXID CommonsLars Jankowfsky
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture MattersLars Jankowfsky
 
Monitor Your Business V2
Monitor Your Business V2Monitor Your Business V2
Monitor Your Business V2Lars Jankowfsky
 
Agile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei GeschäftsanwendungenAgile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei GeschäftsanwendungenLars Jankowfsky
 

Mehr von Lars Jankowfsky (8)

Caching, sharding, distributing - Scaling best practices
Caching, sharding, distributing - Scaling best practicesCaching, sharding, distributing - Scaling best practices
Caching, sharding, distributing - Scaling best practices
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Agile Development with PHP in Practice
Agile Development with PHP in PracticeAgile Development with PHP in Practice
Agile Development with PHP in Practice
 
Agile Entwicklung OXID Commons
Agile Entwicklung OXID CommonsAgile Entwicklung OXID Commons
Agile Entwicklung OXID Commons
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture Matters
 
Monitor Your Business V2
Monitor Your Business V2Monitor Your Business V2
Monitor Your Business V2
 
Monitor Your Business
Monitor Your BusinessMonitor Your Business
Monitor Your Business
 
Agile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei GeschäftsanwendungenAgile Softwareentwicklung Bei Geschäftsanwendungen
Agile Softwareentwicklung Bei Geschäftsanwendungen
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendungen unter Qualitätsaspekten

  • 1. So gelingt der Umstieg von PHP4 auf PHP5: Erneuerung von Geschäftsanwendungen unter Qualitätsaspekten Lars Jankowfsky, CTO, swoodoo GmbH
  • 2. Lars Jankowfsky? • Software Architect, CTO seit 1992 • PHP seit 1998 • Viele erfolgreiche Projekte von 2 bis 20 Entwickler. • CTO and (Co)Founder swoodoo.com • (Co)Founder of OXID eSales. Refactored OXID eShop during 1.5 years with 10 developers. Lars Jankowfsky, swoodoo.com
  • 3. What about your projects? - What‘s your average project lifetime? - Is there PHP code more than 5 years old? - How many lines of code? - How many change requests per year? - Has there been a specification? - Were all features in the first released version implemented like they‘re specified in the specification? Lars Jankowfsky, swoodoo.com
  • 4. Legacy Code? Wikipedia says „Legacy code is source code that relates to a no-longer supported or manufactured operating system or other computer technology. The term can also mean code inserted into modern software for the purpose of maintaining an older or previously supported feature“ Jankowfsky, Rinne – Mayflower/swoodoo
  • 5. Why upgrade? • MySQL 4 support will end • Active support already ended by the end of 2006 • Only extended support until 2008 for MySQL 4.0 and 2009 for MySQL 4.1 • MySQL 5 has more and advanced features like stored procedures, trigger, better SQL support • PHP 4 support did end • PHP 4 is dead, dead, dead • Only security relevant fixes until 2008-08-08 • PHP 5.2 is faster and more stable than every PHP 4 version • PHP 5.3 upcoming Lars Jankowfsky, swoodoo.com
  • 6. Why upgrade? - change requests get more and more expensive - bug rate is increasing - clearly a dead-end street! - team motivation decreases - hard to bring in new members into the team - deprecated functions cause problems in future PHP releases Lars Jankowfsky, swoodoo.com
  • 7. Typical problems? - Typical legacy applications - Started some years ago with PHP 4 - written in Spaghetti code - half procedual, half object-orientated - „PHP 4“ OOP - using old, unmaintained libraries like PEAR::DB Lars Jankowfsky, swoodoo.com
  • 8. PHP, made in 2000 - no coding standards - no PHPDoc - no Design Patterns - few separation of concerns - has been changed a lot - no refactoring, because „it worked“ - updated to run with php 4 in 2003 - updated to run with php 5 in ... ? Lars Jankowfsky, swoodoo.com
  • 9. PHP 4 OOP - strategy - Maybe you‘re lucky and there are no problems. Maybe. - If you see problems, they are fatal errors like - Objects are referenced by value - $foo =& new Foo(); - Solution: - Use standard APIs - Fix the PHP 5 problems Lars Jankowfsky, swoodoo.com
  • 10. „Half procedual –halb object-orientated“ - Code with different quality - Just a few documentation - Maybe some tests ... maybe ... - „the typical current PHP 4 project“ - Found everywhere! Really everywhere! Lars Jankowfsky, swoodoo.com
  • 11. „Half procedual –half object- orientated“ - strategy - Add inline documentation for all classes and methods - Improve the re-using of duplicate code - Improve every code part with PHP 5 functions, for example using file_put_contents() instead of fopen(), fwrite(), and fclose(). Lars Jankowfsky, swoodoo.com
  • 12. Spaghetti Code? - Very old code, maybe developed in the last PHP 3 century - a lot of redundant copy-paste code - missing separation of concerns - No or just minor separation of code and layout - No use of libraries like PEAR, Zend Framework or eZ components - No or outdated documentation - No tests at all Lars Jankowfsky, swoodoo.com
  • 13. Spaghetti Code - strategy - Identify recurring code parts and implement classes - Use of standard libraries like Zend Framework or eZ components - Add inline documentation - Fix your coding styles! Lars Jankowfsky, swoodoo.com
  • 14. Requirements - No new features - No technical changes like new database layer or new template engine - No influences for productive services like External systems - Minimization of time and effort Lars Jankowfsky, swoodoo.com
  • 15. What you should never do! Please don‘t try a complete rewrite! - Too expensive - Takes too long - the old codebase is used, tested & bugfixed - Developers love to rewrite: new code is more fun, code is easier to write than to read Lars Jankowfsky, swoodoo.com
  • 16. Remember? Netscape 6? Rewrite.... dBase for Windows? Rewrite.... Quattro Pro? Rewrite.... Access refatored... Excel Jankowfsky, Rinne – Mayflower/swoodoo
  • 18. What is porting? Innovation potential ve iti Rewrite s po Reengineering e tiv ga ne Porting complexity Lars Jankowfsky, swoodoo.com
  • 19. What is porting? • Reasons • Most simple form of migration • Manageble risks • Small complexity because of the lack of qualitive and technical changes • Requirement • Minor differences between current and future application platform Lars Jankowfsky, swoodoo.com
  • 21. Refactoring? - Modifying code without changing it‘s behaviour - „cleaning up“ “Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure.” (Martin Fowler) Lars Jankowfsky, swoodoo.com
  • 22. Modifying without... ????? - if you refactor you need tests to proove that you did not break any functionality - Have tests first. Then change code. - legacy code ? There are no tests!! Lars Jankowfsky, swoodoo.com
  • 23. And now ? - Write tests first. - You will need to refactor your application while writing tests. - Write selenium tests for your application. - no :( Lars Jankowfsky, swoodoo.com
  • 24. Preparations • Targets • Porting without any technical or qualitative changes • Recovery of support (MySQL/PHP) • Minimizing the interferences of services and reduction of change times • Interferences • Porting problems between MySQL and PHP versions • Application complexity • missing documentation and missing contact persons • Communication between all team members Lars Jankowfsky, swoodoo.com
  • 25. Process model - Reducing of complexity with a planned procedure - Coverage of the complete porting - Methodical description of the process Lars Jankowfsky, swoodoo.com
  • 26. How do we start? - Identify the nastiest, ugliest and... - probably most important piece of code and let‘s start with this one. - if you take the easy files you won‘t solve the critical issues and... - move the risk to the end. Lars Jankowfsky, swoodoo.com
  • 27. While porting ... - adjust coding style - add missing documentation - remove redundant code / copy & paste-code - remove unused(!) code - maintain a list of future todos with priorities Lars Jankowfsky, swoodoo.com
  • 28. PHP and Unit Testing - Layout & UI code is hard to unit-test, acceptance-test instead - test maintenance costs: - unit test work fine with stable APIs - high change rate in PHP results in API changes - tests need to be changed, too - slows down development, increases initial development costs - ... but your software survives more than 4 years Lars Jankowfsky, swoodoo.com
  • 29. Test Driven Adoption 1. Unit tests for existing code with PHPUnit 2. experience of confidence in own code 3. Insight: Tests are easier if written before software 4. Insight: Tests help documenting the code 5. Insight: Tests define the real API Lars Jankowfsky, swoodoo.com
  • 30. Tools? - CruiseControl for continous integration - PHPUnit - SeleniumRC and SeleniumIDE - PHP Code Sniffer - PHP CodeBrowser Lars Jankowfsky, swoodoo.com
  • 31. Golden rules - know your budget: what are your maintenance costs? What are the things you can‘t do now? - there is no silver bullet. It takes time. - Confident developers are efficient developers - There is no way around proper coding style and documentation Lars Jankowfsky, swoodoo.com
  • 33. Thank you for your interest! eMail: lars.jankowfsky@swoodoo.com Lars Jankowfsky, swoodoo.com