Manual vs Automated Unit Testing

Instructor: David Gloag
You can't release anything to the public without a significant level of testing. In this lesson, we'll take a look at unit testing, what it means to manually and automatically perform it, and when you would use each.

Test to Ensure

Product quality is extremely important these days. To some, it's job one. And why not? Consumers are sophisticated. They can tell a piece of crap when they see it. For example, do businesses buy software that have problems right out of the box? Will they deploy software that is known to have bugs in it? Or will they use a piece of software that fails at inopportune times? Clearly, they won't. So how do software developers confirm their products meet expectations? How do they ensure their products will stand up to customer use? They employ testing strategies, of course. And the one that often starts things off is unit testing.

What is Unit Testing?

Unit testing is the process of testing programming code at the lowest level, most often the method, procedure, or function. Hence the name unit testing. The process looks at each unit as a self-contained entity, and tests it with that in mind. The idea being that if the pieces work properly on their own, they have a better chance of working together as expected. If you think about it, you assemble and test your home entertainment system in much the same fashion. You don't connect everything, and then pray. You assemble each piece, and then test. At each step, you add a new component, and test that it works. In the end, you wind up with a complete, working system. Unit testing works in a similar fashion.

What is Manual Unit Testing?

Manual unit testing is unit testing that is performed by hand. In other words, testing performed by people. You don't see this type of unit testing much these days, as it has a couple of significant drawbacks. They are as follows:

  • It's costly - you pay salaries each time the tests are executed. These quickly add up. Think of this like a pay-as-you-go strategy.
  • It's time consuming - it takes time to execute the tests, particularly if the tests are executed every time a change is made, which is typical. Imagine executing a series of unit tests right after each build. This can be several times a day, and take hours per iteration.
  • It's difficult to isolate each unit - normally, the units work together in a piece of software, so testing one unit typically tests several. This makes determining issue root causes difficult. Think of this like trying to determine the subtle flavors in a cup of tea. If you tasted each on its own, it wouldn't be a problem, but together?

What is Automated Unit Testing?

Automated unit testing performs the process of unit testing without human intervention. And not from the creation side, that is still done by people, but from the execution side. Scripts (Bash, PowerShell, and Tcl/Tk/Expects), programmable testing environments (Visual Test, TestTrack), and sometimes custom code, are used to perform unit tests. Think of them like the self-tests, or diagnostic tests, that many products have built in. For unit testing, the process is automated by executing it as part of the build process. Each time a build is performed, these tests are executed, and they ensure that nothing has been broken by the latest changes introduced to the system.

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create An Account