TestBrowser Driven Development: How to get bulletproof code from lazy developers

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

    TestBrowser Driven Development: How to get bulletproof code from lazy developers - Presentation Transcript

    1. TestBrowser Driven Development How to get bulletproof code from lazy developers Dylan Jay [email_address]
      • Dylan Jay
      • 6 years with Plone
      • Large corporate Java/Rational Unified process background
      • Co-founder of PretaWeb in Australia
      • Started pretaweb.funnelweb, collective.hostout, Products.LoginLockout (and way way back RemoteUserFolder)
      About me
    2. What this talk is about
      • Story of how we delivered the difficult (previous failures)
      • Communication
      • Users ↔ Business Analyst
      • Business Analyst ↔ Developers
      • For project managers, business analysts, technical leads
      • But also for solo development
    3. The story begins...
      • Gov. department
      • Complex Workflow Application of sensitive info – generating certificates
      • BA 40% Dev 60% + support
      • Fixed price + fixed deadline.
      • Sold them on scrum … without mentioning scrum
      • Used hybrid SCUM + usecase analysis
    4. Roles: reference
      • BA: Business Analyst - Extract requirements from client and produce requirements document. Traditionally job ends before code begins
      • PO: Product Owner - In SCRUM: Sort of like a BA who sticks around. Go to person.
      • Dev: Developer - People who want solve code problems not user problems :)
      • ST/QA: System Tester - Non-developers there to break developers work
    5. CRC Card sessions
      • Class, Responsibility, Collaboration
    6. Use-case analysis
        Great for workflow/edge cases
      • Usecase:
        • 1 main scenario (sunny day)
        • ~30 alternate scenarions (rainy day)
      • Challenge - level of detail
        • Premature detail vs. not enough
      • ~50 scenarios
      • 43 page word doc including non-functional requirements
    7. Paper Based Prototype
      • http://www.balsamiq.com/products/mockups
    8. Stories vs Usecases
      • We used SCRUM
      • SCRUM uses Stories
      • Stories are good for estimation
      • Stories group functionality vs. Scenarios runs across functionality
      • We
        • Broke large scenario into three stories
        • Grouped 3-4 related scenarios into stories
    9. Unit Testing
      • Code
      • Write test
      • Run test: it succeeds
      • Refactor
      • Run test: it succeeds
      • Tests are code
      • Test functions/API
      • Tests run fast
      • Tests run often
      • Tests run after every change
    10. Unit Testing – scorecard
      • Communication of requirements - x
      • Validation of requirements – x
      • Prevent regressions - ✓
    11. Doctests
      • Structured text document
      • Tells a story
      • Tells a story with EXAMPLES THAT WORK!
      • Code interleaved
      • Output checked against actual == test
      • docstring or standalone doctests
    12. Functional Testing
      • Test system from outside – GUI after development
      • Written from user perspective
      • Easy to write – write it as you would use it
      • Usecase = test
      • Often done by separate team – system testers
      • Often done just before delivery
      • Example: selenium
    13. Selenium
    14. zc.testbrowser an api browser Easy to keep in your head – fun - natural browser.getControl( label=None, name=None, index=None ) /.options /.value /.click() browser.getLink( text=None, url=None, id=None ) /.click() browser.open(url) brower.goBack() browser.reload() print browser.contents
    15. Usecases to tests
      • Dev: Branch created
      • Dev: Scenarios copied to StoryX.txt
      • Dev: Code developed
      • Dev: StoryX.txt augmented with testbrowser
      • Dev: All Tests pass
      • PO: Code + test reviewed
      • PO: Branch merged
    16. TestBrowser extras
      • Doesn't do javascript
      • But zc.testbrowser.real does
        • Requires firefox
      • Zope.testrecorder
        • Generate tests from GUI
      • With Plone use roadrunner
    17. Still not working...
      • Implemented wrong thing – rework
      • Usecases not detailed enough
      • Lazy BA – didn't want tell developers how to do it
      • Lazy developers – didn't want at the user level
    18. Functional Test Driven Development
      • PO: Branch created
      • PO: Scenarios copied to StoryX.txt
      • PO: StoryX.txt augmented with tests (sort of)
      • Dev: Code developed
      • Dev: Test finished off
      • Dev: All tests pass
      • PO: Code + test reviewed
      • PO: Branch merged
    19. Our process – Bugs
      • Dev: Branch created
      • Dev: StoryX.txt add in bug condition
      • Dev: Show test fails
      • Dev: Code fixed
      • Dev: All tests pass
      • PO: Code + test reviewed
      • PO: Branch merged
    20. Test Driven Development
      • Write test
      • Run test: it fails
      • Fix code
      • Run test: it succeeds
      • Refactor
      • Run test: it succeeds
      • Repeat
      • Write tests before code
      • red/green/refactor
        • First fail then fix
      • Forces you to understand requirements before writing code
    21. TestBrowser Driven Development
      • Communication of requirements - ✓
        • Level of detail right
      • Easy – ✓
        • Technical PO can do it in reasonable time
      • Validation of requirements – ✓
        • Easy to see changes to tests
      • Prevent regressions - ✓
        • Test suite run after any change e.g. 1862 bug
    22. Example: URL Shortener
    23. Proposal: Screenshot gen
      • Testbrowser statements -> screenshot
      • Highlight action or comparison in screenshot
      • Doctests with pictures and no code
      • A better pypi & Plone Software Center
      • Documentation Driven Development
    24. Conclusion
      • ~50 usecases
        • all turned into doctests and extended
        • Living requirements/documention
      • Quality was very important
        • delivered with peace of mind
      • Tight deadline, tight budget
        • delivered on time on budget
      • Lazy developers
        • less rework, less delays = $$$
    25. Credits http://docs.python.org/library/doctest.html http://pypi.python.org/pypi/zc.testbrowser http://plone.org/documentation/tutorial/testing/functional-tests

    + djaydjay, 2 months ago

    custom

    348 views, 0 favs, 0 embeds more stats

    Introducing a new coding technique that helped Pret more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 348
      • 348 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    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