I've created a new and much improved CFC Stub Generator and want to see what people think of this idea. It will generate CFCs, unit tests (for CFUnit or CFCUnit), mock objects, test runners, ColdSpring XML, and ANT unit test build XML files from a simple text file.

You can download the code in the sidebar. I've also submitted an RIAForge project for it. To show how it works, I created a Connect presentation about using the CFC Stub Generator. Have a look and let me know what you think. Thanks.

(Quick aside since I don't think I explicitly mentioned it, you can get the CFCUnit facade for the unit testing tab in CFEclipse at Sean Corfield's blog.)

Comments Comments (10) | del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 6404 Views

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)

  • # Posted By Matt Williams | 5/16/07 10:12 AM

    Very nice Brian. I can see how this would be very useful. You may want to either include in the zip or make a separate zip of the sample code you did in the Connect Preso to help folks see what you did.

  • # Posted By Brian Rinaldi | 5/16/07 10:34 AM

    Interesting stuff. I was curious to see how it differed from my Illudium Generator. There is a pretty different methodology from the start since my tool works off database metadata. On the plus side, I am able to "guess" at far more of the internal code for the CFCs since there is much more information in the db metadata than in the text file. On the down side, I have not yet implemented generating unit tests or ANT scripts yet, though there are enhancement requests out there for things like this - just a matter of my time :)

    Nice work.

  • # Posted By Brian | 5/16/07 11:57 AM

    @Matt: hmmm....I could include the text file itself, but without seeing the preso or trying the code themselves, I'm not sure seeing the generated code would provide much help. You think it would?

    @Brian: yes this is very different from your Illudium generator (which I love). The CFC stub part is really the least useful part in my opinion, though it is helpful as a starting point. I think the automatic test creation is the really useful part. I could imagine some folks generating the stubs and just throwing away the CFC stubs and keeping the other stuff. It just depends on what you need and what other tools you're using. Thanks for having a look!

  • # Posted By Matt Williams | 5/16/07 2:05 PM

    I would say a separate file labeled as sample UML text file and code from Connect Presentation may make sense.

    On another note, shouldn't you follow Brian R.'s example of a cool name for this generator? Maybe ACME Unit Test Generator.
    j/k.

  • # Posted By Dave Shuck | 5/16/07 2:12 PM

    Brain, that is a nice demo and great thing to share with the community. Thanks!

  • # Posted By Sami Hoda | 5/16/07 4:29 PM

    Very Nice Brian!

  • # Posted By Robert Blackburn | 5/17/07 9:32 AM

    This is great Brian! And not only the CFC Stub Generator, which is great, but the presentation itself is a great example of how to use UML, CFML, unit testing, ANT together.

    When I have a chance I'll update CFUnit's web site to reference this tool and presentation, because I think it's something a lot of CFUnit users would find helpful.

  • # Posted By jim collins | 5/17/07 5:03 PM

    I'm so excited I'm going to skip happy hour so I can go straight home and try this out! You rock, brian!

  • # Posted By Woody | 5/18/07 7:36 AM

    Excellent presentation Brian and a really neat jump starter kit!

  • # Posted By kola | 5/20/07 5:00 AM

    Brian this is awesome - well done