SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Podróż w krainę
                    Continuous Integration




Sebastian Marek, Software Architect
@proofek

 10 lat doświadczenia w
  PHP
 współautor 2 książek o
  tematyce PHP
 zwolennik automatyzacji
  procesów
 TDD i CI
Dawno dawno temu
U stóp Góry Przeznaczenia

              coraz dłuższy czas
               utrzymania
              wzrastająca liczba
               problemów
              mało zrozumiały i mało
               przejrzysty kod
              skomplikowane i
               czasochłonne testowanie
Szukanie pomocy!
Pierwsze frustracje

   sporadyczne “buildy”
   mieszanka php3 i php4
   nauka w locie
   brak standardów
Tworzenie drużyny

   Stuart Grimshaw
   Simon Westcott
   Ben Selby
   Sebastian Marek
   Rowan Merewood
   Ben Longden
Zwołanie rady

                                      Kto?
                                       menadżerowie
                                       programiści

                                      O czym?
                                       zagrożenia
                                       szanse
                                       plan
                                       wdrożenie



http://www.flickr.com/photos/pedromourapinheiro/3272323691/in/photostream/
Jak nie wiadomo o co chodzi
                    to chodzi o pieniądze

 Design debt
 Karne opłaty
 Odsetki




   http://www.flickr.com/photos/your_teacher/1040476355/in/photostream/
Najlepsze rozwiązanie




          VS.
Wsparcie i plan rozwoju




http://www.flickr.com/photos/jannem/3312115991/in/photostream/
Raporty i statystyki




http://www.flickr.com/photos/aussiegall/286709039/in/photostream/
Łączenie sił z mocniejszymi sojusznikami
Automatyzacja




http://www.flickr.com/photos/matthileo/3552898254/in/photostream/
Front wschodni
Zautomatyzowane buildy

 wtyczka do Cruisecontrol
 wsparcie dla PHPUnit
 Intergracja z
  phpDocumentor
 generowanie statystyk
  kodu
 Raport code coverage
 Integracja z raportem
  checkstyle
 Integracja z PHP Depend
 Integracja z PHPMD
 i wiele wiele więcej
PHPUnit

Najpopularniejsze narzędzie do unit testów oparte na
standardzie xUnit, ze wsparciem dla:
 mock obiektów
 testów bazodanowych (dbUnit)
 raportów “code coverage”
 selenium RC
 platform continuous integration, takich jak CruiseControl,
   Hudson, Bamboo
phpDocumentor

        zautomatyzowane
         tworzenie dokumentacji
         dla PHP
        wsparcie dla: HTML,
         PDF, CHM, XML
        interfejs CLI i poprzez
         przeglądarkę internetową
        łatwo konfigurowalny
PHP_Codesniffer

 Oparty na predefiniowanych standardach kodowania
 Wykrywa niezgodności ze standardami kodowania
 W pełni konfigurowalny z możliwością definiowania
  własnych standardów
 Codebrowser
Raport “code coverage”

   Świadomość ilości przetestowanego kodu
   Procentowe przedstawienie pokrycia kodu testami
   Konfigurowalne przedziały akceptowalności
   Format clover
   Format HTML
Statystyki - PHP Depend

Statystyki:
 Cyclomatic Complexity
 NPath Complexity
 CodeRank
 Lines Of Code
PHP Mess Detector

         Inteligentna analiza kodu:
          Potencjalne problemy
          Niezoptymalizowany kod
          Zbyt skomplikowane
            operacje
          Nieużywane parametry,
            metody, właściwości
phpUnderControl
Buildbox na co dzień

   Rosnąca ilość nowych modułów
   Wydłużony czas budowania
   Częste zawieszenia
   Problemy ze stabilnością
   Problemy ze sprzętem
Potrzeba udoskonalenia
Hudson/Jenkins – następny krok

   Łatwa instalacja
   Łatwa konfiguracja
   Wsparcie dla wtyczek
   Rozproszone “buildy”
   Internacjonalizacja
Hudson/Jenkins
Selenium

     Automatyczne testy
      aplikacji internetowych
Władca pierścieni




http://www.flickr.com/photos/cosmic_bandita/2218419160/in/photostream/
Front zachodni
Sonar
Sonar

 Platforma do zarządzania
  jakością kodu
 Nieustanna analiza kodu
 Łatwy w konfiguracji
 Wsparcie dla wtyczek
Raporty dostępne dla wszystkich

 Łatwo zrozumiałe raporty i statystyki
 Definicja celów
 Odpowiedzialność
Widok typu radiator
Raporty
Raporty
Raporty
Raporty
Raporty
Armia musi podążać za przywódcą

   Idź za przykładem
   Bądź stanowczy, ale jednocześnie przyjazny i pomocny
   Szkolenia
   Proste i zrozumiałe reguły/standardy
   Kij i marchewka
You broke the build!
Where's the build?
Works on my machine?!
Czas na ciebie!
Podsumowanie

1. Rozpoznanie
2. Próba
3. Odpowiedni zespół
4. Powoli, małymi krokami
5. Bądź widoczny
6. Automatyzacja
Źródła

   PHPUnit - http://www.phpunit.de/
   phpUnderControl - http://phpundercontrol.org/
   Jenkins - http://jenkins-ci.org/
   Sonar - http://www.sonarsource.org/
   phpDocumentor - http://www.phpdoc.org/
   PHP_CodeSniffer -
    http://pear.php.net/package/PHP_CodeSniffer/
   PHP Depend - http://pdepend.org/
   PHP Mess Detector - http://phpmd.org/
   Selenium - http://seleniumhq.org/
   xDebug - http://www.xdebug.org/
Pytania




 Pytania?

http://joind.in/3199

Contenu connexe

Plus de Sebastian Marek

Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceSebastian Marek
 
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practicePHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practiceSebastian Marek
 
Ten Commandments Of A Software Engineer
Ten Commandments Of A Software EngineerTen Commandments Of A Software Engineer
Ten Commandments Of A Software EngineerSebastian Marek
 
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice Sebastian Marek
 
Magic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practiceMagic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practiceSebastian Marek
 
Back to basics - PHPUnit
Back to basics - PHPUnitBack to basics - PHPUnit
Back to basics - PHPUnitSebastian Marek
 
Back to basics - PHP_Codesniffer
Back to basics - PHP_CodesnifferBack to basics - PHP_Codesniffer
Back to basics - PHP_CodesnifferSebastian Marek
 
Sonar - the ring to rule them all
Sonar - the ring to rule them allSonar - the ring to rule them all
Sonar - the ring to rule them allSebastian Marek
 
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking Sebastian Marek
 

Plus de Sebastian Marek (11)

Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practice
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practicePHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
 
Ten Commandments Of A Software Engineer
Ten Commandments Of A Software EngineerTen Commandments Of A Software Engineer
Ten Commandments Of A Software Engineer
 
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
 
Magic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practiceMagic behind the numbers - software metrics in practice
Magic behind the numbers - software metrics in practice
 
Back to basics - PHPUnit
Back to basics - PHPUnitBack to basics - PHPUnit
Back to basics - PHPUnit
 
Back to basics - PHP_Codesniffer
Back to basics - PHP_CodesnifferBack to basics - PHP_Codesniffer
Back to basics - PHP_Codesniffer
 
Sonar - the ring to rule them all
Sonar - the ring to rule them allSonar - the ring to rule them all
Sonar - the ring to rule them all
 
vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking vfsStream - effective filesystem mocking
vfsStream - effective filesystem mocking
 

Podróż w krainę Continuous Integration