Your SlideShare is downloading. ×
Ant Unit Your Functional Test
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ant Unit Your Functional Test

2,620
views

Published on

Ant & AntUnit …

Ant & AntUnit
For people:
Agile developers
People largely involves in testing?
Looking for a solution for build & testing
Loose coupling
Complex application environment

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,620
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
42
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 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
    • 7.
      • test == workload
      • test == boring
      • test == low value
      • test == QA
      • test != developer
      Quality http://www.siafu.ca/files/smallANTEL_2.jpg Test ==  ?
    • 8. 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
    • 9. 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.
    • 10. Why AntUnit? Most flexible way to assert your functions Great extendibility So many tasks ready for use Perfectly integrate with development environment Controllable granularity
    • 11. Call Me “Eleph ant ” Picture from: deviantart.com Paradox__Ant_and_Elephant_by_Darkberry_Fruity.jpg
    • 12. 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
    • 13. 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
    • 14. 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
    • 15. Before Extend AntUnit
      • Just like A normal ant tasks
      • Something your should know
        • Condition and Fail
        • XML Namespace awareness
        • AntListener
        • Sequential
        • Macrodef & Scriptdef
    • 16. 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>
    • 17. 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
    • 18. 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
    • 19. 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>
    • 20. 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>
    • 21. 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
    • 22. 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
    • 23. Similar Ideas
      • Webtest project of Canoo
        • Selenium readable Ant script
      • CruiseControl & Plugins
    • 24. Resources
      • Webtest of Canoo
      • CruiseControl & Plugins
      • Selenium & projects in OpenQA
      • Abbot @ sourceforge
    • 25.  

    ×