Testing & Analyzing Computer Algorithms

Instructor: David Gloag
In this lesson, we'll take a look at algorithms, what they are, what's involved in testing them, and how to analyze them. At the end, you should have a good understanding of this important concept.

Now, But No Mistakes Please

These days, our world seems to be governed by two desires. We want it to be perfect, and we don't want to wait for it. Now, many of us were brought up to believe that perfection takes time. If this is true, these two desires would seem to be at odds. And for the most part, they are. So how do vendors address this? How do they provide products and services that meet the goals of being perfect and fast? Clearly, it's a balancing act. Many disciplines, like software development, are looking closely at their algorithms to ensure that both of these desires are met.

What is an Algorithm?

An algorithm is a process. It is a countable (finite) number of steps that allow you to accomplish some goal or solve some problem. This term is widely used in computer science to describe the programming steps needed to accomplish an executable goal of a piece of software. For example, a computer program might employ an algorithm to:

  • Search - This is the process of sifting through an information set to find a particular piece that is of interest.
  • Sort - This is the process of applying an order to an information set.
  • Parse - This is the process of breaking some information up into smaller, more manageable pieces.
  • Calculate - This is the process of performing some mathematical operation(s) on the information set.

There are others, of course, but you get the idea. Sometimes, a program will even employ them all, depending on the overall objectives of the software in question. As a result, algorithm testing and analysis receive a fair amount of attention.

How Do You Test an Algorithm?

Each algorithm is somewhat unique, so there isn't a single testing strategy that will cover them all. But there are a couple of areas to consider. They include:

  • Verification - This area looks at the process the algorithm uses. In other words, it analyzes the steps the algorithm uses and determines if they are correct.
  • Validation - This area looks at the outputs of the algorithm and determines whether the results produced are correct.
  • Time - This area looks at the performance of the algorithm and determines how long it takes to produce its results.
  • Space - This area looks at the space the algorithm occupies in storage and in memory. This is of particular interest when the target device is resource constrained.

To unlock this lesson you must be a Study.com 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 Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
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? Study.com 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