Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: AW: [jwt-dev] Tests and unit testing in JWT ?

Hi all,

Here are some of my thoughts about testing.

JWT does not currently integrate automated tests. That will imply to spend some time debugging what we currently have in the future. However, it is too late to change it, so that there is no interest in adding tests now. Alexandre Boutin spoke about a "technical debt". Actually, that means that when we write code without tests (even when the code works) we will have to spend time debugging later, for example we will modify it. With this approach we can consider that JWT has a debt that will have to be paid in the future. What we can do now is to prevent this debt from become larger and larger. If we let this debt become too large, one day we won't be able to pay it (and then the project won't be extensible or maintainable any more). The strategy with the current debt is to pay it when necessary, that means when modifying current code.

This comparison with a debt is interesting. I admit it is very "business-oriented", and that it is not perfectly convenient with JWT, but I think that what he calls a debt is equivalent to the ability to progress in our case. Indeed, if the "debt" becomes too big, JWT won't attract other committers (because coding in JWT will become a difficult puzzle, and will require more time), won't react quickly enough to new use cases, and won't go ahead. Tests anticipate this situation.

About bugs, we can consider that "1 bug fixed = 1 patch + 1 automated test". This could become a convention before closing a bug in the bugzilla.

About testing the UI... Maybe there is nothing to allow this now. But we can still try... ;) We can at least write some unit tests with classes that are independent from Eclipse runtime. We can also learn how to write mock classes to replace Eclipse runtime.

I'll try to find some interesting things about continuous integration and automated tests in PDE. And I promise my next commit will contain some tests!

Best Regards,

Florian Lautenbacher a écrit :
Hi Marc,

thank you for this post. Yes, you are right - currently there are no tests
for JWT WE (I made a few of them myself, but actually I'm not an expert in
how to write tests, especially for graphical modeling environments such as
GEF). I'll read through the chapter of the Gamma & Beck book and will have a
look whether we can start implementing some tests without neglecting the
next features and fixing bugs...
Any assistance here is of course always welcome :-)

I agree with you (and Alexandre Boutin) that at least every time something
has been broken, one should add some tests after fixing it in order to make
sure it won't break again.
Best regards,

-----Ursprüngliche Nachricht-----
Von: jwt-dev-bounces@xxxxxxxxxxx [mailto:jwt-dev-bounces@xxxxxxxxxxx] Im
Auftrag von Marc Dutoo
Gesendet: 30 April 2008 15:31
An: Java Workflow Toolbox
Betreff: [jwt-dev] Tests and unit testing in JWT ?

Hi all

The issue of tests and how to do unit testing in JWT is of interest for the
core development team as well as anybody wishing to use JWT for his own

So what do you think about tests and unit testing in JWT ?

As a starter, I've tried to compile a few answers here - feedback welcome !

JWT tests status :
   * none in WE, many but not yet automated in Transformations, junit tests
in runtime parts (but their impl is generally not jwt per se since not
available on eclipse because of license issues)

Unit testing
   * for unit tests of eclipse plugins, use pde.junit plugin (from jdt ui
page). In addition to executing junit tests, it takes care of initializing
an eclipse workspace, as required by eclipse plugins.
   * "httpunit-like" tools are scarce and far from useful in the field of
heavy client UIs. Some of my colleagues had a little bit of experience with
such IBM tools targeting Swing UIs back then, and say that writing tests was
far more cumbersome and long than writing the UI itself -_-
   * hence nothing car replace functional testing (test plans etc.) to know
a UI is not broken in use or impl - though a good architecture (like emf -
gmf - extension points - common patterns etc.), development and integration
methodology, limits risks.
   * more about testing eclipse plugins : see the excellent gamma & beck
book, and especially its chap12 that is freely available here

So what if you want to make your own tooling by extending JWT, and you'd
like to have some level of trust in the fact that a given release of JWT is
not broken, or that your extensions are not breaking it ? According to
Alexandre Boutin (main french advocate of Lean Programming),
   * it would not be business-savvy to spend time writing tests for existing
code. If code exists without tests and you trust it, use it so.
   * But if it breaks at some point, then add tests ensuring it won't break
the same way anymore.

jwt-dev mailing list

jwt-dev mailing list

Back to the top