Testing framework for functional/system testing for C/C++?
Asked Answered
L

3

12

For C++, there are lots of good unit test frameworks out there, but I couldn't find a good one for functional testing. With functional testing, I mean stuff which touches the disk, requires the whole application to be in place etc.

Point in case: What framework helps with testing things like whether your I/O works? I've got a hand-rolled system in place, which creates temporary folders, copies around a bunch of data, so the tests are always done in the same environment, but before I spend more time on my custom framework -- is there a good one out there already?

Lift answered 13/1, 2009 at 12:40 Comment(1)
Windows and Linux at the moment. My current test framework is written against .NET 2, and works where Mono works.Lift
P
4

I wrote one from scratch three times already - twice for testing C++ apps that talked to exchanges using FIX protocol, once for a GUI app.

The problem is, you need to emulate the outside world to do proper system testing. I don't mean "outside of your code" - outside of your application. This involves emulating end users, outside entities, the Internet and so on.

I usually use perl to write my system testing framework and tests, mostly because it's good with accessing all sorts of OS facilities and regexps are first-class citizens.

Some tips: make sure your logs are easy to parse, detailed but not too verbose. Have a sane default configuration. Make it easy to "reset" the application - you need to do it after each test.

The approach I usually use is to have some sort of "adapter" that turns the application's communications with the outside world into stdin/stdout of some executable. Then I build a perl framework on top of that, and then the test cases use the framework.

Purtenance answered 13/1, 2009 at 13:33 Comment(0)
A
2

Below I list a couple of tools and larger testing applications of which I am aware. If you provide more information on your platform (OS, etc.) we can probably provide better answers.

For part of what you require, Microsoft provides the Application Verifier:

Application Verifier (AppVerifier) is a runtime verification tool used in testing applications for compatibility with Microsoft Windows XP. This tool can be used to test for a wide variety of known compatibility issues while the application is running. This article details the steps for using AppVerifier as an effective addition to the application development and testing cycles.

Application Verifier can be useful for testing out low memory conditions, other low resources, and other API usage.

Another part of the puzzle, is the Microsoft Detours package, which can be used to replace API calls with your own code (useful for say, returning error codes for tests that are hard to set up).

Detours is a library for instrumenting arbitrary Win32 functions on x86, x64, and IA64 machines. Detours intercepts Win32 functions by re-writing the in-memory code for target functions. The Detours package also contains utilities to attach arbitrary DLLs and data segments (called payloads) to any Win32 binary.

There are other, larger (and more expensive) comprehensive packages available too. Borland makes Silk.
Automated Software makes TestComplete. The selection of one of these tools would be up to your needs for your applications.
IBM/Rational provides the Rational Functional Tester, which is available across many platforms, and feature-rich.

Ashkhabad answered 13/1, 2009 at 13:39 Comment(1)
The bummer with Detours is that while v2.1 is free, it's for research, non-commercial, non-production only. Version 3.0 removes these restrictions but costs $9,999 - a hefty commitment if you don't know if it meets your needs.Cabernet
B
0

Hi I am not sure if the framework we have helps in your situation but it hooks into Rational Functional Tester and allows the user to create various datasets to be attached to different tests and to change the enviornments without changing the scripting and reuses the automation in an efficient way. Have a look if your interested: http://www.testpro.com.au/Test-Automation-Framework.html

Befool answered 25/6, 2011 at 4:22 Comment(1)
Please add a disclaimer to your posts recommending your products. I see you disclose your affiliation in your profile, but not everyone will think to look. See also the faq.Constancy

© 2022 - 2024 — McMap. All rights reserved.