01.02.2013 Views

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

one-click testing<br />

Testing EVERYTHING with one step Well, one command actually<br />

There are lots more advantages to automating your tests. As well as not<br />

requiring you to sit there and manually run the tests yourself, you also build<br />

up a library <strong>of</strong> tests that are all run at the same time to test your s<strong>of</strong>tware<br />

completely every time you run the test suite:<br />

1<br />

2<br />

3<br />

248 Chapter 7<br />

Build up a suite <strong>of</strong> tests<br />

As your s<strong>of</strong>tware grows so will the tests that need to be applied to it. At first,<br />

this might seem a little scary, especially if you’re running tests by hand. Large<br />

s<strong>of</strong>tware systems can have literally thousands <strong>of</strong> tests that take days <strong>of</strong> developer<br />

time to run. If you automate your tests you can collect all the tests for your<br />

s<strong>of</strong>tware into one library and then run those tests at will, without having to rely<br />

on having somebody, probably a poor test engineer who looked at you wrong,<br />

running those tests manually for a day or so.<br />

Run all your tests with one command<br />

Once you have a suite <strong>of</strong> tests that can be run automatically in a framework, the<br />

next step is to build that set <strong>of</strong> tests such that they can all be run with just one<br />

command. The easier a test suite is to run, the more <strong>of</strong>ten it will actually be used<br />

and that can only mean that your s<strong>of</strong>tware quality will improve. Any new tests<br />

are simply added to the test suite, and bang, everyone gets the benefit <strong>of</strong> the test<br />

you have written.<br />

Get regression testing for free<br />

The big advantage <strong>of</strong> creating a one-command suite <strong>of</strong> tests that you continually<br />

add to as you add more code to your s<strong>of</strong>tware is that you get regression<br />

testing for free. Detecting when a new change that you’ve made to your<br />

s<strong>of</strong>tware has actually introduced bugs in the older code, called s<strong>of</strong>tware<br />

regression, is a danger for any developer working with old or inherited code.<br />

The best way to deal with the threat <strong>of</strong> regression problems is to not only run<br />

your own tests for your newly added code, but to run all the older tests as well.<br />

Now, because you’ll be adding your new tests into your test suite, you’ll get this<br />

for free. All you have to do is add your new tests to the existing test suite and kick<br />

things <strong>of</strong>f with one command—you’ll have regression tested your changes.<br />

Download at WoweBook.Com<br />

Of course, this relies on the<br />

existing code base having a<br />

suite <strong>of</strong> tests available for<br />

you to extend. Check out<br />

Chapter 10 for what to do<br />

when that isn’t the case.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!