Ein paar Worte über uns● Projekt-und Consultinghaus im Bereich Internet/Intranet und Mobile Lösungen
● Gegründet Mitte 2001 in München ● 5 Gründer / Gesellschafter mit großer Erfahrung in der Software-Entwicklung
● Insgesamt 9 Mitarbeiter
Services● Komplette Projektdurchführung
➢ vor Ort➢ bei uns im Büro
● Einführung von Entwicklungsprozess und -methodik
● Einführung von TDD und Testautomatisierung
Agil bleiben mit
Tests und gutem DesignReferent: David Völkel
http://commons.wikimedia.org/wiki/File:Ninja_The_Last_Thing_You_See.jpg
Agilität
http://commons.wikimedia.org/wiki/File:Ninja_The_Last_Thing_You_See.jpg
Tests
http://commons.wikimedia.org/wiki/File:SPS49_maintenance.jpg
Automatisierte Testshttp://commons.wikimedia.org/wiki/File:SPS49_maintenance.jpg
http://commons.wikimedia.org/wiki/File:Science_museum_025_adjusted.jpg
schlechtes DESIGN
Agilität
http://commons.wikimedia.org/wiki/File:Policedog01.JPG
DesignAgilität braucht gutes
CodeTest
http://commons.wikimedia.org/wiki/File:Design_MAP_Expo1.jpg
* Test Driven* Testbares CodeDesign * Testdesign
TestartenTestLayers
* Angst vor Testen?
Überblick
Test Driven historisch
Keine Tests
http://commons.wikimedia.org/wiki/File:Bundesarchiv_Bild_194066520,_Burg_Liebenzell,_Arbeits_und_Ferienlager.jpg
Keine Tests
http://commons.wikimedia.org/wiki/File:Bundesarchiv_Bild_194066520,_Burg_Liebenzell,_Arbeits_und_Ferienlager.jpg
Kent Beck:“Software features that can't be demonstrated by automated tests simply don't exist”
test last
System
Test
http://commons.wikimedia.org/wiki/File:US_Navy_050119N7833F002_Aviation_Ordnanceman_Airman_Jennifer_Chacon,_left,_and_Aviation_Ordnanceman_Airman_Travis_Albertson,_go_over_the_or
dnance_verification_checklist_on_an_FA18F_Super_Hornet.jpg
test last
SUT
TestZweck: Verifikation
http://commons.wikimedia.org/wiki/File:US_Navy_050119N7833F002_Aviation_Ordnanceman_Airman_Jennifer_Chacon,_left,_and_Aviation_Ordnanceman_Airman_Travis_Albertson,_go_over_the_or
dnance_verification_checklist_on_an_FA18F_Super_Hornet.jpg
o
SUT
TestTest DRIVEN Development
Test FIRST
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
SUT
* “Behavior“ statt “Test“* „TDD done right“
Behavior DRIVEN Development
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
Test
SUT
* „TDD done right“* “Behavior“ statt “Test“
Behavior DRIVEN Development
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
Ausführbare Spezifikation von Verhalten
Design
TestTest DRIVEN Design
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
Design
TestTest DRIVEN Design
* Codetestbarkeit
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
Design
TestTest DRIVEN Design
Feedback auf* Code
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
Design
TestTest DRIVEN Design
Feedback auf* Code* Tests
http://commons.wikimedia.org/wiki/File:Bluebird_land_speed_record_car_1935_rc10413.jpg
write failing test
Test DRIVEN DESIGN
make diagnostics clearwrite failing test
make the test passrefactor
Nach Freeman, Price 2010
Sicherheit durch Redundanz
http://commons.wikimedia.org/wiki/File:PCNetzteil_%28redundant%29.jpg
Sicherheit durch Redundanz
http://commons.wikimedia.org/wiki/File:PCNetzteil_%28redundant%29.jpg
Uncle Bobs Kommentar zu BDDhttp://blog.objectmentor.com/articles/2008/11/27/thetruthaboutbdd
Kommentar dazu von Sebastian Kübeck... when we do TDD (or BDD), we are programming the system twice. Once declarative and once algorithmic... If have a complete set of requirements for a system, you have already programmed it... Maybe that closes the circle to Frederick Brooks when he says that we program things twice anyway. So instead of throwing one away, we are creating two in parallel verifying each other when we practice TDD (or BDD).
Sicherheit durch Redundanz
http://commons.wikimedia.org/wiki/File:PCNetzteil_%28redundant%29.jpg
CodeTest
2x ●* Problem ●* Sprache●
●* deklarativ●* beispielhaft
●* algorithmisch
Sicherheit durch Redundanz
http://commons.wikimedia.org/wiki/File:PCNetzteil_%28redundant%29.jpg
CodeTest
2x ●* Problem ●* Sprache●* Personen
●* deklarativ●* beispielhaft
●* algorithmisch
Testbares Code Design
hard to test codeantipattern
http://commons.wikimedia.org/wiki/File:Pit_crew_Hudson_Valley.JPG
design for testablility
http://commons.wikimedia.org/wiki/File:CarService.JPG
Clean Code Robert C. Martin
Clean Code Developerhttp://cleancodedeveloper.de/
Komplexitäthttp://commons.wikimedia.org/wiki/File:Machineshopr.jpg
http://commons.wikimedia.org/wiki/File:Divideandconquer.jpg
Separation of Concernshttp://commons.wikimedia.org/wiki/File:Divideandconquer.jpg
OO
Abstraktion
SRP Kapselung
layerstechnisch /
fachlich
http://commons.wikimedia.org/wiki/File:13_The_Partitions_Manage_Design_Complexity.jpg
Abhängigkeiten
http://commons.wikimedia.org/wiki/File:Cigarette_smoke.jpg
AbhängigkeitenZu wenig: DRY
http://commons.wikimedia.org/wiki/File:Cigarette_smoke.jpg
Abhängigkeiten
Dependency Inversion Principle
interfaces
Zu wenig: DRY
http://commons.wikimedia.org/wiki/File:Cigarette_smoke.jpg
Abhängigkeiten
Dependency Inversion Principle
evil static
KontextfreiheitDependency Injection
interfaces
Zu wenig: DRY
http://commons.wikimedia.org/wiki/File:Cigarette_smoke.jpg
Abhängigkeiten
Dependency Inversion Principle
KontextfreiheitDependency Injection
interfaces
Tell, don't ask
Information Hiding
Zu wenig: DRY
http://commons.wikimedia.org/wiki/File:Cigarette_smoke.jpg
evil static
http://commons.wikimedia.org/wiki/File:Ann_dependency_graph.png
Unnötige Abhängigkeiten auflösen
* Zyklen* fachlich* technisch
http://commons.wikimedia.org/wiki/File:Ann_dependency_graph.png
Test Design
FokusSRP
http://commons.wikimedia.org/wiki/File:Crossroads.jpg
Separation of ConcernsWelcher Test wohin?
http://commons.wikimedia.org/wiki/File:Color_Separation_Prism.jpg
Testart
Separation of ConcernsWelcher Test wohin?
http://commons.wikimedia.org/wiki/File:Color_Separation_Prism.jpg
Testart
Fachlichkeit
Separation of ConcernsWelcher Test wohin?
http://commons.wikimedia.org/wiki/File:Color_Separation_Prism.jpg
Testart
Fachlichkeit
DauerSeparation of Concerns
Welcher Test wohin?
http://commons.wikimedia.org/wiki/File:Color_Separation_Prism.jpg
Unit Tests
http://commons.wikimedia.org/wiki/File:Map_highlighting_Divide_Township,_Buffalo_County,_Nebraska.svg
Unit Tests
Unit?
http://commons.wikimedia.org/wiki/File:Map_highlighting_Divide_Township,_Buffalo_County,_Nebraska.svg
Unit Tests
Test DoublesUnit?
http://commons.wikimedia.org/wiki/File:Map_highlighting_Divide_Township,_Buffalo_County,_Nebraska.svg
Unit Tests
Für Entwickler
Unit? Test Doubles
http://commons.wikimedia.org/wiki/File:Map_highlighting_Divide_Township,_Buffalo_County,_Nebraska.svg
Test Doubles
http://commons.wikimedia.org/wiki/File:Dummy_of_a_police_car.jpg
Test Doubles
Abhängigkeiten
http://commons.wikimedia.org/wiki/File:Dummy_of_a_police_car.jpg
Test Doubles
Granularitäten* mock objects* mock adapter* mock services
http://commons.wikimedia.org/wiki/File:Dummy_of_a_police_car.jpg
“mocks aren't stubs“
“mocks aren't stubs“
* dummy, stub* test spy* mock* fake object
Test Doubles
Mocking in Java* EasyMock* JMock* Mockito
Integrationstests
http://commons.wikimedia.org/wiki/File:Scotland__England_Border.jpg
Integrationstests
wir3rd Party * Service * Lib
http://commons.wikimedia.org/wiki/File:Scotland__England_Border.jpg
Integrationstests
wir3rd Party * Service * Lib
Adapter
http://commons.wikimedia.org/wiki/File:Scotland__England_Border.jpg
Integrationstests
wir3rd Party * Service * Lib
Adapter
learning tests
http://commons.wikimedia.org/wiki/File:Scotland__England_Border.jpg
Integrationstests
wir3rd Party * Service * Lib
AdapterMock
Tests
http://commons.wikimedia.org/wiki/File:Scotland__England_Border.jpg
Akzeptanz Tests
http://commons.wikimedia.org/wiki/File:Technology.jpg
Akzeptanz Tests
Kunde
http://commons.wikimedia.org/wiki/File:Technology.jpg
Akzeptanz Tests
Spezifikation* Fachlich * ausführbar?
Kunde
http://commons.wikimedia.org/wiki/File:Technology.jpg
Akzeptanz Tests
Spezifikation
Verifikation
* Fachlich* ausführbar?
* EndtoEnd* 3rdparty services?* Fortschritt vs. Regression
Kunde
http://commons.wikimedia.org/wiki/File:Technology.jpg
make the test pass
refactor
write failing UNIT TEST
write failing ACCEPTANCE TEST
N x
OUTSIDE INFeature / Need Driven => kein YAGNI!
SUTimplement
Legacy
http://commons.wikimedia.org/wiki/File:Kopalnia_Wieczorek_rozbite_okna_12.08.jpg?uselang=de
Legacy„Testifizierung“ von außen nach innen
http://commons.wikimedia.org/wiki/File:Kopalnia_Wieczorek_rozbite_okna_12.08.jpg?uselang=de
LAYERINGLAYERINGjetzt auch für Tests ...
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
technical activity
nach http://gojko.net/2010/04/13/howtoimplementuitestingwithoutshootingyourselfinthefoot2/http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
technical activity
nach http://gojko.net/2010/04/13/howtoimplementuitestingwithoutshootingyourselfinthefoot2/
clarity
stability
für Akzeptanztest
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
JMeter
JMeterSkripten technicalHTTP
für Akzeptanztest
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
HTMLHTMLUnit/Selenium technical
Webtests
für Akzeptanztest
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
HTMLHTMLUnit/Selenium technical
Fachliche Tests
HTMLUnit/Selenium
Fach GUI Mapping→
für Akzeptanztest
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
HTMLHTMLUnit/Selenium technical
Fachliche Tests
HTMLUnit/Selenium
Fach GUI Mapping→
für Akzeptanztest
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
LAYERINGLAYERINGrules
workflow
technical
FIT(nesse)Tabelle
Fixtures Steps
für Akzeptanztest
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
BDDScenarios
Fach GUI Mapping Layer→
* FIT(nesse) Fixtures* BDD Steps
http://commons.wikimedia.org/wiki/File:Trifle(creamlayer)profile.jpg
Angst vor
Testen?
http://commons.wikimedia.org/wiki/File:Actressfearandpanic.jpg
Angst vor
Testen?
http://commons.wikimedia.org/wiki/File:Actressfearandpanic.jpg
test last wirkt
destruktiv!
Angst vor
Testen?
http://commons.wikimedia.org/wiki/File:Actressfearandpanic.jpg
Keine Zeit!
Angst vor
Testen?
http://commons.wikimedia.org/wiki/File:Actressfearandpanic.jpg
Testen istschwierig!
QuellenTDD Zu Wechselwirkung / Redundanz in Code, Tests, Spezifikation: Diplomarbeit Robert Will
http://www.cs.utoronto.ca/~robertw/diplom/da.pdf Steve Freeman, Nat Price, 2009: „Growing ObjectOriented Software guided by Tests“ Micheal Feathers: „Working effectively with legacy systems“
Robert C. Martin, 2009: „Clean Code“ Gerard Meszaros, 2007: „xUnit Test Patterns: Refactoring Test Code“ bzw http://xunitpatterns.com/
http://martinfowler.com/articles/mocksArentStubs.html
Akzeptanztests http://blog.dannorth.net/introducingbdd/
http://gojko.net/2010/04/13/howtoimplementuitestingwithoutshootingyourselfinthefoot2/#more1782
http://www.methodsandtools.com/archive/archive.php?id=72 Dave Astels Vortrag „Beyond TDD: BDD“:
http://www.youtube.com/watch?v=XOkHh8zF33o Gojko Adzic: Bridging the Communication Gap
http://www.acceptancetesting.info/thebook/
http://commons.wikimedia.org/wiki/File:Ninja_The_Last_Thing_You_See.jpg
Fragen und
Diskussion
Lizensiert unter Creative Commons 3.0 Attribution + Sharealike siehehttp://creativecommons.org/licenses/bysa/3.0/deed.de