Software testing is an activity to check whether the actual results match the expected results and to ensure that the software system is defect. Depending on the information available about the internal structure to the tester testing can be classified in three ways.
What is Black Box
It is a testing approach which is used to test the software without the knowledge of the internal structure of program or application. Testing is based on external expectations; internal behavior of the application is unknown.
It also known as data-driven, box testing, data-, and functional testing.
Advantages:
Simplicity: Testers focus on input and output without the necessity to know how the system works internally, so such tests are easy to make.
Rapidity: The preparation time of these tests is very short.
Impartiality: “an unaffiliated opinion”, i.e. the test results are neutral when doing tests from the perspective of users instead of developers.
Disadvantages
Superficiality: The tests cannot show which parts of the codes lead to a potential problem. Some parts of the back-end may be not tested at all.
Redundancy: A tester writes many test cases to check something that could have been tested by only one test case.
What is White Box testing
It is a testing approach in which internal structure is known to the tester. Internal working is known, and the tester can test accordingly. Testing is best suited for a lower level of testing like Unit Testing, Integration testing. Thus, white box testing can be regarded as a clear and open box, i.e. a box whose inside can be seen and can also be changed. Complete understanding needs to implement WhiteBox testing.
Advantages
Anticipation: It helps in finding a issue or a blocking point during a program’s development, it helps finding bugs which can be a error or issue in future.
Optimization: With the access to change the codes, a tester could modify the codes for optimization and better performances.
Exhaustiveness: A tester could fully review the codes and is able to spot bugs and vulnerabilities that might be hidden on purpose.
Disadvantages
Complexity: The tests demand competence in programming and strong knowledge of the system being tested.
Duration: The length of the source codes can make these tests last for a long time.
Automation: Tools needed to make these tests, such as code analyzers, debuggers, etc, can have a negative impact on the system’s performances or even impact the results of the tests.
Scalability: Since the source code of a program is often very long, it is hard to find out what is tested and what can be put aside. Thus, a tester cannot always test everything.
Intrusion: White box testing is very intrusive, so there exists the possibility that testers make the codes available to another person who is external to the company. Thus, there are risks of breakage.
What is Grey Box testing
Grey box testing compiles the two previous approaches: they test both the functionalities and functioning of a website. That means that a tester gives an input to the system, checks that if result is what is expected, and checks through which process this result was obtained. Partially Knowledge of the internal working structure is required. Grey Box Testing is also known as translucent testing as the tester has limited knowledge of coding.
An example of Gray Box Testing would be when the codes for two units/modules are studied (White Box Testing method) for designing test cases and actual tests are conducted using the exposed interfaces (Black Box Testing method)
Advantages
Impartiality: This testing method involves testing at the user or black-box level.
Intelligence: By knowing the internal structure of the program, a tester can create more varied and smart scenarios which helps test coverage to some extent.
Disadvantages
1. Non exhaustiveness: Since the sources codes are not accessible, the tests cannot provide a complete coverage of the program.