• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
[EclipseCon NA 2014] Integration tests for RCP made easy with SWTBot and Tycho
 

[EclipseCon NA 2014] Integration tests for RCP made easy with SWTBot and Tycho

on

  • 509 views

https://www.eclipsecon.org/na2014/session/integration-tests-rcp-made-easy-swtbot-and-tycho ...

https://www.eclipsecon.org/na2014/session/integration-tests-rcp-made-easy-swtbot-and-tycho



Although we live in a modular world, it will always make sense to write and run integration-tests that allow the testing of the whole application, and not just a module. These integration-tests are often the only way to test real usage scenarios that rely on multiple modules and that can be affected by other modules and by the packaging of your application.

Some recent improvements have happened in the Eclipse world to make it easier to produce and run integration tests for RCP applications, reducing significantly their cost while keeping their coverage high, and conformance to real use-cases and ability to spot bugs. This presentation will show how SWTBot Test Recorder can be used to speed up the creation of valid integration-tests against your RCP product, and how Tycho can be used to run it easily on any existing and packaged RCP application, the same as the one your users will get.

Statistics

Views

Total Views
509
Views on SlideShare
498
Embed Views
11

Actions

Likes
0
Downloads
12
Comments
0

2 Embeds 11

https://twitter.com 8
http://www.slideee.com 3

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Before talk: <br /> * Clean JBDS installed in /home/mistria/eclipsecon_na_2014/jbdevstudio-8.0.0.Alpha2 <br /> * Clean Eclipse installed in /home/mistria/eclipsecon_na_2014/eclipse-demo <br /> java -jar plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar -application org.eclipse.equinox.p2.director -uninstallIU org.eclipsecon.demo <br /> * Workbench started with <br /> ** Only project explorer + Editor <br /> ** Big font <br /> ** org.eclipsecon.demo project (open) <br /> ** org.eclipse.swtbot.generator (closed) <br /> ** Target Platform JBDS + SWTBot ready <br /> Clean Terminal with big font <br />
  • * Bot or monkey because they are ideally cheaper than humans to follow instructions <br />
  • DEMO: <br /> * Show Target-Platform configuration <br /> * Show project MANIFEST can reference product-specific bundles <br />
  • * No need to internal knowledge of the app (only need to care only about the “tip of the iceberg”) <br />
  • * No need to know much Java <br /> * Good for drafts <br /> * Very fast way to get started <br />
  • * With target-platform correctly set, it&apos;s an easy workflow to start recording a scenario as a SWTBot test case. <br />
  • * Shows the recorder dialog beside of the app <br /> * Dialog will get populated as user is working with the app <br /> DEMO: <br /> * Start with JDT dialog, create a test <br /> * New project <br /> * New file in project <br /> * Edit file <br /> * Menu &gt; Save <br /> * Click “Copy” in recorder dialog, paste in Eclipse <br />
  • DEMO: <br /> * show rule CheckboxClickedRule <br />
  • DEMO: <br /> * Show Launch Configuration and Run test <br /> * Look at stuff happening & Junit report <br />
  • * Under the hood: Tycho installs tests + deps into target application <br /> * Can be integrated in CI <br /> DEMO: <br /> * Show pom.xml <br /> * Run test (from terminal) <br /> * Show target/surefire-reports <br />

[EclipseCon NA 2014] Integration tests for RCP made easy with SWTBot and Tycho [EclipseCon NA 2014] Integration tests for RCP made easy with SWTBot and Tycho Presentation Transcript

  • Integration-tests for RCP applications made easy with SWTBot and Tycho Mickael Istria @mickaelistria EclipseCon NA 2014 CC-BY 4.0
  • Integration-tests ● Run on the whole application ● Interact with application at the user-level, directly with exposed UI elements ● Basically can repeat and verify usage scenarios Synonyms/related? UI-test, Functional-test, usage-test, macro, scenario, bot, monkey...
  • RCP app already exists ● Challenges: – How to write tests targeting existing RCP app? PDE Target-Platform – Anything easier and more efficient to produce tests? SWTBot APIs, and Test Recorder & Generator – How to run tests against an existing RCP app? Tycho Surefire, or SWTBot/PDE Launch Configuration
  • RCP app already exists ● This talk answers: – How to write tests targeting existing RCP app? PDE Target-Platform – Anything easier and more efficient to produce tests? SWTBot APIs, and Test Recorder & Generator – How to run tests against an existing RCP app? Tycho Surefire, or SWTBot/PDE Launch Configuration
  • How to write tests targeting existing RCP app? The PDE way: ● Test cases are in bundles (or fragments) ● At dev-time, your “application under test (AUT)” is configured in the Target Platform, which lists available pieces to consume and available for PDE.
  • Target-Platform Test-specific APIs Your product
  • Anything easier and more efficient to produce tests? ● Provide easier Natural language ↔ Test Case translation ● Manipulates user-level UI concepts, so no need to know much of internals of Eclipse ● Black-box testing, using PDE tests http://www.eclipse.org/swtbot http://wiki.eclipse.org/SWTBot
  • SWTBot APIs in Action APIs for SWT, Forms, Workbench, GEF and family
  • Recording Monitor user activity and record it as a SWTBot test case Record == Generate Java code https://wiki.eclipse.org/SWTBot/Recorder
  • Dev IDE Your product
  • Target Application
  • Recording is just about Rules ● Rules match UI events (actions, widgets) and deduce related code ● It's easy to write and contribute a rule: https://wiki.eclipse.org/SWTBot/Recorder#Extending_it
  • Run tests on existing application ● When PDE Target-Platform is set, it's just a matter of using SWTBot Launch Configuration From IDE: Your product
  • Run tests on existing application From Tycho: Tycho-surefire-plugin allows to use an installed application https://wiki.eclipse.org/Tycho/Testing_with_Surefire#p2Installed_on_provisioned_RCP_application
  • Questions? Contribute during tonight Hackaton! Please give feedback at eclipsecon.org ! Mickael Istria @mickaelistria EclipseCon NA 2014 CC-BY 4.0