Google Summer of Code 2010: Project

"Automated webapp tests for MyFaces core + extensions"

Student: Cosmin MARTINCONI < cosmin.martinconi AT codebeat DOT ro>

Organization : Apache Software Foundation

Mentors : Jakob Korherr < jakob.korherr AT gmail DOT com >, Gerhard Petracek < gerhard.petracek AT gmail DOT com >

Abstract:

MyFaces uses JUnit testing framework for automated testing in MyFaces Core. JUnit provides a simple and elegant way to write tests that check their own results and provide immediate feedback. Written by developers, MyFaces JUnit tests increase the stability of the software. MyFaces also provides a test-webapp used for testing.

Despite the benefits of the solutions used for Core testing, there are some drawbacks. JUnit uses to much Mock classes, and the tests are not able to run against the “real” classes, hence these solutions cannot be used for testing extensions. Another issue concerns the need of a complete integration testing, which JUnit alone can not provide.

The test-webapp for the MyFaces core is a good solution but still if we want to test everything, we have to check each page manually.

Vision:

The goal of this project is to address the issues presented above and to come with the best ideas, solutions and implementations for improving automated tests for MyFaces core and extensions.

In order to achieve this goal, the current test cases have to be reconsidered so that they can address both unit and integration testing; in this way complete testing is reached instead of having only parts of the implementation covered. Within this project, the mock classes used in the JUnit tests will be replaced by tests that use the actual managed beans, the FacesContext, EL Expressions, and the internal JSF component tree. The solution proposed consists in a dedicated and fluent API, in order to write this test cases.

The new test cases will examine both the parsed HTML output and the JSF internals. The solution will allow tests to be run against MyFaces Core but also Mojarra and other extensions.

Another important benefit that this project will provide is the ability to use the testing API for any JSF application testing. As mentioned, this solution will address MyFaces Core but also existing extensions, which means that it can be used for automated testing of any sample application. Users can use the API for testing there own JSF applications.

Implementation:

In order to do so, the main purpose of this project is to find the best-fitting test framework, integrate it with MyFaces Core in a well defined API, provide rules and how-tos and define some test cases in a real webapp. MyFaces Core will then be able to be tested at build time with maven. Further more, the testing frameworks considered are Canoo WebTest, HttpUnit and Arquillian. Selenium framework could have been a solution, but the main problem with it is that you need a browser to run the tests in order to work. We want to be able to include the tests in every maven build and thus also on the Apache build server and we can't use a browser there, so that excludes Selenium.

Deliverables:

Weaknesses:

The large number of test cases needed for MyFaces Core and eventual extensions cannot be covered in a consistent matter within this three months period GSoC project, though it will provide an overview of how to use and write efficient and fluent test cases.

Criteria:

This project will follow the guidelines of the Apache Foundation.

Timeline:

Google:

Project:

April 27 – May 10

Detail study of the current tests implemented for MyFaces Core. Read, study and evaluate the alternative testing frameworks.

May 11 – May 23

Determining the best framework to be used for the projects API. Begin discousions regarding the API architecture.

May 24 – June 7

Establish a final architecture structure for the testing API. Create the project structure and doing initial work. Initial integration of the chosen framework with MyFaces project

June 8 – July 5

Implementation of the actual testing API, for providing an easy and fluent way to write test cases. Provide rules and how-tos in working with the API, in a well-defined documentation.

July 10 – July 12

Preparing for mid-term evaluation: establish a intermediary version of the projects testing API; prepare and organize the milestone release.

July 13 – July 20

Adjust and finalize the API implemented. Start working on the webapp-test structure and implementation.

July 21 – August 8

Working on the webapp implementation for Core MyFaces testing. Writing test cases for the new automated testing of the Core. * August 9 – August 14 Finalize the webapp work, and concluding the provided test suites. Improving the documentation.

August 15 – August 16

Preparing for final evaluation and getting the final release ready.

Additional Information:

Links:

https://issues.apache.org/jira/browse/MYFACESTEST-6

http://markmail.org/thread/mx5pvpug3woazhzc

http://markmail.org/message/eo4gtftyxtvpezan

Background:

I graduated the “Politehnica” University of Timisoara, Romania, Department of Computer Science. I am in my 1st year of study in the master program: “Master of Information Technology”.

Since August 2009, I have been working for Codebeat, the subsidiary of IRIAN, which is the main contributor in the Apache MyFaces project. Regarding my activity in Apache MyFaces, I can mention bug reports and patch provided for some issues. The main project I was working on is Trinidad, for which I worked on creating a new show-case, that illustrates the new skin introduced, Casablanca.

I am a big open source fan and supporter.

Commitment:

Currently, I am working full time, but the company I am working for supports me with this project and is directly involved with MyFaces.

I guarantee that I can work 30 hours/week on my project.

GSoC2010_AutomatedTests (last edited 2010-04-09 08:09:14 by CosminMartinconi)