1 / 9

Making a GUI Test-first

Making a GUI Test-first. 9/30/04 Testing 2. Testing a GUI. Need to simulate mouse clicks, key presses, human uncertainty GUIs subject to change rapidly Potentially difficult to isolate GUI problems from logic problems. TDD’ing a GUI. Separate presentation layer from logic layer

lotus
Download Presentation

Making a GUI Test-first

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Making a GUI Test-first 9/30/04 Testing 2

  2. Testing a GUI • Need to simulate mouse clicks, key presses, human uncertainty • GUIs subject to change rapidly • Potentially difficult to isolate GUI problems from logic problems

  3. TDD’ing a GUI • Separate presentation layer from logic layer • Use interfaces to allow using mock objects • Start GUI early in project with basic functionality • Decide basic look & layout controls without functionality • Begin making tests • Control existence/enabling • Functionality (simple calls into layer)

  4. Brute Force • Create getters/setters for each control • Each test method gets access to the controls it needs and manipulates it • Do this all manually for every control and control interaction

  5. JFCUnit • Open-source package for testing Java GUIs • Two classes • JFCTestCase • JFCTestHelper • Helper class has ability to find controls by name or type • jfcunit.sourceforge.net • Astels’ example uses deprecated method calls (use website examples) • Eclipse plug-in doesn’t seem to work with v3.0

  6. Jemmy • Originally developed for NetBeans, now usable as stand-alone • Uses Operators to wrap controls • http://jemmy.netbeans.org

  7. Abbot • Recorder • Again, couldn’t find sign of abbot plugin in Eclipse 3.0 • http://abbot.sourceforge.net

  8. Ultra-Thin GUI • Create GUI which is just view into data • Use mocks for view to create logic layer • Use mocks for GUI to create presentation layer

  9. See also • http://c2.com/cgi/wiki?JavaGuiUnitTesting

More Related