Testing Eclipse plug-ins: Tips & Tricks

Subscribers:
24,000
Published on ● Video Link: https://www.youtube.com/watch?v=rGwu6VToVV8



Duration: 33:36
708 views
0


In this talk we want to share some tips and tricks on how to test Eclipse plug-ins at several stages during the development. In particular, we will show how to do without a running workbench (i.e., without “Plug-in tests”) and without functional testing frameworks (e.g., SWTBot) as much as possible, relying only on plain JUnit tests.
Indeed, many important parts of the components of an Eclipse plug-in can be tested with a plain JUnit test. Note that we are not talking only about core, non UI, parts: even those parts that need SWT or Jface (e.g., label and content providers, tree and table viewers) can be almost entirely tested without an Eclipse workbench (for most tests, you don’t even need a Display). With that respect, we will show some testing utility classes that can be reused in your projects. We will also show some examples of mocking to make tests cleaner and to be able to test even corner case situations. Using plain JUnit tests as much as possible has the huge advantage of making your software much easier and much faster to test (we’re talking about seconds instead of several minutes).
Then we will also show when to write “Plug-in tests”, in order to test the features that actually need a running workbench; in this case, we will follow a programmatic approach and we will then switch to a functional testing framework (e.g., SWTBot) only when we really need to test the actions that a user would perform on our Eclipse plug-ins. Even for functional testing, using, e.g., SWTBot, we will show some best practices for testing only your own plug-ins behavior.
Finally, we will also present some tips & tricks when testing with Maven/Tycho, especially if you want your tests be reproducible both in Eclipse and during the Maven build. We will also write (end-to-end) tests on a fully provisioned product (being that a custom Eclipse product or a standard Eclipse installation with our plug-ins installed). This will make sure that the features you deploy have all the needed dependencies so that your users will not have bad surprises.
The talk will use simple examples and all the techniques and source code will be easily reusable in other Eclipse projects.

Speaker(s):
Lorenzo Bettini (Dipartimento di Statistica, Informatica, Applicazioni, University Firenze)
Vincenzo Caselli (RCP Vision)
Francesco Guidieri (RCP Vision)