Skip to Main Content
Applied Software Project Management
book

Applied Software Project Management

by Andrew Stellman, Jennifer Greene
November 2005
Beginner to intermediate content levelBeginner to intermediate
324 pages
13h 21m
English
O'Reilly Media, Inc.
Content preview from Applied Software Project Management

Unit Testing

Before a build is delivered, the person or program building the software should execute unit tests to verify that each unit functions properly. All code is made up of a set of objects, functions, modules, or other non-trivial units. Each unit is built to perform a certain function. The purpose of unit testing is to create a set of tests for each unit to verify that it performs its function correctly. Each unit test should be automated: it should perform a test without any input or intervention, and should result in a pass (meaning that the test generated the expected results), failure (the results of the test differed from what were expected), or error (meaning the code reached an error condition before the test could pass or fail). Many people require that unit tests have no dependencies on external systems (networks, databases, shared folders, etc.).

Automated unit testing is a stepping stone to test-driven development . Test-driven development is a programming technique in which a programmer writes the unit tests before he writes the unit that they verify. By writing the tests first, the programmer ensures that he fully understands the requirements. It also guarantees that the tests will be in place, so that they aren't left until after all of the other programming activities are completed (and then possibly dropped, due to schedule pressure).

The main activity in unit testing is creating test cases that verify the software. A test case is a piece of code that verifies ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Project Management for IT-Related Projects, 3rd Edition

Project Management for IT-Related Projects, 3rd Edition

Bob Hughes, Roger Ireland, Brian West, Norman Smith, David I. Shepherd

Publisher Resources

ISBN: 0596009488Errata