More Test-Driven Development in Python
Subject:   Test Driven GUI Development?
Date:   2005-02-04 12:43:35
From:   russelllear
Much of what I'm working on now is in grabbing information from a database at a user's direction and presenting. Using test driven develpment with the database abstraction layers makes much sense.

And it probably makes sense to drive the GUI development similarly. I'm just now sure how that would be done.

In the MVC paradigm, is the "View" just left out of the testing?

Full Threads Newest First

Showing messages 1 through 1 of 1.

  • Test Driven GUI Development?
    2005-02-08 12:13:46  kumar303 [View]

    To my knowledge there is no easy, automated way to unit test an object that takes a textual input and outputs an image. however, there are still some approaches which will strengthen your application. First, a PHP "View" object of MVC, Savant, has this to say about eyeball unit testing. I have also done something similar when unit testing an object that used Image Magick to generate images.

    In case you have a GUI framework that your application is using (and you probably are unless you are writing in Assembler) then you will be able to do automated testing via expectations. You can take a mock object approach like PHP's SimpleTest (I believe this is based on JUnit mock objects). You would create a mock object for the interface of your GUI controller object and then set up expectations. For instance [I am making this up] :
    mockGUI.expectOnce('drawMenu', expectedParameters)
    ... in the test you would call your application's menuInit() method (or whatever) and the test would fail if the GUI object didn't make a call to drawMenu() with the correct parameters. Of course... for this to be effective you have to assume that the GUI library you are using is 100% functional :)