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.

system testing vs. unit testing<br />

#4. System tests vs. unit tests<br />

In chapters 7 and 8, you learned how to build testing and continuous integration<br />

into your development process. Testing is one <strong>of</strong> the key tools you have to prove that<br />

your code works and meets the requirements set by your customer. These two<br />

different goals are supported by two different types <strong>of</strong> tests.<br />

440 Appendix i<br />

Unit tests test your CODE<br />

Unit tests are used to test that your code does what it should. These are the<br />

tests that you build right into your continuous build and integration cycle, to<br />

make sure that any changes that you make to code don’t break these tests, on<br />

your code and the rest <strong>of</strong> the code base.<br />

Ideally, every class in your s<strong>of</strong>tware should have an associated unit test. In fact,<br />

with test-driven development, your tests are developed before any code is even<br />

written, so there is no code without a test. Unit tests have their limits, though.<br />

For example, maybe you make sure that calling drive() on the Automobile<br />

class works... but what happens when other instances <strong>of</strong> Automobile are also<br />

driving, and using the same RaceTrack object, too?<br />

System tests test your SOFTWARE<br />

System tests pick up where unit tests leave <strong>of</strong>f. A system test tests your<br />

code when it is integrated into a fully functional system. System<br />

tests are sometimes automated, but <strong>of</strong>ten involve someone actually<br />

exercising your entire system in very much the same way as the end<br />

user will.<br />

For example, you might fire up the GUI for monitoring a race, press the<br />

“Start Race” button, watch animated versions <strong>of</strong> cars spin around the track,<br />

and then initiate a wreck. Does everything work the way the customer<br />

expects? That’s a system test.<br />

Q: In addition to unit and system tests, aren’t<br />

there lots <strong>of</strong> other types <strong>of</strong> tests as well?<br />

A: Yes. Testing is a BIG field <strong>of</strong> work. There are<br />

various names for testing, conducted at anything from<br />

the source code level to enterprise s<strong>of</strong>tware integration<br />

level. For example, you may hear <strong>of</strong> acceptance tests.<br />

Acceptance tests are <strong>of</strong>ten conducted with the customer,<br />

where the customer either accepts or rejects your<br />

s<strong>of</strong>tware as doing what they need..<br />

Download at WoweBook.Com<br />

Unit testing is at a very<br />

low level... source files<br />

and XML descriptors.<br />

System testing looks<br />

at your application<br />

as a whole.<br />

Unit tests prove that<br />

your code WORKS.<br />

System tests prove that<br />

your s<strong>of</strong>tware meets its<br />

REQUIREMENTS.

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

Saved successfully!

Ooh no, something went wrong!