Hi Folks
I Just want to ask is JUnit suitable for testing realtime c++ server
side applications .
We have some shell scripts / commands which can interact with the c++
servers for manual testing . Is Junit use ful for automation in this
type of environment . The Operating system is QNX .
Is Junit fundamentally used only for test automation in JAVA server
side / JAVA GUI kind of application .
Thanks
subra
Sure you could use it, it comes down to what types of tests and who will
used them.
JUnit tests are written in Java, so are developer centric. They would
be no good showing testers or proxy customers (Those acting in the
interest of the real customers).
JUnit like all of the xUnit frameworks are designed around the idea that
they are for developer tests, not Acceptance Tests.
If you want this kind of testing, then you might also want to write the
unit tests in C++ instead of Java. If this is so, then there's a few
different C++ implementations of JUnit... CPPUNIT, CPPUNITLight,
cUnit, etc....
However, if you are after a more Acceptance Test approach, then these
are best written in a domain language the Customer/tester can
understand, rather than a programming language.
Most of these frameworks also tend to fare better at concurrent and
stress testing than the xUnit frameworks.
If this is the approach you want, then I'd suggest FIT or FitNesse.
FIT (
http://fit.c2.com/) is a testing framework, which uses HTML files
to specify the tests 'Fixtures' and your 'Fixture Code' to make them
work with your specific application.
Here's an example of how you can write the test fixture (imagine your
favorite HTML generating tool has produced the table below) and its
implementing code.
|eg.Division|
|numerator|denominator|quotient?|
|10 |2 |5 |
|12.6 |3 |4.2 |
|100 |4 |33 |
Here the 'eg.Division' is the package and class name which id
dynamically instantiated by the framework.
The 'numerator' & 'denominator' are public variables on the 'Division
class. The 'quotient' is the name of a public method on the Division class.
As in...
public class Division extends ColumnFixture {
public double numerator, denominator;
public double quotient() {
return numerator/denominator;
}
}
When the test fixtures are run, the frame work instantiates the Division
class, then one row at a time, it works left to right, stuffing the
values into the variables and calling the methods. The results are then
sent back to the users by changing the colour of the cells which are
method calls - 'quotient' in the example above.
Its worth noting that FIT can work with a variety of different
languages, not just Java...
* Java - Included in the fitnesse.jar.
* .NET - Included in the standard FitNesse distribution.
* C++ - C++ FIT and FitServer
* Delphi - Delphi FIT and FitServer
* Python - Python FIT and FitServer
* Ruby - Ruby FIT and FitServer
* Smalltalk - Visual Works Smalltalk FIT and FitServer
* Perl - Perl FitServer
Also worth looking at is FitNesse
http://fitnesse.org/:
A fully integrated standalone wiki, surrounding FIT.