So you've brought up two types of testing - functional and unit. Unit testing is where you take an individual module and have some type of automated test sent at it to mimick how the unit would behave in use. An example of this is JUnit - a unit test framework in Java that will test an individual module of a program.
Functional testing is how does the system function when it's all plugged in? When it's set, ready to go, and taking input as a whole. Functional testing is the entire system - the OS, the application, the data, etc... This is usually done in a 'test' environment. Many companies have a 'production' environment where their actual systems reside - for instance this bulletin board forum Bytes has bytes.com. However, in the bytes.com office, there is another internal network separated from this one that has the same versions of software, roughly the same hardware, and is a place where they can test changes before they put them into the bytes.com mainpage. This is one example of functional testing. Other examples are testing different types of input, updates to any part of the system, etc...