Reduced pain recording integration and system tests

I would like to do integration tests and system tests for my applications, but for good integration and system tests, it often took so much effort that I was not worried. Several times when I tried, I wrote special application-specific test harnesses that felt like they invented a wheel every time. Interestingly, this is the wrong approach. Is there a “standard” integration approach and full system testing?

EDIT: To clarify, these are automated tests for desktop and web applications. Perfectly complete test suite that uses the full functionality of the application.

+4
source share
1 answer

If “perform integration tests and system tests” means automated tests, then the answer will be negative, there will be no standard approach. The choice of approach depends on:

  • application characteristics (for example, does it have a graphical interface?), is it just a read ?, how many external dependencies does it have, etc.)
  • what you are trying to test (maybe you only need GUI tests, or maybe the opposite is true, and you don't really care about the GUI, but internal logic is crucial).
  • how quickly you want to see the results (for example, the more you finish, the faster your tests will become).
  • skills in your team.

Personally, I like any approach that integrates with JUnit. JUnit is a fantastic framework that is well maintained and easily tied to a continuous integration server. Here are some possible approaches:

  • Selenium with JUnit - A Fantastic Web Application Management Tool
  • Concordion - for all types of applications. It integrates with JUnit and allows you to use simple English test specifications. Your fixture / test code connects to the keywords in the specification and approves or performs actions on them.
  • FEST - for swing applications it integrates with JUnit again (another topic?) (More options here )

The above examples provide a huge amount of ready-made help for testing. Of course, they still require effort to connect to your application and support, but the benefits are worth it. In addition to the above, you might have to think about how to mute or mock areas of your application. Perhaps you want to do all your testing "under the graphical interface" or "above the database." In the first scenario, you will need your tests to start at the points in your code where the graphical interface will interact with it, and in the last you will need to disable the services that interact with your database.

Point, there are many ways to do this. It’s best to start with a very clear understanding of what you want from your testing. Then find out what existing framework exists to help you build on what you want to test, and finally, don't try to conquer the world in the night. Start small with a few tests. Get a green bar (always nice to see!) Get a stable, proven testing platform and make sure you are happy with it. Then add more as you go.

+5
source

Source: https://habr.com/ru/post/1308273/


All Articles