Automation integration tests: use xUnit?

I’m learning how best to automate integration tests (to which I mean the full use cases completely in our application)

Questions

very well cover the why and what aspects.

Question Automated testing of integration of a C ++ application with a database implies that the xUnit framework is a good way to create and run integration tests. Is xUnit really good for this task? Is there a general question you need to know about? Good approach

Are there any more efficient approaches (with the possible exception of acquiring the HP / former Mercury toolbox)?

My specific environment for this project is Java / SpringSource / Hibernate, but I am also interested in offers for the .NET platform.

+4
source share
3 answers

Question Automated testing of integration of a C ++ application with a database implies that the xUnit framework is a good way to create and run integration tests. Is xUnit really good for this task? Is there a general question you need to know about? Good approach

JUnit and TestNG are the original unit testing modules, but can also be used to test integration. Therefore, for me the answer is yes, they are well suited for integration testing, for example. service testing -> domain> persistence -> database layers (I will really come back to testing integration later). One of the hardest things to do when performing integration tests related to a database is data. A tool such as DbUnit can help and is usually used to put the database in a known state before running each test (and approves the contents of the database for execution). Another approach is to run tests in a transaction and cancel the transaction at the end of the test. Spring makes it very easy, there is also a unitils library. In any case, it is best to avoid interdependent tests as much as possible (as indicated in the link you gave), this is just a nightmare.

Are there any more efficient approaches (with the possible exception of acquiring the HP / former Mercury toolbox)?

As far as I know, such tools are more comprehensive testing tools, that is, functional testing tools. Therefore, if integration tests (which for me means testing several components together), you actually mean functional tests (this is my understanding of full use cases), I would suggest looking at things like:

Pay particular attention to the bold (all these are really great tools, but I'm sure the one that is bold provides good automation options). And since HTTP and SOAP are standards (this, of course, does not apply to Swing UI testing tools), these tools are not specific to Java (even if the tests themselves are written in Java / Groovy for SoapUI). And BTW, Selenium supports many programming languages ).

+4
source

Multithreading can be a problem since JUnit will not receive exceptions from other threads. This is indicated by some developers of Java Puzzlers. You also need to come up with your own methods of statistical testing, and assert methods can be a little rude. I also find that the semantics of JUnit are a bit obscure (for example, JUnit uses one separate instance for each test method). For these reasons, I switched to TestNG, which, in my opinion, is a more thoughtful design. The fact that JUnit was developed using extreme programming sometimes shows.

+1
source

As already mentioned, you can do this using xUnit frameworks, but if you want to mix Java and .Net, or web applications and desktop applications, or add additional complexity to the big picture, than you cannot do it with one unit test framework . Thus, you will need to have many test tools, many test environments, many test script developers (for example, tests of one Java module, one for .Net tests) ... and it will be more difficult, problems, costs ...

Regarding the HP Quick Test Pro, you mentioned that it should cover the most of your needs. I mean most, because there may be some areas where this is not suitable (there is no way to run application scripts through Citrix virtualization), but in most cases it will do the job. It is suitable for java / .net / web and other things (there are plugins for specialized use). QTP usually works with GUI objects, so you can prepare test cases for users to use, and the test can be done so that the average user performs actions (only a little faster, you must deliberately slow it down to user speed if necessary).
You will probably need one tool, one test environment, one test script (VB) developer. It is expensive, but if for the company it should be the best choice in the long run.
And if you ask from the point of view of the company, he will play well in the HP Quality Center, if you decide to use it for the entire unit / testing team. If you are not using IBM solutions, they have their own set of tools as part of their software delivery platform, including Rational Robot

0
source

All Articles