Ant Unit Your Functional Test

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

    Ant Unit Your Functional Test - Presentation Transcript

    1. AntUnit Your Functional Test Jimmy Zhao Dec 30, 2008
    2.  
    3. About Me
      • From China
      • More than 8 years of project experience with Ant
      • 6 years of Agile experience
      • Developed a test engine just like Ant
    4. What?
      • Ant & AntUnit
      • For people
        • Agile developers
        • People largely involves in testing?
        • Looking for a solution for build & testing
        • Loose coupling
        • Complex application environment
    5. Agenda
      • Why AntUnit?
      • How to use & extend it?
      • My simple AntUnit extension s
      • Examples & Demo
      • More thoughts
      • Q & A
    6. Pain of Agile Developers
      • test == workload
      • test == boring
      • test == low value
      • test == QA
      • test != developer
      Quality http://www.siafu.ca/files/smallANTEL_2.jpg Test ==  ?
    7. A Silver Bullet For Testing
      • Ant
        • Cover almost every corners of development
        • Numerous Ant extensions ready
      • AntUnit – just released 1.1
        • Test Ant Task
        • Everything is possible
    8. Official Definition
      • AntUnit provides Ant tasks for testing Ant task , it can also be used to drive functional and integration tests of arbitrary applications with Ant.
    9. Why AntUnit? Most flexible way to assert your functions Great extendibility So many tasks ready for use Perfectly integrate with development environment Controllable granularity
    10. Call Me “Eleph ant ” Picture from: deviantart.com Paradox__Ant_and_Elephant_by_Darkberry_Fruity.jpg
    11. The Simplest Continuous Integration & Test Solution Ant task too, but we call it assertion here All of them are Ant Tasks Everything Ant Build & Deploy Integration Test System Test AntUnit Test Report Notification Check Style Emma
    12. Two Ways of Using AntUnit
      • A: Ant as a drive
        • Define your test scenario by
        • Integrate them in Ant
      • B: Ant as script engine
        • Define your test scenario in Ant script
        • Use Ant xml files to manage your cases
      • Don’t forget to assert via AntUnit
        • White-box testing
    13. Why Extend AntUnit?
      • Assert a function is complicated
        • Business logic
          • i.e. web flow with session
        • C orner cases of testing
          • i.e. https authentication
      • Combine/reuse existing assertions
        • Sequential multiple assertions
        • And/or/xor assertion result
        • Extend existing tasks
    14. Before Extend AntUnit
      • Just like A normal ant tasks
      • Something your should know
        • Condition and Fail
        • XML Namespace awareness
        • AntListener
        • Sequential
        • Macrodef & Scriptdef
    15. Example 1
      • <project name=&quot;echo-test&quot; basedir=&quot;.&quot; default=&quot;all&quot;
      • xmlns:au=&quot;antlib:org.apache.ant.antunit&quot; >
      • < macrodef name=&quot;assertFalse&quot; backtrace=&quot;false&quot;>
      • <attribute name=&quot;message&quot; default=&quot;Assertion failed&quot;/>
      • <element name=&quot;assertion&quot; implicit=&quot;true&quot;/>
      • <sequential>
      • <au:assertTrue message=&quot;@{message}&quot;>
      • <not>
      • <assertion/>
      • </not>
      • </au:assertTrue>
      • </sequential>
      • </ macrodef >
      • <target>
      • </project>
    16. Examples
      • Command Line application
        • Normal Ant t asks + AntUnit
          • Sshexec/Exec/telnet + assertions
      • Web UI application
        • JUnit extension tasks + AntUnit
          • A: HttpUnit/Selenium + assertions
          • B: AntUnit + assertions based on Selenium
      • GUI application
        • Junit extension tasks + AntUnit
          • Abbot + AntUnit
    17. My AntUnit Extensions
      • Extension 1
        • Better functional test purpose assertions
          • St d o utAssertion – LogContains Task
          • FileAssertion – ResourceContains Task
          • Log4jAssertion – no in 1.1 yet
      • Extension 2
        • Selenium junit extension based task
      • Use all of them together
    18. CLI Example
      • <target name=&quot;test CLIApp &quot;>
      • <exec executable=&quot;cmd&quot;>
      • <arg value=&quot;/c&quot;/>
      • <arg value=&quot;ant.bat&quot;/>
      • <arg value=&quot;-p&quot;/>
      • </exec>
      • <au:assert>
      • </target>
    19. Web Application Example
      • <target name=&quot;testSeleniumTask&quot;>
      • < selenium >
      • < sequential >
      • < command name=&quot;open&quot;>/</command>
      • <command name=&quot;click&quot;>btnG</command>
      • <command name=&quot;waitForPageToLoad&quot;> 5 000</command>
      • <command name=&quot;click&quot;>//div[@id='res']/div[1]/ol/li[1]/h3/a/em</command>
      • <command name=&quot;waitForPageToLoad&quot;> 5 000</command>
      • </ sequential >
      • </selenium>
      • < au:assertTrue >
      • <command name=&quot;isTextPresent&quot;>AntUnit 1.1</command>
      • </ au:assertTrue >
      • </target>
    20. More Test Purposed Extensions
      • Listener as task
        • For monitoring the testing progress
      • Thread-liked/Recursive/Timing task
        • Embedded runtime & dynamic task needed, i.e. logging
      • Assertion Combination
        • And/Or/Xor for assertion results
    21. Problems/Found Issues
      • Setup/TearDown for each test
        • It’s good but sometimes also a problem
          • especially in a functional test environment
          • Should be configurable
      • Not really good at case management
        • Case dependency is an issue
        • XML file + Target dependency
        • Too flexible is also a problem
          • T est pattern needed
    22. Similar Ideas
      • Webtest project of Canoo
        • Selenium readable Ant script
      • CruiseControl & Plugins
    23. Resources
      • Webtest of Canoo
      • CruiseControl & Plugins
      • Selenium & projects in OpenQA
      • Abbot @ sourceforge
    24.  
    SlideShare Zeitgeist 2009

    + jimmy zhaojimmy zhao Nominate

    custom

    823 views, 0 favs, 1 embeds more stats

    Ant & AntUnit
    For people:
    Agile developers
    Peopl more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 823
      • 817 on SlideShare
      • 6 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 10
    Most viewed embeds
    • 6 views on http://digday.blogspot.com

    more

    All embeds
    • 6 views on http://digday.blogspot.com

    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