Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Integration-tests for RCP applications
made easy
with SWTBot and Tycho
Mickael Istria @mickaelistria
EclipseCon NA 2014
CC...
Integration-tests
● Run on the whole application
● Interact with application at the user-level,
directly with exposed UI e...
RCP app already exists
● Challenges:
– How to write tests targeting existing RCP app?
PDE Target-Platform
– Anything easie...
RCP app already exists
● This talk answers:
– How to write tests targeting existing RCP app?
PDE Target-Platform
– Anythin...
How to write tests targeting
existing RCP app?
The PDE way:
● Test cases are in bundles (or fragments)
● At dev-time, your...
Target-Platform
Test-specific APIs
Your product
Anything easier and more efficient
to produce tests?
● Provide easier Natural language ↔ Test Case
translation
● Manipulat...
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/...
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 ...
Run tests on existing application
● When PDE Target-Platform is set, it's just a
matter of using SWTBot Launch Configurati...
Run tests on existing application
From Tycho: Tycho-surefire-plugin allows to
use an installed application
https://wiki.ec...
Questions?
Contribute during tonight Hackaton!
Please give feedback at
eclipsecon.org !
Mickael Istria @mickaelistria
Ecli...
Upcoming SlideShare
Loading in …5
×

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

3,023 views

Published on

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.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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

  1. 1. Integration-tests for RCP applications made easy with SWTBot and Tycho Mickael Istria @mickaelistria EclipseCon NA 2014 CC-BY 4.0
  2. 2. 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...
  3. 3. 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
  4. 4. 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
  5. 5. 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.
  6. 6. Target-Platform Test-specific APIs Your product
  7. 7. 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
  8. 8. SWTBot APIs in Action APIs for SWT, Forms, Workbench, GEF and family
  9. 9. Recording Monitor user activity and record it as a SWTBot test case Record == Generate Java code https://wiki.eclipse.org/SWTBot/Recorder
  10. 10. Dev IDE Your product
  11. 11. Target Application
  12. 12. 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
  13. 13. 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
  14. 14. 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
  15. 15. Questions? Contribute during tonight Hackaton! Please give feedback at eclipsecon.org ! Mickael Istria @mickaelistria EclipseCon NA 2014 CC-BY 4.0

×