I'm replying via the website, since I don't subscribe to the feed, and I've 
never been sure if this gets sent out to the list via email or not, but anyway, 
I found your question very interesting.

In your question, you're saying, "We have this business process.  We have this 
software, which is supposed to implement the business process.  But, I don't 
trust that it does, so how can I verify that it is."

The statement, "We're not just concerned with whether or not the CFCs work..." 
is wrong.  If you don't trust your software to properly implement your business 
process, then you don't believe that your software WORKS."  Sure, it might not 
have any "compile-time" errors, or even any "runtime" errors, but does a 
calculator that sometimes returns 22 for 2+2 WORK?

Software is deterministic.  It only does what you program it to do.  You should 
be able to be sure about whether individual chunks of code WORK.  When you've 
done that for most of the chunks of code, you can be pretty sure the whole 
thing works.

So, what you're really looking for are, at the bare minimum, unit tests.

You mentioned TDD, but that's a methodology for developing software where you 
write your test first, then develop the solution to fulfill the test.

That doesn't mean you still can't use unit tests on already completed software.

If you have a function that is, based on certain input, supposed to provide 
certain output, then you can write a test for it.  You write a test for good 
input, you write a test for bad input, etc.  Once you're sure that function 
works, you move on to the next one.

It may seem like a daunting task, but if you do a little bit at a time, its 
doable.  And, the feeling you get when you've got some relatively solid test 
coverage is amazing.  You no longer fear making changes.

So, I've been out of the CF world for a bit, but I found MXUnit to be the 
standout test framework for CF.  I used ColdMock for creating mock CFCs 
(something you'll discover you'll need as you start writing tests).

Start by getting that working and writing a test for one of your functions in 
one of your CFCs.

If you find that you can't write tests for that function - its generally an 
indicator that the function is not well designed.  Its doing too much, etc.

You're going to write several tests for each function.  You're going to have, 
in the end, thousands of tests, but, when you're done, you'll be a lot closer 
to actually trusting your software to work properly.  Your software will also 
be much better in the end, because over the course of refactoring it to be 
actually testable, it will be cleaner, more maintainable, and most likely 
better performing..

>We are wanting to put some type of testing system in place here at
>work.  I know there's a ton of stuff out there, and I'm really at a loss
>as to where to start.  I'm not sure if any of the TDD
>frameworks are what we're after or not.  Our main concern right now is
>setting up something to help test our existing applications.  Here's a
>scenario of something we would be wanting to test:
>
>We have an automated process that checks for new orders that came in from 
>our
>website.  This process takes an order and checks each of the items in
>that order to see if we have it in stock or need to check 3rd party
>vendors.  If it needs to check the vendors, it begins going through a
>list of venders and hitting their APIs to see if they have the item.  In
>certain cases we may want to skip vendor 1 and order directly from
>vendor 2, or always order from vendor 3 without even looking at the others. 
> Once it finds the item it then instructs our system to place
>the order for the item with that vendor, and then it moves the order
>over to our accounting system.
>
>We're not just concerned with whether or not the CFCs work, we need to
>know that the correct vendor was selected for the correct item, the
>database records were updated with the correct values, we don't
>accidentally place the same order with 2 vendors, etc...  
>
>All that to say, what would be a good testing system to use with
>something like that? I'm open to any and all suggestions, even if it's
>something we have to purchase.  
>
>Thanks,
>
>Eric Cobb
>http://www.cfgears.com 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347131
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to