Download - Fast unit tests for Eclipse Plugins
FAST UNITS TESTS FOR ECLIPSE PLUGINS Possible architectures and available tooling
Aurélien PupierSenior Software Engineer9th June 2016@apupier
2 / 26
What happened?
●h
ttp
://w
ww
.co
mm
itstr
ip.c
om
/en
/20
16
/03
/15
/ho
w-t
o-o
ptim
ise
-yo
ur-
time
-as-
a-c
od
er/
3 / 26
Response Time Limits
0 5 10 15 20 25 30 35
s
JUnit Plugin with Workbench
JUnit Plugin Headless
JUnit
user's flow of thought broken
1 Sec
lost the user's attention
10 Sec
4 / 26
Objective
Stay Focused
5 / 26
In our case...
Fast feedbackfrom (unit) tests in IDE
6 / 26
Time to launch Tests
0 5 10 15 20 25 30 35
s
JUnit Plugin with Workbench
JUnit Plugin Headless
JUnit
7 / 26
Plain JUnit Tests for plugins
Several possibilitiesNo consensus
8 / 26
Architecture possibilities
src
src/test/java
src
src/test/java
src/test/javasrc
src src/test/java
9 / 26
User Library inside plugin
src
11 / 26
User Library inside plugin
src
src/test/java
12 / 26
User Library inside plugin
● Clean Runtime
● Small tests
● Build time
● Fragment test
● No third-party:
–
–
– Your test toolkit
13 / 26
Optional dependency inside plugin
src
14 / 26
Optional dependency inside plugin
src
src/test/java
15 / 26
Optional dependency inside plugin
● Third-parties:
–
–
– Your test toolkit● RCP application not
planned to be extended by third-parties
● Pollute runtime!
16 / 26
Fragment
src
17 / 26
Fragment
src/test/javasrc
18 / 26
Fragment
● Clean runtime
● Third-parties:
–
–
– Your test toolkit● Most powerful with
clean runtime
● > Built-time
● Repository Complexity
● Test fragments
19 / 26
Test plugin
src
20 / 26
Test plugin
src src/test/java
21 / 26
Test plugin
● Third-parties:
–
–
– Your test toolkit● Single plugin for
integration tests
● Pollute runtime!
● > Built-time
● Repository Complexity
● Package scoped
22 / 26
Architecture possibilities
src
src/test/java
src
src/test/java
src/test/javasrc
src src/test/java
23 / 26
All tests are important!
We talked here
25 / 26
Tooling demo
https://github.com/apupier/EclipsePlugins-Testing
26 / 26
Going further
● Test classpath supported by PDE and Tycho?
● Pre-mocked E4 Context?
● MoreUnit automatic configuration support?
● Fast Integration/UI tests continuous feedback?
Go Continuous Test
@apupier
28 / 26
References
● https://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/
● https://resheim.net/2014/12/unit-testing-eclipse-rcp-applications.html
● https://www.nngroup.com/articles/response-times-3-important-limits/
● http://www.commitstrip.com/en/2016/03/15/how-to-optimise-your-time-as-a-coder/