📜 ⬆️ ⬇️

Software Testing Methods

Hello! Next week we are launching a new stream in the course “Automation of Web Testing” . This will be the subject of today's material.

This article discusses various methods of software testing, such as unit testing, integration testing, functional testing, acceptance testing, and so on.


')
There are many different types of tests that you can apply to make sure that the changes in your code work according to the script. Not all types of testing are identical, although here we look at how basic testing practices differ from each other.

Testing: manual or automated?

First you need to understand the differences between manual and automated tests. Manual testing is carried out directly by the person who presses the buttons in the application or interacts with the software or API with the necessary tools. This is quite expensive, since it requires the tester to install the development environment and perform the tests manually. There is a probability of error due to human factors, such as typos or skipping steps in a test scenario.

Automated tests, on the other hand, are produced by a machine that runs a test script that was written in advance. Such tests can vary greatly depending on the complexity, ranging from testing a single method in a class to working out a sequence of complex actions in the UI to make sure that it works correctly. This method is considered more reliable, but its performance still depends on how well the script for testing was written.

Automated tests are a key component of continuous integration ( Continuous Integration ) and continuous delivery, as well as a good way to scale your QA process while adding new functionality for your application. However, manual testing still has its value. Therefore, in the article we will definitely talk about exploratory testing.

Different types of tests

Unit Tests

Unit tests are considered low-level, close to the source code of your application. They are aimed at testing individual methods and functions within classes, testing components and modules used by your program. Unit tests as a whole do not require any special costs for automation and can work out extremely quickly if you use a continuous integration server.

Integration tests

Integration tests verify that the services and modules used by your application work well together. For example, they can test database integration or make sure that microservices interact correctly with each other. These tests are run at a high cost, since they need many parts of the application to work at the same time.

Functional Tests

Functional tests are based on the business requirements of the application. They only check the output after the action is performed and do not check the intermediate states of the system during the playback of the action.

Sometimes contradictions arise between integration tests and functional tests, since they both request multiple components that interact with each other. The difference is that the integration tests can simply make sure that there is access to the database, while the functional test will want to get a certain value from the database in order to check one of the requirements for the final product.

End-to-end tests

End-to-end testing simulates user behavior when interacting with software. It checks how accurately various users follow the intended application scenario and can be quite simple, for example, to look like loading a web page or entering a site or, in a more complicated case, confirming an e-mail address, online payments, etc.

End-to-end tests are extremely useful, but they are expensive to produce, and it can be difficult to automate them. It is recommended to carry out several end-to-end tests, but still rely more on low-level testing (unit and integration tests) in order to be able to quickly recognize major changes.

Acceptance Testing

Acceptance tests are formal tests that are conducted to ensure that the system responds to business requests. They require the application to run and run, and mimic the user's actions. Acceptance testing can go further and measure system performance and reject recent changes if the final design goals have not been achieved.

Performance tests

Performance tests test the behavior of the system when it is under a significant load. These tests are non-functional and can take different forms to test the reliability, stability and availability of the platform. For example, it may be monitoring the response time when a large number of requests are being executed or how the system behaves when interacting with big data.

Performance tests are inherently quite expensive, but they can help you understand which external factors can drop your system.

Smoke testing

Smoke tests are basic tests that check the basic functionality of an application. They work quickly enough and their goal is to make it clear that the main functions of the system work as it should and no more. Such testing is aimed at identifying obvious errors.

Smoke tests may be useful immediately after building a new build to check whether you can run more expensive tests, or right after deployment, to make sure that the application is working properly in the new environment.

How to automate tests

The tester can conduct all the tests mentioned above manually, but it will be extremely expensive and unproductive. Because people have a limited ability to perform a large number of actions with repetitions while still testing reliably. However, the machine can easily reproduce the same actions and check, for example, that the login / password combination will work for the hundredth time without any complaints.

To automate testing, you first have to write them in one of the programming languages ​​using a testing framework that is suitable for your application. PHPUnit , Mocha , RSpec are examples of testing frameworks that you can use for PHP, Javascript and Ruby, respectively. They have many opportunities for each language, so you should do a little research on your own and consult with the developer communities to find out which framework is best for you.

If your tests can be run using scripts from the terminal, you can automate them using the Bamboo type continuous integration server or the Bitbucket Pipelines cloud server. These tools will monitor your repositories and execute test suites as soon as new changes are launched into the main repository.



If you are new to testing, consult our Continuous Integration Guide to create your first test suite.

Research testing

The more features and enhancements added to your code, the greater the need for testing, since at each stage you need to make sure that the system works correctly. It will also be needed every time you fix a bug, since it would not be superfluous to make sure that it does not come back again after several releases. Automation is the key to making this possible; writing tests will sooner or later become part of your developer practice.

The question is whether it is necessary in general in this case to conduct manual testing? The short answer is yes, and it should focus on what is called “exploratory testing,” which helps to identify non-obvious errors.

A research testing session should not exceed two hours and should have a clearly limited scope to help testers focus on a specific software area. After informing all testers about the boundaries of testing, it is up to them to take actions that they will take to check how the system behaves. Such testing is costly in nature, but is very useful for identifying problems with the user interface or testing the health of complex workflows for users. It is important to conduct such testing whenever a radically new function is added to the application in order to understand how it will behave in the border conditions.

Testing Note

Before I finish this article, I want to talk about the purpose of testing. On the one hand, it is very important to make sure that users can use your application (“I cannot log in”, “I cannot save data”, etc.), but on the other hand, it is equally important to verify that your system does not break when you enter incorrect data or unexpected actions. You need to anticipate what will happen when the user makes a typo, tries to save an incomplete form, or uses the wrong API. You need to check whether any of the users can easily compromise data, get access to one or another resource to which they should not have access. A good test suite should try to break your application and help you understand its limits.

And finally, tests are code too! So do not forget about them during the code review, as they may be the last step before the product is released to the consumer market.

According to the established tradition, we are waiting for your comments and we invite everyone to the open day , which our instructor, the leading automator in testing at Group-IB, Mikhail Samoilov , will conduct on March 18th.

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


All Articles