[testbox-2.0.0] - Integrating into legacy-heavy application

Hey all.

We’re looking to start using TestBox for either TDD or BDD testing but we’re wondering how best to fit TB into our application which has a lot of hard to test code.

Some questions:

  1. To help test older code, is it OK for the testing to run “within” our application?

Going forward we’ll be looking at writing code that can more easily be tested and have less dependencies, but for now, our tests may need to rely on application setup code.

Are there any problems with running TB inside our application by either removing the Application.cfc files from TB or setting the application name accordingly?

  1. Do people generally create their own test page or use the runners in TB?

My plan, rightly or wrongly, was to have a structure like this:

app/
app/www/tests/testbox <–<< The TB install
app/www/tests/auto <–<< Automated UI testing
app/www/tests/index.cfm <–<< A page to run all tests including some non-frameworked ones
app/www/tests/lib <–<< A mirror of our components containing their tests

app/lib <–<< Our component library with code to be tested

Visiting http://ourApplication/tests currently results in success or failure of the non-frameworked tests. A status code of 200 or 500 is thrown too so we can test on build (Jenkins fires off a request and checks the response).

My thoughts to expand this was to add TB to this process and continue to pass or fail as above.

  1. Where are people generally putting their bundles, suites, tests etc?

Here’s hoping I’m not too far off the right track!

Thanks.

Adrian

Hi Adrian, welcome to TestBox! Your post got moderated, so I apologize for the slight delay in it appearing.

Quick question, is this a ColdBox application? I see the subject says “legacy” so I assume not, but just checking. The reason it matters is that ColdBox applications allow for nice integration testing that actually spins up the entire application to test handlers as they normally execute as opposed to a normal unit test that verifies a method in isolation.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Cheers, and no problem about the mod!

It’s not a CB app.

A

Adrian,

Did you ever get any responses to this, either online or offline?
I am also looking to use standalone TestBox with a non-CB app. Basically running tests in isolation against our component library, which are tightly coupled in the existing application.

I am very interested to hear about how you set it up and where the runners and test cases lived etc.

Cheers,
Ali