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