SlideShare a Scribd company logo
AntUnit Your Functional Test Jimmy Zhao  Dec 30, 2008
 
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
What? Ant & AntUnit For people Agile developers People largely involves in testing? Looking for a solution for build & testing Loose coupling  Complex application environment
Agenda Why AntUnit?  How to use & extend   it? My simple  AntUnit extension s Examples & Demo More thoughts Q & A
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  ==  ?
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
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.
Why AntUnit? Most flexible way to assert your functions Great extendibility  So many tasks ready for use Perfectly integrate with development environment Controllable granularity
Call Me  “Eleph ant ” Picture from:  deviantart.com   Paradox__Ant_and_Elephant_by_Darkberry_Fruity.jpg
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
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
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
Before Extend AntUnit Just like A normal ant tasks Something your should know  Condition and Fail XML Namespace awareness AntListener Sequential Macrodef & Scriptdef
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>
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
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
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>
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>
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
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
Similar Ideas Webtest project of Canoo Selenium readable Ant script CruiseControl & Plugins
Resources Webtest of Canoo CruiseControl & Plugins Selenium & projects in OpenQA Abbot @ sourceforge
 

More Related Content

PDF
QA Fest 2018. Ярослав Пернеровский. Test Automation Pyramid, how it ruins you...
PPTX
Dot all 2019 | Testing with Craft | Giel Tettelar
PPT
Lessons learned on software testing automation
PDF
Codeception
PDF
Codeception introduction and use in Yii
ODP
Integration Testing in Python
PPTX
Unit & integration testing
PDF
Unit Testing in Umbraco
QA Fest 2018. Ярослав Пернеровский. Test Automation Pyramid, how it ruins you...
Dot all 2019 | Testing with Craft | Giel Tettelar
Lessons learned on software testing automation
Codeception
Codeception introduction and use in Yii
Integration Testing in Python
Unit & integration testing
Unit Testing in Umbraco

What's hot (20)

ODP
Automated testing in Python and beyond
 
PDF
Codeception: introduction to php testing
PPTX
CI / CD w/ Codeception
PDF
Unit testing for WordPress
PDF
vREST for a new user
PDF
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
PDF
PHP Unit Testing in Yii
PPTX
Joomla! Testing - J!DD Germany 2016
PDF
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
PPS
Why Unit Testingl
PDF
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
ZIP
Test
PDF
Automated Testing for Embedded Software in C or C++
PPTX
Codeception
PPTX
JUnit 5: What's New and What's Coming - Spring I/O 2019
PDF
Acceptance testing in php with Codeception - Techmeetup Edinburgh
PDF
Go ahead outside Japan
PPTX
Unit Testing Android Applications
PDF
CookpadTechConf2018-(Mobile)TestAutomation
PPTX
PHPUnit with CakePHP and Yii
Automated testing in Python and beyond
 
Codeception: introduction to php testing
CI / CD w/ Codeception
Unit testing for WordPress
vREST for a new user
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
PHP Unit Testing in Yii
Joomla! Testing - J!DD Germany 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Why Unit Testingl
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
Test
Automated Testing for Embedded Software in C or C++
Codeception
JUnit 5: What's New and What's Coming - Spring I/O 2019
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Go ahead outside Japan
Unit Testing Android Applications
CookpadTechConf2018-(Mobile)TestAutomation
PHPUnit with CakePHP and Yii
Ad

Similar to Ant Unit Your Functional Test (20)

ODP
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
PPT
Automated Unit Testing
PPTX
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
PDF
API Testing following the Test Pyramid
PPTX
Code igniter unittest-part1
PDF
Introduction To UnitTesting & JUnit
ODP
Improving code quality using CI
PPTX
Creating testing tools to support development
PPTX
Supermondays: Jenkins CI lightning talk
KEY
Enterprise Build And Test In The Cloud
DOCX
What is selenium
PPT
Qtp 9.2 tutorials
PPT
ODP
Testing In Java4278
ODP
Testing In Java
PPT
Unit testing php-unit - phing - selenium_v2
PPT
Qtp with descriptive programming
PPT
QTP with Descriptive programming
PPT
Qtp With Descriptive Programming
PPT
Qtp Training Deepti 1 Of 4187
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
Automated Unit Testing
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
API Testing following the Test Pyramid
Code igniter unittest-part1
Introduction To UnitTesting & JUnit
Improving code quality using CI
Creating testing tools to support development
Supermondays: Jenkins CI lightning talk
Enterprise Build And Test In The Cloud
What is selenium
Qtp 9.2 tutorials
Testing In Java4278
Testing In Java
Unit testing php-unit - phing - selenium_v2
Qtp with descriptive programming
QTP with Descriptive programming
Qtp With Descriptive Programming
Qtp Training Deepti 1 Of 4187
Ad

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Diabetes mellitus diagnosis method based random forest with bat algorithm
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Ant Unit Your Functional Test

  • 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.