Advertisement

06.06.2008 at 12:05AM PDT, ID: 23462876
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Testing a GUI with JUnit

Asked by sae1962at in Test / Validation Development Software, Java Programming Language

Tags: , ,

Hello!

I am new to JUnit, although I worked in a project for five month at one customer who uses the Test-Driven Development (TDD) paradigm. I was supposed to improve the code quality there, so I had no opportunity to get some experience.

The new customer I am now working for also uses JUnit & has a lot of GUIs. I will work on a client sofware, where the classes are most often graphical objects.

Testing a GUI is not easy, but I know that it is possible to test some part of functionality. I read several papers about testing GUIs (see below) that have given me some idea about the problems. But it is not so clear to me how to proceed in practice now.

The problem I have is that JUnit wants you to write classes, like

public class ArchivePageTest extends ListitBaseTest { ... }

where

public class ListitBaseTest extends TestCase.

But the classes I have to test are all extending a class called Page that is a part of the GUI, *and* most of the methods of the class are NOT public. So, I cannot write a test method, like testProtectedMethod1(), as TestCase does not extend the Page class.

I think that this is a common problem when testing a small part of GUI functionality. The larger part is to cover all the "wild" clicks that can be made on a GUI. But for the time being I am confident, if I could test the methods of the classes.

I asked the technical project manager, who said that it is good to make TDD, but it is not a must. I went through the code and saw that only non-GUI parts are currently tested with JUnit. So, the coverage of the functionality is not given, except a small percentage.

My QUESTIONs are:
1. Do you know about articles that address the problem of testing non-public methods in a graphical class? (50 points)
2. Do you have experience how to write JUnit tests in such a case? (150 points)

Thank you for your reply!

sae1962at

====================================================================
Notes:


Articles browsed through/read about this issue:
# Testing GUIs in an XP Environment [http://www.cs.umd.edu/~nada/cs-paper11.doc]
# Testing GUI Application (1997) [http://www.gerrardconsulting.com/GUI/TestGui.html]
# Sneak preview into SWTBot (SWT GUI testing tool)[http://www.dzone.com/links/sneak_preview_into_swtbot_swt_gui_testing_tool.html]
# GUI Testing FrAmewoRk (GUITAR) [http://www.cs.umd.edu/~atif/GUITARWeb/]

Start Free Trial
 
 
[+][-]06.06.2008 at 12:12AM PDT, ID: 21726830

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.06.2008 at 12:14AM PDT, ID: 21726840

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 12:18AM PDT, ID: 21726863

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Test / Validation Development Software, Java Programming Language
Tags: junit.org, JUnit, 3.8 or higher
Sign Up Now!
Solution Provided By: humanonomics
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.06.2008 at 12:18AM PDT, ID: 21726865

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.06.2008 at 01:21AM PDT, ID: 21727146

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 01:23AM PDT, ID: 21727159

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628