WHAT IS SOFTWARE TESTING?
Software testing is an important process in the software development lifecycle. It involves verifying and validating that a software application is free of bugs, meets the technical requirements set by its design and development, and satisfies user requirements efficiently and effectively.

- Software Testing is a method to assess the functionality of the software program. The process checks whether the actual software matches the expected requirements and ensures the software is bug-free.
- The purpose of software testing is to identify the errors, faults, or missing requirements in contrast to actual requirements. It mainly aims at measuring the specification, functionality, and performance of a software program or application.
- Verification: It refers to the set of tasks that ensure that the software correctly implements a specific function. It means “Are we building the product right?”.
- Validation: It refers to a different set of tasks that ensure that the software that has been built is traceable to customer requirements. It means “Are we building the right product?”.
-
Software bugs can cause potential monetary and human loss. There are many examples in history that clearly depicts that without the testing phase in software development lot of damage was incurred. Below are some examples:
- 1985: Canada’s Therac-25 radiation therapy malfunctioned due to a software bug and resulted in lethal radiation doses to patients leaving 3 injured and 3 people dead.
- 1994: China Airlines Airbus A300 crashed due to a software bug killing 264 people.
- 1996: A software bug caused U.S. bank accounts of 823 customers to be credited with 920 million US dollars.
- 1999: A software bug caused the failure of a $1.2 billion military satellite launch.
- 2015: A software bug in fighter plan F-35 resulted in making it unable to detect targets correctly.
- 2015: Bloomberg terminal in London crashed due to a software bug affecting 300,000 traders on the financial market and forcing the government to postpone the 3bn pound debt sale.
- Starbucks was forced to close more than 60% of its outlet in the U.S. and Canada due to a software failure in its POS system.
- Nissan cars were forced to recall 1 million cars from the market due to a software failure in the car’s airbag sensory detectors.
TYPES OF SOFTWARE TESTING:
-
Software Testing can be broadly classified into 3 types:
- Functional Testing: It is a type of software testing that validates the software systems against the functional requirements. It is performed to check whether the application is working as per the software’s functional requirements or not. Various types of functional testing are Unit testing, Integration testing, System testing, Smoke testing, and so on.
- Non-Functional Testing: It is a type of software testing that checks the application for non-functional requirements like performance, scalability, portability, stress, etc. Various types of non-functional testing are Performance testing, Stress testing, Usability Testing, and so on.
- Maintenance Testing: It is the process of changing, modifying, and updating the software to keep up with the customer’s needs. It involves regression testing that verifies that recent changes to the code have not adversely affected other previously working parts of the software.
-
Apart from the above classification software testing can be further divided into 2 more ways of testing:
- Manual Testing: It includes testing software manually, i.e., without using any automation tool or script. In this type, the tester takes over the role of an end-user and tests the software to identify any unexpected behavior or bug. There are different stages for manual testing such as unit testing, integration testing, system testing, and user acceptance testing. Testers use test plans, test cases, or test scenarios to test software to ensure the completeness of testing. Manual testing also includes exploratory testing, as testers explore the software to identify errors in it.
- Automation testing: It is also known as Test Automation, is when the tester writes scripts and uses another software to test the product. This process involves the automation of a manual process. Automation Testing is used to re-run the test scenarios quickly and repeatedly, that were performed manually in manual testing.
SOFTWARE TESTING TECHNIQUES:
BLACK BOX TECHNIQUE:
- Black Box Testing is an important part of making sure software works as it should. Instead of exploring the code, testers check how the software behaves from the outside, just like users would. This helps catch any issues or bugs that might affect how the software works.
- Black-box testing is a type of software testing in which the tester is not concerned with the software’s internal knowledge or implementation details but rather focuses on validating the functionality based on the provided specifications or requirements.
TYPES OF BLACK BOX TECHNIQUE:
-
The following are the various categories of black box testing:
-
Functional Testing
-
Regression Testing
-
Nonfunctional Testing
Functional Testing:
- Functional testing is defined as a type of testing that verifies that each function of the software application works in conformance with the requirement and specification.
- This testing is not concerned with the source code of the application. Each functionality of the software application is tested by providing appropriate test input, expecting the output, and comparing the actual output with the expected output.
- This testing focuses on checking the user interface, APIs, database, security, client or server application, and functionality of the Application Under Test. Functional testing can be manual or automated. It determines the system’s software functional requirements.
Regression Testing:
- Regression Testing is the process of testing the modified parts of the code and the parts that might get affected due to the modifications to ensure that no new errors have been introduced in the software after the modifications have been made.
- Regression means the return of something and in the software field, it refers to the return of a bug. It ensures that the newly added code is compatible with the existing code.
- In other words, a new software update has no impact on the functionality of the software. This is carried out after a system maintenance operation and upgrades.
Nonfunctional Testing:
- Non-functional testing is a software testing technique that checks the non-functional attributes of the system.
- It is defined as a type of software testing to check non-functional aspects of a software application.
- It is designed to test the readiness of a system as per nonfunctional parameters which are never addressed by functional testing.
- It is as important as functional testing.
- It is also known as NFT. This testing is not functional testing of software. It focuses on the software’s performance, usability, and scalability.
-
WHITE BOX TECHNIQUE:
- White box testing techniques analyze the internal structures the used data structures, internal design, code structure, and the working of the software rather than just the functionality as in black box testing.
- White box testing is a Software testing technique that involves testing the internal structure and workings of a Software application. The tester has access to the source code and uses this knowledge to design test cases that can verify the correctness of the software at the code level.
-
White box testing include testing a software application with an extend understanding of its internal code and structure. This type of testing allows testers to create detailed test cases based on the application’s design and functionality.
Here are some key types of tests commonly used in white box testing:
- Path Testing: White box testing will be checks all possible execution paths in the program to sure about the each one of the function behaves as expected. It helps verify that all logical conditions in the code are functioning correctly and efficiently with as properly manner, avoiding unnecessary steps with better code reusability.
- Input and Output Validation: By providing different inputs to a function, white box testing check the the function gives the correct output each of the time. This helps to confirm that the software consistently produces the required results under various conditions.
- Security Testing: This will focuses on finding security issues in the code. Tools like static code analysis are used to check the code for potential security flaws, for checking the application for the best practices for secure development.
- Loop Testing: It will be check that loops (for or while loops) in the program operate correctly and efficiently. It checks that the loop handles variables correctly and doesn’t cause errors like infinite loops or logic flaws.
- Data Flow Testing: This involves tracking the flow of variables through the program. It ensures that variables are properly declared, initialized, and used in the right places, preventing errors related to incorrect data handling.
- Unit Testing: Unit Testing checks if each part or function of the application works correctly. It will check the application meets design requirements during development.
WHITE BOX TESTING TECHNIQUES:
-
One of the main benefits of white box testing is that it allows for testing every part of an application. To achieve complete code coverage, white box testing uses the following techniques:
1. Statement Coverage: In this technique, the aim is to traverse all statements at least once. Hence, each line of code is tested. In the case of a flowchart, every node must be traversed at least once. Since all lines of code are covered, it helps in pointing out faulty code.
If we see in the case of a flowchart, every node must be traversed at least once. Since all lines of code are covered, it helps in pointing out faulty code while detecting.
2. Branch Coverage: Branch coverage focuses on testing the decision points or conditional branches in the code. It checks whether both possible outcomes (true and false) of each conditional statement are tested. In this technique, test cases are designed so that each branch from all decision points is traversed at least once. In a flowchart, all edges must be traversed at least once.
3. Condition Coverage: In this technique, all individual conditions must be covered as shown in the following example:
- READ X, Y
- IF(X == 0 || Y == 0)
- PRINT ‘0’
- #TC1 – X = 0, Y = 55
- #TC2 – X = 5, Y = 0
4. Multiple Condition Coverage: In this technique, all the possible combinations of the possible outcomes of conditions are tested at least once. Let’s consider the following example:
- READ X, Y
- IF(X == 0 || Y == 0)
- PRINT ‘0’
- #TC1: X = 0, Y = 0
- #TC2: X = 0, Y = 5
- #TC3: X = 55, Y = 0
- #TC4: X = 55, Y = 5
5. Basis Path Testing: In this technique, control flow graphs are made from code or flowchart and then Cyclomatic complexity is calculated which defines the number of independent paths so that the minimal number of test cases can be designed for each independent path. Steps:
- Make the corresponding control flow graph
- Calculate the cyclomatic complexity
- Find the independent paths
- Design test cases corresponding to each independent path
- V(G) = P + 1, where P is the number of predicate nodes in the flow graph
- V(G) = E – N + 2, where E is the number of edges and N is the total number of nodes
- V(G) = Number of non-overlapping regions in the graph
- #P1: 1 – 2 – 4 – 7 – 8
- #P2: 1 – 2 – 3 – 5 – 7 – 8
- #P3: 1 – 2 – 3 – 6 – 7 – 8
- #P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8
6. Loop Testing: Loops are widely used and these are fundamental to many algorithms hence, their testing is very important. Errors often occur at the beginnings and ends of loops.
- Simple loops: For simple loops of size n, test cases are designed that:
- Skip the loop entirely
- Only one pass through the loop
- 2 passes
- m passes, where m < n
- n-1 ans n+1 passes
- Nested loops: For nested loops, all the loops are set to their minimum count, and we start from the innermost loop. Simple loop tests are conducted for the innermost loop and this is worked outwards till all the loops have been tested.
- Concatenated loops: Independent loops, one after another. Simple loop tests are applied for each. If they’re not independent, treat them like nesting.
GREY BOX TESTING:
- The Gray Box Testing is a combination of Black Box and White Box Testing. Gray box testing is also known as translucent testing or API (Application Programming Interface) testing.
- Gray Box Testing is named so because the software program is like a semitransparent or gray box inside which the tester can partially see.
-
Objectives of Gray Box Testing:
- To provide combined advantages of both black box testing and white box testing.
- To combine the input of developers as well as testers.
- To improve overall product quality.
- To reduce the overhead of long process of functional and non-functional testing.
- To provide enough free time to developers to fix defects.
- To test from the user point of view rather than a designer point of view.
-
A simple process of the gray box testing:
- Identify Inputs: Look at both black box and white box testing methods to decide what inputs are necessary for testing is suitable.
- Predict Outputs: Based on these inputs, make sure the system gives the expected outputs.
- Select Key Testing Paths: Identify the important areas or paths in the system to test, considering both its internal structure and its external behavior of the software.
- Spot Sub-Functions: check carefully into the system to find any smaller functions or features that need specific attention during testing.
- Identify Inputs for Sub-Functions: Find the exact inputs that apply to these sub-functions to ensure they are well tested.
- Predict Expected Outputs for Sub-Functions: Based on the sub-functions, predict what the outputs should be when the inputs are applied.
- Run the Sub-Function Test Cases: Execute tests on these sub-functions, checking real-world conditions and inputs.
- Verify the Results: Compare the actual results from the tests with the expected outputs to spot any issues.
- Repeat Steps 4-8: Revisit testing for different sub-functions and paths to ensure everything is fully tested.
- Refine and Repeat: Keep refining the test cases based on the results, re-checking outcomes, and making necessary adjustments.
GREY BOX TECHNIQUES:
-
Here are the main techniques of the Gray Box Testing which are included in the gray box testing:
1. Matrix Testing:
In Matrix testing technique, business and technical risks which are defined by the developers in software programs are examined. Developers define all the variables that exist in the program. Each of the variables has an inherent technical and business risk and can be used with varied frequencies during its life cycle.
2. Pattern Testing:
To perform the pattern testing , previous defects are analyzed. It determines the cause of the failure by looking into the code. Analysis template includes reasons for the defect. This helps test cases designed as they are proactive in finding other failures before hitting production.
3. Orthogonal Array Testing:
It is mainly a black box testing technique. In orthogonal array testing, test data have n numbers of permutations and combinations. Orthogonal array testing is preferred when maximum coverage is required when there are very few test cases and test data is large. This is very helpful in testing complex applications.
4. Regression Testing:
Regression Testing is testing the software after every change in the software to make sure that the changes or the new functionalities are not affecting the existing functioning of the system. Regression testing is also carried out to ensure that fixing any defect has not impacted other functionality of the software.
5. State transition Testing:
State Transition Testing is frequently applied to systems that display various states while they are being operated. Testers who have just a limited understanding of the internal states create test cases with the intention of making sure that state transitions are handled correctly.
6. Testing Decision Tables:
Decision tables are a useful tool for organizing and condensing complicated business rules and reasoning. Decision tables are used by testers with limited understanding to generate test cases covering multiple combinations of input conditions and expected results.
7. Testing APIs:
Even though the main code is not entirely known, gray box testing, also known as API (Application Programming Interface) testing, focuses on testing the system’s exposed interfaces. The main goal of testing is to make sure the API accepts various input formats and operates as intended.
8. Data Flow Testing:
Analyzing the flow of Data Testing through the system forms the basis of data flow testing. Partial knowledge testers create test cases that examine the data’s pathways throughout the application, assisting in the identification of possible problems with handling and processing the data.
GREY BOX TESTING TOOLS:
-
These tools help to the testers perform the gray box testing by combining both functional and internal testing aspects.
- Selenium: A tool used for automating web application tests. Selenium supports multiple browsers, making it ideal for testing web apps across different environments.
- Appium: Appium is great for testing mobile applications. It allows testers to automate tests on both Android and iOS platforms, ensuring mobile apps work properly.
- Postman: Postman is widely used for API testing. It helps in sending API requests and checking if the responses are correct, making it essential for testing the backend of applications.
- JUnit and NUnit: These are unit testing frameworks used for testing individual components of Java and .NET applications, respectively. They play a role in gray box testing by validating specific parts of the code.
- Burp Suite: Burp Suite is a powerful tool for testing the security of web applications. It analyzes network traffic and identifies potential security flaws, making it useful in gray box testing for vulnerability detection.
- Chrome DevTools: These are built-in browser tools that help testers inspect web pages, debug JavaScript, and log network activity. They are crucial for gray box testing, providing insights into how the application performs from a technical standpoint.
DIFFERENCE BETWEEN BLACK, WHITE AND GREY BOX TESTING:
-
In the process of STLC, three primary testing approaches are used which are Black, White and Grey box testing. Each of these methods are different with the terms of the level of knowledge the tester has about the application and how they approach the testing process.
Here is a simple comparison of them in which highlighting key aspects:
Aspect Black Box Testing White Box Testing Gray Box Testing Available Information Tester has no knowledge of the internal workings including source code and architecture. Focuses on inputs and outputs. Tester has full knowledge of internal workings, including source code and architecture. Tester has partial knowledge, such as access to design documents but not the source code. Test Coverage Limited coverage, based on expected behavior and requirements without internal knowledge. Full coverage, as tester has access to source code and can test all code paths. Moderate coverage, with focus on areas where some knowledge is available. Time of Analysis Performed after the application is built, during later stages of the SDLC. Can be performed early in the SDLC, integrating into the development process. Performed after some parts of the application are built but allows for earlier analysis than black box testing. Tool Usage Uses dynamic analysis tools for testing during runtime, focusing on user behavior. Uses static analysis tools (like code analyzers) to inspect source code. Uses both dynamic and limited static analysis tools depending on available knowledge. Tester Mindset Acts as an end user, focusing on functionality without knowledge of internal workings. Acts like a developer, focusing on internal logic, structure, and code. Partially a developer and user, focusing on the expected behavior with some internal knowledge. Test Case Input Size Largest, as it needs to cover broad user interactions and scenarios. Smaller compared to black box, as it focuses on specific code paths. Smaller than both black and white box, focused on available knowledge areas. Finding Hidden Errors Difficult to detect, as it focuses only on outputs. Easier due to full access to internal code and logic. Challenging, may find some hidden errors that are visible at the user level. Algorithm Testing Not suitable, as it lacks the internal access to algorithms. Well-suited for testing internal algorithms and logic. Not suitable, as it lacks full access to algorithms and internal code. Other Names Functional testing, data-driven testing, closed box testing. Structural testing, clear box testing, code-based testing, transparent testing. Translucent testing.