1. Unit-testing
Unit-testing is the process of testing each unit or component of a software application separately. It's the initial step in the functional testing process. The goal of unit-testing is to ensure that unit components work as expected.
A unit is a single testable component of a software system that is tested during the application software development phase.
The goal of unit-testing is to ensure that isolated code is correct. A unit component is a single application function or piece of code. Unit-testing is frequently done by developers using the white box testing approach.
When the programme is ready and sent to the Test engineer, he or she will begin unit-testing or component testing by checking each component of the module or module of the application independently or one by one.
How to achieve the best result via Unit-testing?
By following the techniques below, UT can provide the best results while avoiding confusion and increasing complexity:
- Test cases must be self-contained, thus any changes or enhancements to the requirements will not effect the test cases.
- Unit test case naming conventions must be clear and consistent.
- Before moving on to the next phase of the SDLC, the detected defects must be resolved during unit-testing.
- At any given time, only one code should be tested.
- Include test cases in the code writing process; otherwise, the number of execution routes will grow.
- If any module's code changes, check whether the associated unit test for that module is accessible or not.
Advantages
- Unit-testing employs a module approach, which allows any portion to be tested without having to wait for the testing of other sections to be completed.
- To grasp the unit API, the development team concentrates on the unit's offered functionality and how that functionality should appear in unit test suits.
- Unit-testing allows the developer to refactor code after a few days to confirm that the module is still functional.
Disadvantages
- Because it operates on code units, it can't detect integration or broad-level errors.
- Because unit-testing does not allow for the examination of all execution pathways, it is unable to catch every error in a programme.
- It works best when combined with other testing activities.
2. Integration-testing
After unit-testing, integration-testing is the next step in the software-testing process. Units or individual components of the software are tested in a group during this testing. The integration-testing level focuses on exposing faults that occur during the interaction of integrated components or units.
Unit-testing employs modules for testing purposes, and integration-testing combines and tests these modules. The software is made up of a variety of software modules that have been coded by various programmers or coders. The purpose of integration-testing is to ensure that all components are communicating correctly.
Once all the components or modules are working independently, then we need to check the data flow between the dependent modules is known as integration-testing.
Types of Integration-testing
Integration-testing can be sub-divided into 2parts:
- Incremental integration-testing
- Non-incremental integration-testing
Incremental Approach
Modules are added one by one in ascending order or according to need in the Incremental Approach. The modules chosen must be logically connected. To determine the validity of functions, two or more modules are usually added and tested. The procedure is repeated until all of the modules have been successfully tested.
Let's say we're testing a Flipkart app. We'll do incremental integration-testing, and the app's flow will look like this:
Flipkart→ Log_in→ Home → Search→ Add_cart→Payment → Log_out
Top-Down Approach
This strategy refers to the process of testing higher-level modules with lower-level modules until all of the modules have been successfully tested. Because key components are tested first, major design defects can be found and corrected early. We will add the modules incrementally or one by one and check the data flow in the same order in this technique.
In this technique, we'll make sure that the module we're adding is a child of the one before it, for example, Child C is a child of Child B, and so on, as shown in the diagram below:
Bottom-Up Method
The bottom to up testing strategy refers to the process of testing lower level modules with higher level modules until all modules have been successfully tested. Because top-level critical modules are tested last, a problem may occur. Or, to put it another way, we'll be adding modules from the bottom up and checking the data flow in the same sequence.
In this method, we'll make sure the modules we're adding are the children of the preceding ones, as shown in the diagram below:
3. System-testing
System-testing is putting a fully integrated software system to the test. In most cases, software is integrated into a computer system. The programme is created in modules, which are then combined with other software and hardware to form a complete computer system. To put it another way, a computer system consists of a collection of software that performs various functions; but, software alone cannot accomplish the work; it must be interfaced with appropriate hardware. System-testing is a collection of several types of tests designed to exercise and assess the overall functionality of an integrated software computer system in comparison to its requirements.
System-testing is the process of checking the end-to-end flow of an application or software as a user. We travel (go through) all of an application's necessary modules and check if the end features or end business function properly, as well as test the product as a whole system.
It's called end-to-end testing since the testing environment is identical to the production environment.
System-testing Types
There are more than 50types of system-testing, but software-testing businesses typically use only a few of them. The following is a list of them:
Regression Testing
Regression testing is done as part of system-testing to check and detect if there is a problem in the system as a result of a change made to another component of the system. It ensures that any modifications made throughout the development process did not introduce a new flaw, and that previous defects will not reappear as new software is added over time.
Load Testing
Load testing is done as part of system-testing to see if the system can withstand real-time loads.
Functional Testing
A system's functional testing is done to see if there are any missing functions in the system. The tester creates a list of critical functions that should be included in the system and that can be added during functional testing to improve the system's quality.
Recovery testing of a system is done as part of system-testing to confirm the system's reliability, trustworthiness, and accountability, all of which are based on the system's recouping abilities. It should be able to successfully recover from all possible system crashes.
Migration Testing
Migration testing ensures that if the system needs to be modified on a new infrastructure, it can be done without difficulty.
Usability Testing
The goal of this testing is to ensure that the system is well acquainted with the user and that it accomplishes its goal.
Software and Hardware Testing
The purpose of this system-testing is to ensure that the hardware and software are compatible. To run the software without problems, the hardware configuration must be compatible with it. By allowing interactions between hardware and software, compatibility gives flexibility.
Below is Integration-testing on the various modules of the Gmail application:
Login
- First, we'll login to the application with our username and password, then check the username on the homepage.
Compose
- Write a message, send it, and check it in Sent Item [sender].
- Write an email, send it, and check the recipient's inbox [Inbox].
- Write a message, send it, and check your [Inbox] for new messages.
- Compose an email, then save it as a draught and check it in as a sender draught.
- Write a message, send it with an invalid id (legal format), and check for undeliverable mail.
- Write emails, close draughts, and check them in.
Inbox
- Choose the message, respond, and check sent items or the receiver's Inbox.
- To reply to an email in your inbox, select it, save it as a draught, and check it in the draught.
- Select the message, then delete it and place it in the trash.
Sent Item
- Go to Sent Item, Reply, or Forward, and look in the Sent Item or receiver inbox.
- Choose mail, Sent Item, Reply or Forward, Save as Draft, and check the Draft.
- Choose a message, delete it, and place it in the trash.
Draft (draught)
- Choose the email draught, forward it, and mark it as Sent or Inbox.
- Select the email draught, delete it, and then check it in the trash.