Results 1 to 10 of 55

Thread: Unit testing time! Introducing VDFUnit, xUnit for Visual Dataflex

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Stord, Norway
    Posts
    876

    Default Unit testing time! Introducing VDFUnit, xUnit for Visual Dataflex

    Martin Fowler said about JUnit: "Never in the field of software development have so many owed so much to so few lines of code." (Introduction to xUnit Test Patterns)

    Others have also said it's something any reasonable programmer could produce in a weekend.

    So apparently, writing a unit testing framework is no big deal, because the hard thinking has already been done, thanks to Kent Beck and others.

    After devoting much time to listening to podcasts, reading about unit testing, and asking around a bit, I finally came round to having a go at writing a little unit testing framework for VDF. It is loosely based on NUnit, learning from Pragmatic Unit Testing in C# with NUnit.

    Thanks to my employer, Emma EDB AS, I'm allowed to share the code with you. It is very much a work in progress, and I'm open to suggestions and criticism.

    Open the "VDFUnit Testrunner Sample" workspace in VDF 15.0, and run the "VDFUnit TestRunner" project to try the sample tests provided. Currently, the Testrunner is set to run the tests automatically, so you don't have to push the "Run Tests!" button unless you want to run them again. The text box lists all the cTestfixture objects that are created in oVDFUnitTests.pkg, and turns green when the tests have been run successfully (or red if errors occurred).


    A few obvious features are planned:
    • Test categories, allowing sets of tests to be run at different times (e.g. slower-running "integration tests")
    • Non-GUI testrunner for automatic testing and logging (e.g. to be hosted on a Continuous Integration server).
    • More Assert messages
    Still, I believe VDFUnit can be used in its current form as a starting point for writing unit tests in VDF. The enclosed Zip file is made for VDF15, but it should work in VDF 12 and 14 as well.

    As a side note, you may be interested in the implementation of an iterator interface included in there as well.

    To learn more about unit testing, I particularly recommend checking out books, blogs, interviews, podcasts, and presentations by Kent Beck, Robert C. Martin, Michael Feathers, and Kevlin Henney.

    So feel free to check out the testing framework. All feedback is appreciated!
    Attached Files Attached Files
    Ola Eldøy (Twitter: @olaeld) - Developer at Emma EDB AS

Similar Threads

  1. Replies: 6
    Last Post: 21-Oct-2009, 12:07 PM
  2. Unit testing, anyone?
    By Ola Eldoy in forum Windows Applications
    Replies: 1
    Last Post: 23-Oct-2008, 06:11 AM
  3. Visual DataFlex 12.1 Beta 3 is now available for testing!
    By Stephen W. Meeley in forum Windows Applications
    Replies: 0
    Last Post: 1-Sep-2007, 09:33 AM
  4. Visual DataFlex 12.1 Beta 2 is now available for testing!
    By Stephen W. Meeley in forum Windows Applications
    Replies: 0
    Last Post: 24-Aug-2007, 05:45 PM
  5. Visual DataFlex 12.1 is now available for testing!
    By Stephen W. Meeley in forum Windows Applications
    Replies: 0
    Last Post: 25-Jul-2007, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •