Why do we Test
How secure would you feel using a system that has not been tested?
Let’s say that you intend to buy a car, but no testing was done the engineers worked on the car solely based on their experience.
How would you feel about using the car?
That’s why we test software to give a better sense of quality to the end-user of the software.
Reasons for testing
-
Compromise
- Depending on the bug of the software, an error can compromise a person, a group, or a whole operation.
-
Quality Assurance
- Ensures that software meets standards for quality expected by the end-user. It validates software behaves as planned.
-
Security
- Having a secure software is essential to protect against malicious attacks and prevent data breaches.
-
Cost
- Saves your organization time and money, testing is one of the most cost-effective ways to ensure the quality and reliability of your software.
-
Other
- There are many other reasons to consider software testing, such as documentation, productivity, compliance, user experience, etc.
Types of Tests
There are many types of tests out there such as load testing, mutation testing, acceptance testing, smoke testing, etc. To focus on what is essential in this article we will focus on 3 main types of tests that developers could consider:
- Unit Tests
- Integration Tests
- End-to-End Tests
Unit Tests
Unit Tests focuses on the units or components of a software. A Unit is typically a method within a class or program. It validates a small part of code, should be small fast to run and typically automated.
Integration Tests
Unit tests are great as they test a unit of the application, however you cannot be sure your system works if you rely on unit tests. Integration testing helps validate how components work in integration with external systems. The purpose is to detect faults in the interaction between integrated units.
Testing Balance
It’s important to maintain a balance between unit and integration tests. The number of tests between integration and unit can drastically differ from application to application depending on the needs.
End-to-end tests
In end-to-end testing, the whole application is tested in a real-world scenario such with interaction with the database, front-end, network, hardware, and other applications. This can involve several components of the system working together, such as the database, user interface, network, and APIs.
The testing Pyramid
When working with testing it is important to first have a clear understanding if the different test levels their cons and pros. Therefore, you can invest on whatever makes more sense to the objective of the organization or project in-hands.
The following pyramid contains three levels of testing, if you research testing pyramid you should find a couple of variations of this pyramid.
First, we have unit tests at the bottom where all major business rules should be tested.
Second, we have integration testing where you tend to have more complexity due to the integrations with external services and they tend to be written for less scenarios than unit tests.
Finally, we have end-to-end that covers functionality of the entire software application and tend to more complex to write and maintain due to possible constant change in the application.
As seen in the figure, the bottom of the pyramid is less realistic and tend to be easier to maintain and as we go up the pyramid complexity/maintainability should rise.
Top comments (0)