Over the past two years we’ve been pushing to improve our automated testing practices within Plusnet and to win full support for it within the company across the spectrum of fellow developers, project managers and upper management. It took a while to agree on software we want to use, and standards we want to follow, but now all new code is being continuously built and tested and the results of that are visible business-wide. We use PHP_CodeSniffer to verify that we follow our coding standards, PHPDocumentor to generate automated API documentation, PHPUnit to run test suites and phpUnderControl to run all these tools regulary, at least once a day and to generate aggregated reports. Finally, Sonar allows us to create and publish reports visible to everybody and more importantly reports that everybody can understand. Setting it all up can be a tough exercise, but if you prepare to it upfront you might actually find it quite exciting! So, you strongly believe this is the way you should be developing your code, but you don’t really know where to start? Let me show you how our journey began. You don’t know how to convince your fellow developers to follow you? I’ll tell you how to establish a strong team that will follow you. Your managers seem to be more interested in delivering your project on time and don’t really see a point in spending additional time on unit testing and documenting your code? Maybe you haven’t shown them the benefits of continuous integration in a way they can understand. I’ll show you what worked for us.
4. 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
6. Pierwsze frustracje
sporadyczne “buildy”
mieszanka php3 i php4
nauka w locie
brak standardów
7. Tworzenie drużyny
Stuart Grimshaw
Simon Westcott
Ben Selby
Sebastian Marek
Rowan Merewood
Ben Longden
8. 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/
9. 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/
16. 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
17. 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
18. phpDocumentor
zautomatyzowane
tworzenie dokumentacji
dla PHP
wsparcie dla: HTML,
PDF, CHM, XML
interfejs CLI i poprzez
przeglądarkę internetową
łatwo konfigurowalny
19. 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
20. Raport “code coverage”
Świadomość ilości przetestowanego kodu
Procentowe przedstawienie pokrycia kodu testami
Konfigurowalne przedziały akceptowalności
Format clover
Format HTML
24. 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
40. 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