Difference between revisions of "Eclipse/Testing"

From Eclipsepedia

Jump to: navigation, search
(UI tests)
(35 intermediate revisions by 18 users not shown)
Line 1: Line 1:
The Eclipse Platform is tested during every build by an extensive suite of automated tests. These tests are written using the [http://junit.org JUnit] test framework. This page contains links to information about how to run and create automated tests for the platform.
+
The Eclipse Platform is tested during every build by an extensive suite of automated tests. These tests are written using the [http://junit.org JUnit] test framework. This page contains links to information about how to run and create automated tests for the platform.  
  
== Correctness tests ==
+
== Correctness tests ==
  
The majority of automated tests are testing for program correctness. A test failure on these tests implies that program behaviour is not as expected by the tests.  These tests are run every build on Windows, Linux, and Mac OSX.
+
The majority of automated tests are testing for program correctness. A test failure on these tests implies that program behaviour is not as expected by the tests.  
  
*See [[ETF_JUnit4_Changes|this page]] for information about running JUnit4 tests within the Automated Testing Framework.
+
=== Getting the required bundles ===
  
=== Running tests from within Eclipse ===
+
Check out the test plugin containing the tests you want to run, along with any prerequisite plug-ins. Here are some plug-ins you will likely need:
  
Correctness tests can be run manually from within the Eclipse IDE using a "JUnit Plug-in Test" launch configuration:
+
*org.junit - The JUnit test framework
 +
*org.eclipse.test - The basic infrastructure for running Eclipse tests  
 +
*org.eclipse.core.tests.harness - Various utility pieces used by many tests
 +
*org.eclipse.core.tests.runtime - Tests for the runtime component
 +
*org.eclipse.core.tests.resources - Tests for the resources component
 +
*org.eclipse.ui.tests.harness - Various utility pieces used by UI tests
 +
*org.eclipse.ui.tests - Tests for the Eclipse UI
  
# Check out the test plugin containing the tests you want to run, along with any prerequisite plug-ins. Here are some plug-ins you will likely need:
+
=== Running tests from within Eclipse  ===
#* org.junit - The JUnit test framework
+
#* org.eclipse.test - The basic infrastructure for running Eclipse tests
+
#* org.eclipse.core.tests.harness - Various utility pieces used by many tests
+
#* org.eclipse.core.tests.runtime - Tests for the runtime component
+
#* org.eclipse.core.tests.resources - Tests for the resources component
+
#* org.eclipse.ui.tests.harness - Various utility pieces used by UI tests
+
#* org.eclipse.ui.tests - Tests for the Eclipse UI
+
# In the Navigator or Package Explorer, select the test or test suite you want to run. Each test package typically contains a TestSuite class that contains all the tests in that package.  Suites from multiple packages are then aggregated into higher level suites.  Here are some useful suites to know about:
+
#* org.eclipse.ui.tests.UiTestSuite - runs all UI tests
+
#* org.eclipse.core.tests.runtime.AutomatedTests - runs all runtime tests
+
#* org.eclipse.core.tests.resources.AutomatedTests - runs all resource tests
+
# Select Run > Run...
+
# Choose the "JUnit Plug-in Test" category, and click the button to create a new test
+
# On the "Main" tab, select the appropriate application for that test. Here are some important applications to know about:
+
#* [No Application] - Headless Mode - for running headless core (runtime, osgi, resource) tests
+
#* org.eclipse.ui.ide.workbench - for running UI tests
+
# Click Run.
+
  
=== Using EasyMock ===
+
Correctness tests can be run from within the Eclipse IDE using a "JUnit Plug-in Test" launch configuration:
  
In the Eclipse [[Galileo]] release the utility [http://easymock.org EasyMock] was added to the platform test framework. EasyMock is used to create fake implementations of objects in order to test units of functionality in isolation from other objects. See the EasyMock documentation for more details.
+
#In the Package Explorer, select the test or test suite you want to run. Each test package typically contains a TestSuite class that contains all the tests in that package. Suites from multiple packages are then aggregated into higher level suites. Here are some useful suites to know about:  
 +
#*org.eclipse.ui.tests.UiTestSuite - runs all UI tests
 +
#*org.eclipse.core.tests.runtime.AutomatedTests - runs all runtime tests
 +
#*org.eclipse.core.tests.resources.AutomatedTests - runs all resource tests
 +
#Select Run > Run...
 +
#Choose the "JUnit Plug-in Test" category, and click the button to create a new test
 +
#On the "Main" tab, select the appropriate application for that test. Here are some important applications to know about:
 +
#*[No Application] - Headless Mode - for running headless core (runtime, osgi, resource) tests
 +
#*org.eclipse.ui.ide.workbench - for running UI tests
 +
#Click Run.
  
To use EasyMock in your tests, simply load the org.easymock bundle from the [[Orbit]] repository. There is a convenience ''easymock.psf'' [[PSF|project set file]] in the org.eclipse.test bundle to facilitate loading of this bundle.
+
=== Using EasyMock ===
  
Note that EasyMock requires Java 5 or greater. At this time, we run tests on Java 1.4.2 and Java 5. This means you need to add the following to the Ant target for your tests (contact releng for details):
+
In the Eclipse [[Galileo]] release the utility [http://easymock.org EasyMock] was added to the platform test framework. EasyMock is used to create fake implementations of objects in order to test units of functionality in isolation from other objects. See the EasyMock documentation for more details.
  
<target name="YourTestTarget" depends="setJVMProperties">
+
To use EasyMock in your tests, simply load the org.easymock bundle from the [[Orbit]] repository. There is a convenience [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gef/test/org.eclipse.test/easymock.psf?root=Tools_Project&view=log| ''easymock.psf''] [[PSF|project set file]] in the org.eclipse.test bundle to facilitate loading of this bundle.  
<property name="jvm" value="${J2SE-5.0}" />
+
<!--only run test if J2SE-5.0 property  set-->
+
<condition property="skip.test">
+
<not>
+
  <isset property="J2SE-5.0" />
+
</not>
+
</condition>
+
... remaining target definition as usual
+
  
== Session tests ==
+
Note that EasyMock requires Java 5 or greater. You will not be able to run tests on JDK 1.4 or earlier if you are using EasyMock.
  
[[Session Tests]] in Eclipse are tests that require that a new Eclipse session be launched for every test case run. Thus, they have additional requirements regarding controling the environment test cases are run (VM, set of plug-ins available, configuration, instance location, command line parameters) and how results are communicated back to the test runner.
+
=== Support for JUnit4  ===
  
== Performance tests ==
+
During the [[Helios]] release the platform is moving to support JUnit4 in the test framework in addition to JUnit3. For more details on this transition see [[Eclipse/Testing/JUnit4 Changes]].
  
See the [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.test.performance/doc/Performance%20Tests%20HowTo.html Performance Tests How-to]
+
=== Testing on Java 7 ===
  
=== Profiling performance tests ===
+
In some Java 7 implementations, the order of methods returned by java.lang.Class#getDeclaredMethods() is not consistent across runs. This method is used by JUnit to discover test methods, which means test order may change across executions. Generally each test method should be coded to not depend on test execution order, which also makes it easier for people to run individual tests when debugging and get consistent results. In some rare cases separate tests rely on each other, in which case you can use the test suite to hard-code a test execution order. There is also a convenience class [http://git.eclipse.org/c/platform/eclipse.platform.releng.git/tree/bundles/org.eclipse.test.performance/src/org/eclipse/test/OrderedTestSuite.java OrderedTestSuite.java] that you can use or copy for this purpose.
  
It can be very useful to capture profiling data for performance tests, to help track down where the time is going. To ensure you are profiling exactly the same code paths that are running in the automated performance tests, you can attach a headless profiler to the performance tests within the test suite. Here are steps to attach a headless YourKit agent to a performance test. The resulting snapshots can later be opened for analysis from the YourKit client:
+
== Session tests ==
  
# Download the tests for the build you are interested in (available from same [http://download.eclipse.org/eclipse download page] as the build itself).
+
[[Session Tests]] in Eclipse are tests that require that a new Eclipse session be launched for every test case run. Thus, they have additional requirements regarding controling the environment test cases are run (VM, set of plug-ins available, configuration, instance location, command line parameters) and how results are communicated back to the test runner.
# Unzip the test framework, and follow the instructions in the readme.html to configure your tests
+
 
# Create a properties file (let's say profile.properties) with the following contents:
+
== Performance tests  ==
 +
 
 +
See the [http://git.eclipse.org/c/platform/eclipse.platform.releng.git/plain/bundles/org.eclipse.test.performance/doc/Performance%20Tests%20HowTo.html Performance Tests How-to]
 +
 
 +
=== Profiling performance tests  ===
 +
 
 +
It can be very useful to capture profiling data for performance tests, to help track down where the time is going. To ensure you are profiling exactly the same code paths that are running in the automated performance tests, you can attach a headless profiler to the performance tests within the test suite. Here are steps to attach a headless YourKit agent to a performance test. The resulting snapshots can later be opened for analysis from the YourKit client:
 +
 
 +
#Download the tests for the build you are interested in (available from same [http://download.eclipse.org/eclipse download page] as the build itself).  
 +
#Unzip the test framework, and follow the instructions in the readme.html to configure your tests  
 +
#Create a properties file (let's say profile.properties) with the following contents:
  
 
   extraVMargs=-agentlib:yjpagent=sampling,onexit=snapshot
 
   extraVMargs=-agentlib:yjpagent=sampling,onexit=snapshot
  
<ol start="4">
+
#Invoke the performance test and specify the properties file location:  
<li>Invoke the performance test and specify the properties file location:</li>
+
</ol>
+
  
   runtests "-Dtest.target=performance" -properties profile.properties <yourtarget>
+
   runtests "-Dtest.target=performance" -properties profile.properties &lt;yourtarget&gt;
  
If your performance test is a session test, a more complex spell is needed in your profile.properties file:
+
If your performance test is a session test, a more complex spell is needed in your profile.properties file:  
  
 
   extraVMargs=-Dsetup.override.vmArgs=agentlib:yjpagent==sampling,onexit==snapshot
 
   extraVMargs=-Dsetup.override.vmArgs=agentlib:yjpagent==sampling,onexit==snapshot
  
This instructs the [[Session Tests]] framework to specify the provided vm arguments on each nested invocation that runs the session test. Note the session test framework override mechanism requires escaping '=' characters with '==', separating multiple arguments with a ';' character rather than a space, and omitting the leading '-' character.
+
This instructs the [[Session Tests]] framework to specify the provided vm arguments on each nested invocation that runs the session test. Note the session test framework override mechanism requires escaping '=' characters with '==', separating multiple arguments with a ';' character rather than a space, and omitting the leading '-' character.  
  
 
The above options will instruct the profile agent to start CPU sampling immediately on startup, and to save a performance snapshot on exit. YourKit supports various [http://www.yourkit.com/docs/75/help/getting_started/running_with_profiler/additional_agent_options.jsp other options] for configuring the headless profile agent.
 
The above options will instruct the profile agent to start CPU sampling immediately on startup, and to save a performance snapshot on exit. YourKit supports various [http://www.yourkit.com/docs/75/help/getting_started/running_with_profiler/additional_agent_options.jsp other options] for configuring the headless profile agent.
 +
 +
== API tests ==
 +
 +
The Eclipse project also runs an suite of API tests during builds. These tests capture problems such as breaking API changes, and correct evolution of bundle [[Version Numbering|version numbers]]. For more details on these tests, refer to [[PDE/API_Tools]].
  
 
== UI tests  ==
 
== UI tests  ==
Line 94: Line 96:
 
! Remarks/Comments
 
! Remarks/Comments
 
|-
 
|-
! [http://www.instantiations.com/windowtester/ Window Tester]  
+
! [http://code.google.com/javadevtools/wintester/html/index.html Window Tester]  
 +
 
 
|  
 
|  
Commercial, Eclipse committers are allowed to use it for free  
+
[http://code.google.com/javadevtools/download-wintester.html Available for free from Google]
  
 
|  
 
|  
Line 102: Line 105:
  
 
|  
 
|  
*looks stable
+
*Stable
 
*creates JUnit tests, can be launched along with other tests  
 
*creates JUnit tests, can be launched along with other tests  
*easy API, good documentation  
+
*easy API
 +
*good documentation  
 +
*OpenSource
 
*very easy to modify generated code  
 
*very easy to modify generated code  
*API looks similar to SWTBot API, tests could be perhaps migrated to SWTBot when it's stable
 
  
 
|  
 
|  
*large footprint when creating tests (around 60MB for Window Tester plug-ins)  
+
*large footprint when creating tests (around 60MB for WindowTester plug-ins)  
 
*sensitive for focus changing, very hard to debug these UI tests (i.e. changing focus to the host Eclipse causes exceptions)  
 
*sensitive for focus changing, very hard to debug these UI tests (i.e. changing focus to the host Eclipse causes exceptions)  
*we would need a license to use libraries on our test servers
 
  
 
| <br>
 
| <br>
Line 127: Line 130:
 
*excellent component recognition, including automatic naming for Eclipse/RCP components  
 
*excellent component recognition, including automatic naming for Eclipse/RCP components  
 
*supports testing combined SWT/Swing applications  
 
*supports testing combined SWT/Swing applications  
*tests are batch and thus ant-runnable; Jython or Groovy scripting available<br>
+
*tests are batch and thus ant-runnable producing a detailed run-log and XML and HTML reports
*comprehensive [http://www.qfs.de/en/qftest/manual.html manual] and [http://www.qfs.de/en/qftest/tutorial.html tutorial] available online; mailing list with [http://www.qftest.com/archive/qftest-list/ searchable archive]
+
*Jython or Groovy scripting available  
 +
*comprehensive [http://www.qfs.de/en/qftest/manual.html manual] and [http://www.qfs.de/en/qftest/tutorial.html tutorial] available online; mailing list with [http://www.qftest.com/archive/qftest-list/ searchable archive]  
 
*very responsive support
 
*very responsive support
  
 
|  
 
|  
*Eclipse/SWT support limited to Windows and Linux, both x86 and x86_64, Solaris Gtk support available on request
+
*Eclipse/SWT support limited to Windows and Linux, both x86 and x86_64, Solaris Gtk support available but no Mac
*QF-Test is Java application but not integrated into Eclipse<br>
+
*QF-Test is Java application but not integrated into Eclipse<br>  
 
*tests don't compile to JUnit
 
*tests don't compile to JUnit
  
 
|  
 
|  
*replaces the org.eclipse.swt plugin (corresponding patches are available, could be applied automatically as part of daily builds)<br>
+
*replaces the org.eclipse.swt plugin (corresponding patches are available, could be applied automatically as part of daily builds)<br>  
 +
*also supports GEF/GMF
 
*also supports web testing
 
*also supports web testing
  
 
|-
 
|-
! [http://www.bredex.de/en/guidancer/first.html GUI Dancer]  
+
! [http://www.eclipse.org/jubula/ Jubula]
 
|  
 
|  
Commercial
+
Open Source
  
 
|  
 
|  
No, "not a capture/replay tool"
+
Tests specified by drag &amp; drop without need to record. <br> Recording is possible as well.
  
 
|  
 
|  
*tests Java (Swing, SWT/RCP) and HTML GUI's
+
*Supports Swing, SWT/RCP/GEF and HTML applications
*extensible using Java
+
*Works on Windows, Unix/Linux and Mac
 +
*Black-box testing - no source code needed to execute tests
 +
*Robust, high level test automation without any coding effort<br>
 +
*Incorporates best practices of software development into tests
 +
*Suitable for agile processes because tests can be written before an app is available
 +
*Robust object recognition heuristic<br>
 +
*Tests can be run from command line for continuous integration
  
 
|  
 
|  
*quite expensive [https://cgi.bredex.de/GUIdancerShop/prices.do 4641 euro] for a license for one GUI toolkit (SWT/RCP)
+
*tests don't compile to JUnit
*tests cannot be run as JUnits
+
*does not support combined SWT/Swing applications
*store tests in a database
+
*not extendable without knowledge about RCP-Programming
*this tool doesn't make writing tests easier&nbsp;;) it is pretty hard to start working with it (especially comparing to tools like SWT Bot)
+
*few elements missing, like loops and if-conditions
  
 
| <br>
 
| <br>
 +
 +
|-
 +
! [http://www.bredex.de/en/guidancer/first.html GUIdancer]
 +
|
 +
Enterprise edition of the Jubula project
 +
 +
|
 +
See Jubula
 +
 +
|
 +
*see Jubula pros
 +
*added features for test analysis
 +
*Mylyn integration
 +
 +
| <br>
 +
*see Jubula cons
 +
| <br>
 +
 
|-
 
|-
! [http://wiki.eclipse.org/SWTBot SWT Bot]  
+
! [[SWTBot|SWT Bot]]  
 
|  
 
|  
 
EPL  
 
EPL  
  
 
|  
 
|  
No
+
[http://wiki.eclipse.org/SWTBot/Recorder Yes ]
  
 
|  
 
|  
*eclipse project in incubator, still being improved  
+
*eclipse project, still being improved  
 
*easy API, simple to get started with  
 
*easy API, simple to get started with  
 
*open source, hosted at eclipse.org  
 
*open source, hosted at eclipse.org  
Line 175: Line 204:
  
 
|  
 
|  
*poor documentation, one example on wiki, only javadocs
 
 
*some major loss of function, e.g. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=259908 259908], some have workarounds  
 
*some major loss of function, e.g. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=259908 259908], some have workarounds  
 
*long responses on important bugs e.g. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=259908 259908] and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=271132 271132]  
 
*long responses on important bugs e.g. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=259908 259908] and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=271132 271132]  
 
*cannot test native dialogs (File Dialogs, Color Dialogs, etc) see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=164192 164192]
 
*cannot test native dialogs (File Dialogs, Color Dialogs, etc) see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=164192 164192]
 +
*Compatibility issues with Eclipse 4.2.
  
 
|  
 
|  
*Leverages SWT/Eclipse capabilities to "perform" most operations. Support for new things is highly dependent on capabilities offered by SWT/Eclipse {{bug|164192}}
+
*Leverages SWT/Eclipse capabilities to perform most operations. Support for new things is highly dependent on capabilities offered by SWT/Eclipse {{bug|164192}}
  
 
|-
 
|-
Line 210: Line 239:
  
 
|  
 
|  
?
+
Yes
  
 
|  
 
|  
 
*looks nice and powerful  
 
*looks nice and powerful  
 
*got nice features
 
*got nice features
 
+
*excellent screenshot visualiser identifies and highlights both mapped and unmapped UI components with mouse-over
 +
*scripts in various languages (VBScript, JScript, DelphiScript, C++Script, C#Script)
 +
*command-line support, see [http://smartbear.com/support/viewarticle/10998 TestComplete Command Line]
 
|  
 
|  
 
*is implemented using COM technology  
 
*is implemented using COM technology  
 
*works only on Windows
 
*works only on Windows
 
+
*RCP application launched from TestComplete test did not exit cleanly, zombie process remained.
 
| <br>
 
| <br>
 
|-
 
|-
Line 230: Line 261:
  
 
|  
 
|  
Waiting for an evaluation copy, please update if you already use it
+
*lots of nice features
 +
*tests SWT, Swing, Web, and a lot more
 +
*scripts in various scripting languages (JavaScript, Python, Perl or Tcl)
 +
*support for native dialogs
 +
*good documentation
 +
*responsive technical support
 +
*Eclipse and Ant integration
  
 
|  
 
|  
Waiting for an evaluation copy, please update if you already use it
+
*component recognition doesn't seem to handle JFace widgets very well; getting any script to work involves a lot of trial and error
 +
*their symbolic object naming strategy is very unclear; component names can even change in the same script
 +
*expensive: [http://www.froglogic.com/squish/gui-testing/prices-and-licensing/named-user-licensing.php 6900 euro] for single edition license
  
 
| <br>
 
| <br>
 +
|-
 +
! [http://www.xored.com/q7 Xored Q7]
 +
|
 +
* Commercial
 +
* Free Community Edition
 +
 +
|
 +
Yes
 +
 +
|
 +
* Designed specially to test Eclipse-based apps - plugins
 +
* Supports SWT/JFace, Platform, IDE, GEF, and GMF
 +
* Contexts for AUT state modeling
 +
* Let you to run any subset of your tests in any order
 +
* Realtime Eclipse code instrumentation and [http://www.xored.com/q7/discover/runtime-intelligence Runtime Intelligence]
 +
* Modern Eclipse-based IDE
 +
* BDD-style scripting language ([http://www.xored.com/q7/discover/ecl Eclipse Command Language])
 +
* Maven/Tycho plugin, Ant/CLI tool, and Q7 Server to distribute test runs in the Cloud
 +
* Works on OSX 64, Linux 32/64, Window 32/64
 +
* Eclipse 3.5-3.7
 +
|
 +
 +
|
 +
* 1200 USD per Floating License.
 +
|<br>
 
|}
 
|}
  

Revision as of 09:18, 29 November 2013

The Eclipse Platform is tested during every build by an extensive suite of automated tests. These tests are written using the JUnit test framework. This page contains links to information about how to run and create automated tests for the platform.

Contents

Correctness tests

The majority of automated tests are testing for program correctness. A test failure on these tests implies that program behaviour is not as expected by the tests.

Getting the required bundles

Check out the test plugin containing the tests you want to run, along with any prerequisite plug-ins. Here are some plug-ins you will likely need:

  • org.junit - The JUnit test framework
  • org.eclipse.test - The basic infrastructure for running Eclipse tests
  • org.eclipse.core.tests.harness - Various utility pieces used by many tests
  • org.eclipse.core.tests.runtime - Tests for the runtime component
  • org.eclipse.core.tests.resources - Tests for the resources component
  • org.eclipse.ui.tests.harness - Various utility pieces used by UI tests
  • org.eclipse.ui.tests - Tests for the Eclipse UI

Running tests from within Eclipse

Correctness tests can be run from within the Eclipse IDE using a "JUnit Plug-in Test" launch configuration:

  1. In the Package Explorer, select the test or test suite you want to run. Each test package typically contains a TestSuite class that contains all the tests in that package. Suites from multiple packages are then aggregated into higher level suites. Here are some useful suites to know about:
    • org.eclipse.ui.tests.UiTestSuite - runs all UI tests
    • org.eclipse.core.tests.runtime.AutomatedTests - runs all runtime tests
    • org.eclipse.core.tests.resources.AutomatedTests - runs all resource tests
  2. Select Run > Run...
  3. Choose the "JUnit Plug-in Test" category, and click the button to create a new test
  4. On the "Main" tab, select the appropriate application for that test. Here are some important applications to know about:
    • [No Application] - Headless Mode - for running headless core (runtime, osgi, resource) tests
    • org.eclipse.ui.ide.workbench - for running UI tests
  5. Click Run.

Using EasyMock

In the Eclipse Galileo release the utility EasyMock was added to the platform test framework. EasyMock is used to create fake implementations of objects in order to test units of functionality in isolation from other objects. See the EasyMock documentation for more details.

To use EasyMock in your tests, simply load the org.easymock bundle from the Orbit repository. There is a convenience easymock.psf project set file in the org.eclipse.test bundle to facilitate loading of this bundle.

Note that EasyMock requires Java 5 or greater. You will not be able to run tests on JDK 1.4 or earlier if you are using EasyMock.

Support for JUnit4

During the Helios release the platform is moving to support JUnit4 in the test framework in addition to JUnit3. For more details on this transition see Eclipse/Testing/JUnit4 Changes.

Testing on Java 7

In some Java 7 implementations, the order of methods returned by java.lang.Class#getDeclaredMethods() is not consistent across runs. This method is used by JUnit to discover test methods, which means test order may change across executions. Generally each test method should be coded to not depend on test execution order, which also makes it easier for people to run individual tests when debugging and get consistent results. In some rare cases separate tests rely on each other, in which case you can use the test suite to hard-code a test execution order. There is also a convenience class OrderedTestSuite.java that you can use or copy for this purpose.

Session tests

Session Tests in Eclipse are tests that require that a new Eclipse session be launched for every test case run. Thus, they have additional requirements regarding controling the environment test cases are run (VM, set of plug-ins available, configuration, instance location, command line parameters) and how results are communicated back to the test runner.

Performance tests

See the Performance Tests How-to

Profiling performance tests

It can be very useful to capture profiling data for performance tests, to help track down where the time is going. To ensure you are profiling exactly the same code paths that are running in the automated performance tests, you can attach a headless profiler to the performance tests within the test suite. Here are steps to attach a headless YourKit agent to a performance test. The resulting snapshots can later be opened for analysis from the YourKit client:

  1. Download the tests for the build you are interested in (available from same download page as the build itself).
  2. Unzip the test framework, and follow the instructions in the readme.html to configure your tests
  3. Create a properties file (let's say profile.properties) with the following contents:
 extraVMargs=-agentlib:yjpagent=sampling,onexit=snapshot
  1. Invoke the performance test and specify the properties file location:
 runtests "-Dtest.target=performance" -properties profile.properties <yourtarget>

If your performance test is a session test, a more complex spell is needed in your profile.properties file:

 extraVMargs=-Dsetup.override.vmArgs=agentlib:yjpagent==sampling,onexit==snapshot

This instructs the Session Tests framework to specify the provided vm arguments on each nested invocation that runs the session test. Note the session test framework override mechanism requires escaping '=' characters with '==', separating multiple arguments with a ';' character rather than a space, and omitting the leading '-' character.

The above options will instruct the profile agent to start CPU sampling immediately on startup, and to save a performance snapshot on exit. YourKit supports various other options for configuring the headless profile agent.

API tests

The Eclipse project also runs an suite of API tests during builds. These tests capture problems such as breaking API changes, and correct evolution of bundle version numbers. For more details on these tests, refer to PDE/API_Tools.

UI tests

The table below gathers pros and cons of tools making UI testing easier. It should help developers to choose the most appropriate tool.

UI testing tools
Tool License Recorder Pros Cons Remarks/Comments
Window Tester

Available for free from Google

Yes

  • Stable
  • creates JUnit tests, can be launched along with other tests
  • easy API
  • good documentation
  • OpenSource
  • very easy to modify generated code
  • large footprint when creating tests (around 60MB for WindowTester plug-ins)
  • sensitive for focus changing, very hard to debug these UI tests (i.e. changing focus to the host Eclipse causes exceptions)

QF-Test

Commercial, free license available for Open Source projects

Yes

  • very robust test automation based on "soft" events at Windows/Gtk level
  • support for native dialogs like FileDialog
  • excellent component recognition, including automatic naming for Eclipse/RCP components
  • supports testing combined SWT/Swing applications
  • tests are batch and thus ant-runnable producing a detailed run-log and XML and HTML reports
  • Jython or Groovy scripting available
  • comprehensive manual and tutorial available online; mailing list with searchable archive
  • very responsive support
  • Eclipse/SWT support limited to Windows and Linux, both x86 and x86_64, Solaris Gtk support available but no Mac
  • QF-Test is Java application but not integrated into Eclipse
  • tests don't compile to JUnit
  • replaces the org.eclipse.swt plugin (corresponding patches are available, could be applied automatically as part of daily builds)
  • also supports GEF/GMF
  • also supports web testing
Jubula

Open Source

Tests specified by drag & drop without need to record.
Recording is possible as well.

  • Supports Swing, SWT/RCP/GEF and HTML applications
  • Works on Windows, Unix/Linux and Mac
  • Black-box testing - no source code needed to execute tests
  • Robust, high level test automation without any coding effort
  • Incorporates best practices of software development into tests
  • Suitable for agile processes because tests can be written before an app is available
  • Robust object recognition heuristic
  • Tests can be run from command line for continuous integration
  • tests don't compile to JUnit
  • does not support combined SWT/Swing applications
  • not extendable without knowledge about RCP-Programming
  • few elements missing, like loops and if-conditions

GUIdancer

Enterprise edition of the Jubula project

See Jubula

  • see Jubula pros
  • added features for test analysis
  • Mylyn integration

  • see Jubula cons

SWT Bot

EPL

Yes

  • eclipse project, still being improved
  • easy API, simple to get started with
  • open source, hosted at eclipse.org
  • small tool, less than 1 MB (including source)
  • very modular, good test coverage, easy to contribute fixes and enhancements
  • some major loss of function, e.g. 259908, some have workarounds
  • long responses on important bugs e.g. 259908 and 271132
  • cannot test native dialogs (File Dialogs, Color Dialogs, etc) see 164192
  • Compatibility issues with Eclipse 4.2.
  • Leverages SWT/Eclipse capabilities to perform most operations. Support for new things is highly dependent on capabilities offered by SWT/Eclipse bug 164192
Automated GUI Recorder

EPL

Yes

  • ability to provide your own Widget Resolver
  • open source
  • seems pretty stable, used by TPTP to do UI tests
  • large footprint when creating tests (probably around 50MB - TPTP Platform and TPTP Test Tools)
  • test descriptions only in XML, verification points in Java can be added though
  • didn't find any way to test absence of a dialog
  • can't run tests in debug mode
  • provided as is (because IBM pulled resources out of TPTP)

TestComplete

Commercial

Yes

  • looks nice and powerful
  • got nice features
  • excellent screenshot visualiser identifies and highlights both mapped and unmapped UI components with mouse-over
  • scripts in various languages (VBScript, JScript, DelphiScript, C++Script, C#Script)
  • command-line support, see TestComplete Command Line
  • is implemented using COM technology
  • works only on Windows
  • RCP application launched from TestComplete test did not exit cleanly, zombie process remained.

Squish

Commercial

Yes

  • lots of nice features
  • tests SWT, Swing, Web, and a lot more
  • scripts in various scripting languages (JavaScript, Python, Perl or Tcl)
  • support for native dialogs
  • good documentation
  • responsive technical support
  • Eclipse and Ant integration
  • component recognition doesn't seem to handle JFace widgets very well; getting any script to work involves a lot of trial and error
  • their symbolic object naming strategy is very unclear; component names can even change in the same script
  • expensive: 6900 euro for single edition license

Xored Q7
  • Commercial
  • Free Community Edition

Yes

  • Designed specially to test Eclipse-based apps - plugins
  • Supports SWT/JFace, Platform, IDE, GEF, and GMF
  • Contexts for AUT state modeling
  • Let you to run any subset of your tests in any order
  • Realtime Eclipse code instrumentation and Runtime Intelligence
  • Modern Eclipse-based IDE
  • BDD-style scripting language (Eclipse Command Language)
  • Maven/Tycho plugin, Ant/CLI tool, and Q7 Server to distribute test runs in the Cloud
  • Works on OSX 64, Linux 32/64, Window 32/64
  • Eclipse 3.5-3.7
  • 1200 USD per Floating License.

The table is in progress. Feel free to update it, if you know useful features or serious limitations of the mentioned tools. You are also welcome to add new tools.

More we know about those tools, easier to choose the best one.

Notes on what you should be evaluating on

  • CI support -- ability to run tests from command line/ant
  • Cross platform support -- developers use a variety of platforms -- windows, linux, mac
  • Scripting capabilities -- vendor script/Java/jruby ?
  • Reporting capabilities -- html/xml/push to database ?

Back to Eclipse Project home