Question

I am trying to be a "good" programmer and have unit tests for my ColdFusion application but haven't been able to find a code coverage tool that can tie into the test that I'm using. For those of you who do unit tests on your ColdFusion code, how have you approached this problem?

Was it helpful?

Solution

Many have asked, but to date there remains no ColdFusion code coverage tool.

The latest ColdFusion features .NET integration in addition to J2EE integration, so if you require code coverage metrics (ie, customer requirements) then (aside from choosing something other than ColdFusion) you might define what parts need such coverage and break them out into .NET or J2EE objects which you can profile with readily available tools.

Alternately, you can do some analysis yourself - use a parser to insert cftrace tags after every control statement and then parse the results.

Lastly, ColdFusion does have some basic stack trace ability - I don't know if it goes deeper than that, but it's worth exploring to see what you can parse from that.

I hope this helps!

-Adam Davis

OTHER TIPS

With ColdFusion Builder you can use Rancho for code coverage.

http://forta.com/blog/index.cfm/2012/5/25/ColdFusion-Code-Coverage-With-Rancho

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top