What is software testing?
It is a set of activities intended to find bugs within the software, as well as validate and verify the software meets the business requirements and needs as designed.
What is a bug/defect?
It is an error that causes an incorrect or unintended result.
E.g.
Unintended result:
A button click should open a dialogue box but instead opens another page.
Incorrect result:
The discount should be 5% but instead, it applies a 15% discount on the order.
What is Verification vs Validation?
Verification:
- You verify the software is built as the design specification outlined. Ultimately, you are verifying the developer completed the development as it was envisioned.
- You verify that the rules and requirements documented are being followed and implemented by the software.
- You ask the question, “Are you building it right?”
- E.g. You verify if the contact form works as per the software design specification.
Validation:
- You validate the software that was built solves for the original business problem or fulfills the business need.
- You validate if the software is providing the intended business value.
- You ask the question, “Are you building the right things?”
- E.g. You validate if the inquiries have been automated (using a contact form) by the software.
Why is software testing important?
Defects in the production system:
- Cost money
- E.g. If the user is not able to enter order then the revenue is affected
- Frustrate users
- E.g. If the system was not verified (incorrect contact form) or validated (inquiries not being placed) then it will frustrate the users of the system
- Extend the project
- E.g A bug in the development or testing environment is easy to solve as it doesn’t impact the business. A bug in the production environment has to go through bureaucracy (development and testing round trips and iterations) to get resolved. This delays the project.
- And in a few cases, may cause harm to life
- E.g if the software is used to measure the heart rate of a patient in a hospital. Incorrect working software will result in unintended harm.
Few Examples for Testing Error:
Example 1: Verification Error
Mars Climate Orbiter
- Launched in 1998 to study Mars climate changes
- The developer used English units instead of metric
- The bug caused it to get too close to Mars atmosphere
- Orbiter disintegrated
Net Loss: $327 million dollars
Example 2: Validation Error
- During the Miss Universe 2015 pageant contest, the presenter Steve Harvey accidentally announced the winner as Miss Colombia instead of Miss Philippines.
- Everything was fine, however, the card on which the winners and runner-ups were mentioned were tricky for the host which caused the blunder.
- The card was verified (technically worked correctly) but not validated (did not work for the host).
What are the goals of testing?
Verify the software is built as designed
- Show the presence of defects so that they can be eliminated and the software works as designed
- Reduce the probability of bugs remaining in software at the time of launch
- Not to make it bug-free. It is not feasible to remove each and every bug unless we can make a large investment. However, critical bugs should always be eliminated.
Validate the software is usable and meets business needs
- Confirm intended users can accurately use the software
- Ensure the end result solves the original business problem
When does testing happen?
In the Waterfall SDLC method:
There is a definite stage for testing.
However, testing happens indirectly throughout the project at all times. You have to regularly validate if the requirements are correct else the intended product will be incorrect.
In Agile SDLC method:
You can assume it to be multiple mini-waterfalls. Hence testing happens in each iteration of the project i.e. testing happens multiple times.
What are the various software testing phases?
- Unit testing
- Integration testing
- System testing
- User Acceptance testing
- Regression testing
To understand who completes the testing and when it is completed you can utilize the V model.
Unit testing
-
- The first step of testing
- Completed by the developers
- Test performed as each component is completed
- E.g. The developer tests each individual functionality as it is being built
- BA is rarely engaged in this stage of testing. It is 100% developer. If a BA is engaged then it is to write the test cases and review test results
Integration Testing
- Unlike what the name suggests, in this testing, the various components within a single system are tested and not the different systems
- This phase helps to find the problems in how components work together
- This is commonplace for project failure. Usually, the individual components work correctly but face a problem when they interact with each other
- E.g.
- Assume you have 2 screens, A & B.
- On screen A, a form collects data and on screen B, the collected data is displayed.
- In this testing phase, you test if the data on screen B is shown correctly as collected on screen A i.e. you test if the two components (A & B) of a system are working as intended.
- BA is engaged in this stage if there is no QA team. If a BA is engaged then it is to write the test cases and review test results
System Testing
-
- This is the last chance for the project team to verify the software
- They have to also validate the software meets the business requirements
- This phase may include many different types of test to flush out maximum defects
- BA is always engaged in this stage. The BA writes, executes, and analyses test case results. The business requirements and functional requirements written off the business requirements are verified.
User Acceptance Testing
-
- This is the final phase of testing
- Users utilize real-life scenarios to verify the software meets their needs
- Users should be the main tester and not the BA
- The BA does not complete the testing rather manages the testing
- The BA almost always is engaged in this phase of testing. He/She creates scenarios, analyses results, manages defects, and ensures the defect is resolved.
Regression testing
- Performed after initial testing is completed
- Retest functions of the software that have not been changed
- Ensure changes didn’t “break” previously working functionality
- Can be extremely tedious and boring
The post is based on my notes and understanding from this Testing Tutorial