General goals
- Provide a simple unit testing framework focused on server side java code which tries to cover all J2EE component models and potentially other type of components.
- Try to be the preferred Jakarta unit testing framework. This may mean providing specific extensions to ease writing unit test for Jakarta frameworks (like for Struts, Turbine, ...),
- To be the framework of reference for in-container unit testing strategy
Medium terms goals and ideas
The short term goals for Cactus are to continue providing and improving support for J2EE unit testing. More specifically the following areas are being considered and researched:
- Add support for Servlet API 2.4/JSP 1.4 (by using Tomcat 5/Resin 3.x),
- Provide a full servlet container test suite a la Watchdog using Cactus.,
- Performance unit testing: Add performance extensions to be able to test each single method in performance.
- More tutorial on AspectJ testing. Potentially add a Cactus Aspect extension to allow writing test cases as Aspects (this may allow to remove the need for Cactus redirectors).
- Add EJB Redirectors to be able to unit test Session Beans, Entity Beans and MessageDriven Beans
- Decouple the Cactus framework into the core and its "plugins". This means to publish a public API and a public SPI. The SPI would allow to support plugin for testing different type of components (Servlet, Entity EJB, Struts Action, etc).
Long term vision
The Future of Component Unit Testing
We believe unit testing server side components is going to get harder and harder in the future, unless something is done about it! Even now, depending on the specifications for a given component model it is more or less easy. Sometimes it is even not feasible to test all kind of code.
We believe that we will see more and more components in the future. By components we mean pieces of code that execute in a container. The container will provide more and more services for the components (like transactions, security, life cycle, persistence, interfaces - like web services -, logging, ...). The consequences will be:
- testing strategies that are not in-container, like Mock Objects will still very useful but will provide less added value in ensuring that the code behaves ok. Indeed, as the components will rely more and more on the container's services, the confidence that the tests will run well when deployed will decrease and the need for a solution that ensures the code will run correctly in it's environment will increase,
- it will become more and more difficult to offer an in-container unit testing framework that lives outside the container.
Long term goals for Cactus
Consequently to the above predictions, there are 2 long term goals for Cactus:
- Continue with the in-container approach as much as possible. It is a best try effort in order to provide tests in which you can have a good confidence,
- However, we believe the only satisfactory and long term solution is to include (unit) testing APIs as part of the container specifications. This could be done in the form of a SPI (Service Provider Interface) against which a generic unit testing framework could be plugged, thus leaving the implementation details to an external framework and only providing maybe a generic and simple implementation. Thus, the goal of Cactus will be to help specify needed container API/SPI for unit testing, i.e. create an additional service of the container: a "unit-testing service" (in addition to the existing Security, Transaction, Life Cycle, ... Services). As Cactus and Tomcat projects are both hosted on Jakarta it might be a good test ground for this kind of work. Of course, the first step would be to convince Tomcat developers that unit testing (and testing in general) is indeed a need to be addressed in the container itself. The ultimate goal will be reached when this new API/SPI is accepted and become a de jure standard. It would then be time to think about integrating it into the Servlet Specifications (or other components -like EJBs - specifications). Agreed, this far-streched at the current time but it is the Cactus vision !
Feedback needed !
Cactus is an open source project where everyone is free to participate (and even encouraged). Thus, we'd really like to have your opinions on the subject of Cactus future.
How do you view the future of Cactus?
Do you like the goals and vision defined above?
Please send all answers to the Cactus mailing list.
Thanks.