Testen von PHP/Web-Anwendungen mit PHPUnit 3 und Selenium

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    Theme created by Sakari Koivunen and Henrik Omma Released under the LGPL license.

    Favorites, Groups & Events

    Testen von PHP/Web-Anwendungen mit PHPUnit 3 und Selenium - Presentation Transcript

    1. Willkommen!
        • Testen von PHP/Web-Anwendungen
        • mit PHPUnit 3 und Selenium
        • Sebastian Bergmann
        • http://sebastian-bergmann.de/
        • 5. Mai 2007
    2. Wer ich bin
      • Sebastian Bergmann
      • Diplom-Informatiker
      • 29 Jahre alt
      • Mitarbeit im PHP-Projekt seit 2000
      • Autor, Berater, Trainer
      • Entwickler bei eZ Systems AS
    3. Wer seid Ihr?
      • Eure Erfahrungen
        • PHP 5?
        • OOP?
        • Testen?
          • PHPUnit?
          • Selenium?
    4. Warum testen?
      • Firmen setzen immer häufiger unternehmenskritische Geschäftsanwendungen mit PHP um.
      • Wie stellt man sicher, dass die Software korrekt arbeitet?
    5. Was wird getestet?
      • Web-Anwendung
        • Backend
          • Geschäftslogik
          • Wiederverwendbare Komponenten
        • Frontend
          • Formularverarbeitung, Template, ...
          • AJAX, JSON, ...
          • Feeds, Web Services, ...
    6. Wie wird es getestet?
      • Web-Anwendung
        • Backend
          • Funktionales Testen der Geschäftslogik mit Unit Tests
          • Wiederverwendbare Komponenten
            • Externe Komponenten haben hoffentlich ihre eigenen Tests
        • Frontend
          • Testen mit Akzeptanztests oderr Systemtests , die “im Browser laufen”
          • Testen von Feeds, Web Services, etc. mit Unit Tests
          • Kompatibilitätstests für Browser / OS Kombinationen
          • Performanztests und Sicherheitstests
    7. Testwerkzeuge für PHP und Web
      • Unit Testing
        • PHPUnit
        • SimpleTest
      • System Testing
        • Selenium
          • PHPUnit + Selenium
      • Non-Functional Testing
        • Perfomance, Load, Stress, Reliability, Availability
          • ab, httperf, JMeter, Grinder, OpenSTA, ...
      • Security
        • Chorizo
          • PHPUnit + Chorizo
    8. Beispiel <?php class Calculator { public function add ( $a , $b ) { return $a + $b ; } } ?>
    9. Einstiegsdroge <?php class Calculator { /** * @assert (0,0) == 0 * @assert (0,1) == 1 * @assert (1,0) == 1 * @assert (1,1) == 2 * @assert (1,2) != 3 */ public function add ( $a , $b ) { return $a + $b ; } } ?>
    10. Einstiegsdroge
    11. Einen Test schreiben <?php require_once 'PHPUnit/Framework.php' ; require_once 'Calculator.php' ; class CalculatorTest extends PHPUnit_Framework_TestCase { public function testAdd () { $calculator = new Calculator ; $this -> assertEquals ( 0 , $calculator -> add ( 0 , 0 )); $this -> assertEquals ( 1 , $calculator -> add ( 0 , 1 )); $this -> assertEquals ( 1 , $calculator -> add ( 1 , 0 )); $this -> assertEquals ( 2 , $calculator -> add ( 1 , 1 )); $this -> assertNotEquals ( 3 , $calculator -> add ( 1 , 2 )); } } ?>
    12. Einen Test ausführen
    13. Tests organisieren
      • Application/
        • Package/
          • Class (Application/Package/Class.php)
          • ...
        • ...
        • Tests/
          • AllTests.php
          • Package/
            • AllTests.php
            • ClassTest (Application/Tests/Package/ClassTest.php)
    14. Tests organisieren <?php require_once 'PHPUnit/Framework/TestSuite.php' ; require_once 'Application/Tests/Package/AllTests.php' ; class AllTests { public static function suite () { $suite = new PHPUnit_Framework_TestSuite ( 'Project' ); $suite -> addTest ( Package_AllTests :: suite ()); return $suite ; } } ?>
    15. Tests organisieren <?php require_once 'PHPUnit/Framework/TestSuite.php' ; require_once 'Application/Tests/Package/ClassTest.php' ; class Package_AllTests { public static function suite () { $suite = new PHPUnit_Framework_TestSuite ( 'Package' ); $suite -> addTestSuite ( 'Package_ClassTest' ); return $suite ; } } ?>
    16. Selenium RC
    17. Selenium RC
    18. Selenium RC
    19. Selenium RC
    20. Selenium RC
    21. Ende
      • Vielen Dank für Euer Interesse!
      • Das Präsentationsmaterial wird in Kürze unter http://sebastian-bergmann.de/talks/ verfügbar sein.
    22. License
      • This presentation material is published under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported license.
      • You are free:
        • to Share – to copy, distribute and transmit the work.
      • Under the following conditions:
        • Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
        • Noncommercial. You may not use this work for commercial purposes.
        • No Derivative Works. You may not alter, transform, or build upon this work.
      • For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
      • Any of the above conditions can be waived if you get permission from the copyright holder.
      • Nothing in this license impairs or restricts the author's moral rights.

    + Sebastian BergmannSebastian Bergmann, 3 years ago

    custom

    1153 views, 0 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1153
      • 1148 on SlideShare
      • 5 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds
    • 5 views on http://sebastian-bergmann.de

    more

    All embeds
    • 5 views on http://sebastian-bergmann.de

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories