Software Testing

ยท

8 min read

What is Software Testing?

Software testing is a process of identifying the correctness of software by considering its all attributes and evaluating the execution of software components to find software bugs or errors or defects.

Software testing provides an independent view and objective of the software and gives surety of the fitness of the software. It involves testing all components under the required services to confirm whether it is satisfying the specified requirements or not.

What is Testing?

Testing is a group of techniques to determine the correctness of the application under the predefined script but, testing cannot find all the defects of an application. The main intent of testing is to detect failures of the application so that failures can be discovered and corrected.

Type of software testing

Manual testing

The process of checking the functionality of an application as per the customer's needs without taking any help from automation tools is known as manual testing. For manual testing, knowledge of any specific tool is not required, rather than having a proper understanding of the product.

White box testing

White box testing is known as glass box. It tests internal coding and infrastructure of a software focus on checking predefined inputs against expected and desired outputs. It is based on the inner workings of an application and revolves around internal structure testing. The primary goal of white box testing is to focus on the flow of inputs and outputs through the software and strengthening the security of the software.

The term 'white box' is used because of the internal perspective of the system. The clear box or white box or transparent box name denotes the ability to see through the software's outer shell into its inner workings.

Developers do white box testing. In this, the developer will test every line of the code of program. The developers perform the white-box testing and then send the application or the software to the testing team, where they will perform the black box testing and verify the application along with the requirements and identify the bugs and sends it to the developer.

Here, the test engineers will not include in fixing the defects for the following reasons:

  • Fixing the bug might interrupt the other features. Therefore, the test engineer should always find the bugs, and developers should still be doing the bug fixes.

  • If the test engineers spend most fo the time fixing the defects, then they may be unable to find the other bugs in the application.

The white box testing contains various tests, which are as follows:

Path testing

In the path testing, we will write the flow graphs and test all independent paths. Here flow graph implies that flow graphs are representing the flow of the program and also show how every program is added with one another.

Test all the independent paths implies that suppose a path from main() to function G, first set the parameters and test if the program is correct in that particular path, and in the same way test all other paths and fix the bugs.

Loop testing

In the loop testing, we will test the loops as while, for, and do-while etc. also check for ending condition if working correctly and if the size of the conditions is enough.

For example We have a various requirements such as 1, 2, 3, 4. Developers write program such as program 1, 2, 3, 4 for the parallel conditions. Here the application contains the 100s line of codes.

The developers will do the white box testing, and they will test all the five programs line by line of code to find the bug. If they found any bug in any of the programs, they will correct it. If they find any bug in any of the programs, they will correct it and start testing from the beginning.

Now, if the client wants to modify the requirements, then the developer will do the required changes and test all four program again, which take lots of time and efforts.

These issues can be resolved in the following ways:

We will write test for a similar program where the developer writes these test code in the related language as the source code. Then they execute these test code, which is also known as unit test programs.

If there is any requirement modification or bug in the code, then the developer adjusts both in the main program and the test program.

Condition testing

Here we test all logical conditions for both true and false values, that is, we will verify for both if and else conditions.

Testing based on the memory (size) perspective

The size of the code is increasing for the following reasons:

  • The reuse of code is not there

  • The developers use logic that might be modified.

  • Developers declared so many functions and variables that might never be used in any portion of the code.

Test the performance (Speed, response time) of the program

The application could be slow for the following reasons:

  • When logic is used

  • For the conditional cases, we will use or & and adequately

  • Switch case, which means we cannot use nested if

Reasons for white box testing

  • It identifies internal security holes.

  • To check the way of input inside the code.

  • Check the functionality of conditional loops.

  • To test function, object, and statement at an individual level.

Advantages of White box testing

  • White box testing optimizes codes so hidden errors can be identified

  • Test cases of white box testing can be easily automated

  • This testing is more thorough than other testing approaches as it covers all code paths.

  • It can be started in the SDLC phase even without GUI.

Disadvantages of White Box testing

  • Too much time-consuming when it comes to large-scale programming applications.

  • It is much expensive and complex

  • It can lead to production error because it is not detailed by the developers.

Techniques used in White Box testing

  • Data flow testing

  • Control flow testing

  • Branch testing

  • Statement testing

  • Decision Testing

Black Box testing

Black box testing is a technique of software testing which examines the functionality of the software without peering into its internal structure of coding.

In this method, tester selects a function and gives input value to examine its functionality, and check whether the function is giving expected output. If the function produces correct output, then it is passed in testing, otherwise failed.

Generic steps of Black Box testing

  • The black box test is based on the specification of requirements, so it is examined in the begining

  • In the second step, the tester creates a positive test scenario and an adverse test scenario by selecting valid and invalid values to check the how software is processing them.

  • In the third step, the tester develops various test cases such as decision table, all pairs test, equivalent division, error estimation, cause-effect graph etc.

  • The fourth phase includes the execution of all test cases.

  • In the fifth step, the tester compares the expected output against the actual output.

  • In the sixth and final step, if there is any flaw in the software, then it is cured and tested again.

Test procedure

The test procedure of black box testing is a king of process in which the tester has specific knowledge about the software's work, and it develops test cases to check the accuracy of the software's functionality.

Techniques used in Black Box testing

  • Decision table technique

  • Boundry Value technique

  • State Transition technique

  • All-pair testing technique

  • Cause-Effect Technique

  • Equivalence of Partitioning Technique

  • Error Guessing Technique

  • Use Case Technique

Grey Box Testing

Grey box testing is a software testing method to test the software application with partial knowledge of internal working structure. It is a combination of Black Box and White Box testing because it involves access to internal coding to design test cases as white box testing and testing practices are done at the functionality level as black box testing.

Why Grey Box testing?

  • It provides combined benefits of both Black Box and White Box testing

  • It includes the input values of both developers and testers at the same time to improve the overall quality of the product.

  • It reduces time consumption of long process of functionality and non-functionality testing.

  • It gives sufficient time to the developer to fix the product defects.

  • It includes user point of view rather than designer or tester point of view.

  • It involves examination of requirements and the determination of specifications by user's point of view deeply.

Techniques of Grey Box testing

Matric testing

This testing technique comes under Grey Box testing. It defines all the used variables of a particular program.

Regression testing

Regression testing is used to verify that modification in any part of the software has not caused any adverse and unintended side effects in any other part of the software.

Orthogonal Array testing or OAT

The purpose of this testing is to cover maximum code with minimum test cases.

Pattern Testing

Pattern testing applies to such type of software that is developed by following the same pattern of previous software.

Did you find this article valuable?

Support Atir Nayab by becoming a sponsor. Any amount is appreciated!

ย