ften developers are tasked with not only developing functional code, but also with ensuring that the code they
develop scales well and performs in the application environment. The tests that need to be performed against
developed code are threefold in nature:
- Function testing: verifies that the code performs its proposed function.
- Scalability testing: verifies that the code consumes as few resources as possible while performing its proposed
- Goal testing: verifies that the code executes in less time than any specified service level agreement (SLA).
Of the three tests, usually function testing is the easiest of the three to verify.
This article covers the difference between scalability and goal testing, illustrates an example of pseudo-code
test harnesses for manual testing, and demonstrates an example test of an Oracle procedure using an automated
testing interface (Quest Software’s Toad). This article provides direction for developers seeking to learn about
proper code testing and the tools available to make testing accessible to developers.
The Challenges of Manual Scalability Testing
The first type of test to verify that a program, function or statement uses the fewest possible resources is called
a scalability test. In a scalability test the code is placed into an environment similar to what is expected in the
production system and then it is run with random variables and a steadily increasing user load. The user load is
increased either to a specific number of users, or, the number of users is increased until stress is seen in the
environment to determine the ultimate scalability on the existing platform.
Scalability testing can be performed using an in-house generated test harness similar to the pseudo-code in
Listing 1. Of course, you have to run the test script manually
from several users at the same time.
Maintaining the test harnesses for perhaps hundreds of statements is a daunting task. In addition, generating the
random values and maintaining the underlying infrastructure for manual test harnesses also would require time and
effort better put into maintaining and improving the actual application.
The results from scalability tests are usually specified in transaction per second (TPS) or transaction per minute