This paper extends basic software-testing theory to software components and adds explicit state to the theory. The resulting theory e enough to abstractly model the construction of systems from their parts (‘units’). It provides an unconventional insight into the relationship between testing units and testing systems. Experiments exploring the theory support the following conclusions: • Units should be independent, more like what are called “components” than subroutines or object-oriented classes. • Units’ persistent state should be local. • Units should be extensively tested. A new kind of system testing is proposed: Unit-test results are combined to approximate the system behavior. Testing the approximation is cheaper and easier than testing the actual system and more likely to expose system problems. Category and Subject Descriptor: D.2.5 Software engineering, Testing and debugging General Terms: Verification