Design Article

Layering it on--a new approach to automating system tests

Adrian Raileanu, Bogdan Ionita, and Diana Craciun

2/5/2010 12:00 AM EST

When building software, you always need to know your software's quality. Testing is the obvious vital task in assessing the quality of a product, but it's also a major contributor to product development time. Automating tests can shorten the time your spend on executing test sessions, while improving resource use and extending the number of functions you can validate.

This article presents the pitfalls and challenges posed by creating an automated test strategy for an embedded system, namely a Voice over IP (VoIP) media gateway. The layered approach we devised doesn't necessarily reduce testing effort but instead converts tasks, such as execution, validation, monitoring, and reporting, into software routines.

A layered approach with pluggable components assures scalability and portability, enabling you to test a class of products individualized by the capabilities and hardware platforms they run on. Although the diversity in embedded systems is so great that no one generalized testing method can be applied to all different engineering areas, let alone among products from the same specific area, we believe our basic concept can be successfully adapted to other classes of embedded systems.

Our system under test (SUT)--the VoIP media gateway--consists of a complex integration of software modules and control running on a specialized processor optimized for both signal and packet processing. A common requirement of embedded systems is the ability to process data in real time. A VoIP media gateway processes voice signals within a specified time period, which must be as short as possible to reduce the overall communication delay introduced by packet networks and processing nodes. The real-time environment makes the SUT's behavior more difficult to predict and analyze. Defect occurrence in real-time systems is sometimes nondeterministic, as it becomes visible only when special conditions are met.

We validated the media gateway from a system perspective--we considered all the components to have been unit-tested prior to integration. The output of testing this SUT consisted of media and control packets, digital signals, and debugging/logging information. We based our test approach on standards, reference or relative data, and interoperability with existing equipment.

Why automate testing?
The numerous stories of failed attempts at test automation all begin with an ill-conceived objective for the project. While figuring how much time and money you will save, note that for the most part, test automation doesn't leave testers with more free time on their hands. On the contrary, automating a testing project is a full-time effort, not a sideline task.

The central question is whether your objective is to save testers' time and your company's money during testing phases or rather to end up with a higher quality product that has fewer chances to fail during its service life.

Starting an automated testing project is actually a lot more work than purely a manual effort. Test automation doesn't replace testers, rather it changes their focus. People are needed to program the scripts, set up the test runs, interpret the results, discuss fixes, and so forth. All these make test execution actually a small part of the whole testing effort. Testers typically don't end up with less work to do.

So, why then would you want to automate your testing? See the sidebar below for advantages and disadvantages of test automation; or go to next page to continue the article.

Advantages and disadvantages of test automation
Expectations are always high when the opportunity for test automation comes into view. Most stakeholders believe automation is a panacea for test-related issues. Experience, however, shows otherwise. Plenty of literature is available about lessons learned from test-automation projects. Strong reasons exist for engaging in such a project, but they must be weighed against the serious problems that can arise.

Execution speed is advertised as a major advantage of test automation. Although your tests will probably execute faster, the execution phase is just one piece of the whole story. First you have to develop a testing framework. Once the framework is in place (there should be no need for further work on it other than the occasional enhancement or bug fix), you have to shift to developing test cases and scripts. Test-script development is a continuous task, guaranteed to last as long as the software tested is yet to be in service, and sometimes even after that. Finally, when planning an automation project, don't forget such tasks as interpreting test results and investigating bug. The test cases might be automated, but the final interpretation and verdict are purely subjective.

Functional coverage is another decisive factor in an automation approach. The problem is, the more functionality covered with automation, the more complicated the test programming will be. It eventually boils down to a compromise between functional coverage and test case depth. Using automation, tests can become more thorough by implementing all the actions that a tester might find boring or impossible to perform, for example simulating hundreds of users.

Regression testing theoretically becomes a trivial task when an automation framework is in place. Testing sessions can be run at the "push of a button" and existent test scripts instantly become regression tests for future software builds. If this sounds too good to be true, it is because an inherent problem with test automation is that has to be solved for this scenario to work, namely the interface of the SUT must be isolated from the test scripts.

Pesticide paradox is an issue anyone considering test automation should be aware of. This concept is pictured in the following quote by James Bach: "Highly repeatable testing can actually minimize the chance of discovering all the important problems, for the same reason that stepping in someone else's footprints minimizes the chance of being blown up by a land mine."4 Simply put, any non-evolving battery of tests will find fewer and fewer bugs over time, reaching a point where they are unable to find bugs anymore. At this point, they become pure regression tests, serving only to assure that further modifications to the SUT don't produce any new bugs in previously cleaned areas.

Focus on developing new test cases is another advantage of test automation. Eliminating the need to execute manual tests leaves more time for designing and implementing new ones. Still, when outlining the automation project, one must keep in mind that existent test scripts will almost certainly need maintenance, including their design as well as their actual code. Existent test cases that run without finding any bugs can instate a false sense of security, even though bugs may lurk in the test designs or test scripts themselves.

Reusability is an advantage of an automated test framework only if it was included in the design requirements from the start. Spending time and effort developing a framework that only tests one product is grossly inefficient, especially when there are other projects that are being developed or will be developed in the same organization. Finally, increased reuse of test cases leads to better test design and better documentation.


Next:




Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)

Feedback Form