Drupaljam Testing 20090626

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

    Favorites, Groups & Events

    Drupaljam Testing 20090626 - Presentation Transcript

    1. Unit Testing Raymond Muilwijk Michel van de Ven Madcap BV http://open.madcap.nl http://www.madcap.nl
    2. Agenda ● De theorie ● Wat zijn unit tests? ● Wat heb je er aan? ● Test-first programming ● Pointers and pitfalls ● De praktijk ● Demonstratie unit tests & refactoring, test-first programming ● Toekomst van simpletest ● Q&A
    3. Wat zijn unit tests? ● Doel is verificatie en validatie: Bouwen we het systeem juist? Bouwen we het juiste systeem? ● In code geformuleerde tests die, in een bekende context, “units” van het systeem functioneel testen. (Unit = functie, module, class &c) ● Voorspelbaar, reproduceerbaar. ● Programmer Tests & Customer Tests, integratietest
    4. Wat heb je er aan? (1) ● Write once, use forever: zinvolle investering. ● Levende systeemdocumentatie: samen met de code onderhouden, dus actueel. ● Controle op regressie van bugs: iedere bug zijn eigen unit test. ● Courage to change: geen onvermoede effecten. ● Hulp bij impactanalyse: Wat is de fan-out als ik deze interface verander?
    5. Wat heb je er aan? (2) ● Werkt toepassen van gezonde software engineering principes in de hand: ● Functionele decompositie. ● Decoupling & isolation, reduceren afhankelijkheden. ● MVC, Law of Demeter, YAGNI, DRY. ● Voorwaarde voor het kunnen doen van refactoring. ● Kwaliteit.
    6. Test-first programming ● Eerst de test, dan pas de code. ● Unit test is zeer precieze want in code geformuleerde specificatie. ● Belangrijke effecten: ● Het formuleren van de unit test dwingt tot het doen van analyse en ontwerp (JIT, XP) ● Je kunt stoppen met coderen precies wanneer de unit test slaagt. Do the simplest thing that could possibly work. You are not going to need it.
    7. Pointers & Pitfalls ● Unit tests tonen, net als alle andere methoden, alleen de aanwezigheid van bugs aan, niet de afwezigheid. ● De code van de unit test kan net zo buggy zijn als het testonderwerp. ● Unit tests moeten tezamen met de code onderhouden worden. ● Hoeveel unit tests moet je maken? Test everything that can possibly break. ● Gebruik van revisie controle is voorwaarde.
    8. Demo Voorbereiding CVS checkout: http://drupal.org/node/320 Testcase maken: http://drupal.org/node/325974 Refactoring Convert search module: http://drupal.org/node/394182 Test First Interesting What's next: http://buytaert.net/drupal-7-testing-status-update-and-next-steps PIFR: http://testing.drupal.org/pifr/status
    9. Q&A

    + R.MuilwijkR.Muilwijk, 4 months ago

    custom

    108 views, 0 favs, 0 embeds more stats

    Sinds drupal 7 is de module simpletest geintegreerd more

    More info about this document

    CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

    Go to text version

    • Total Views 108
      • 108 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    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