whatsapp
top_banner_img

What is gray/ grey box testing? Examples Included!

Penetration testing, Process

Thursday April 18, 2019

Gray box testing/ grey box testing is a method of testing a software system – application or product, externally and internally by using a combination of “white box testing” and “black-box testing”.

Gray box testing is carried out with limited or partial knowledge of the internal workings of the software system/application.

With a view to conquering the deficiencies and ambiguities found in such type of testing, Grey Box Testing (also spelled as Gray Box Testing) has been developed as a productive merger of white box and black box testing.

White Box Testing – the internal structure (code) is known

Black Box Testing – the internal structure (code) is unknown

Grey Box Testing – the internal structure (code) is partially known

let’s dive dip into the implication of grey/gray box testing in software engineering.

white box testing + black box testing

Grey Box Testing Methodology

First – White Box Testing to study and gain a basic understanding of the internal features of the application.

Second – Design and define test cases based on thorough knowledge and understanding to cover each and every aspect of the application.

Third – Black box testing to execute developed test cases to externally test the qualities of the software application.

Best Suited Applications:

Grey-box testing is an ideal fit for Web-based applications.

Grey-box testing is the best technique for domain or functional testing

Grey Box Testing Strategy in software engineering

It’s not necessary in this methodology that source code is required by the tester to design test cases. To carry out this testing process, test cases can be designed based on the algorithm, knowledge of architectures, internal states, or other advanced descriptions of the program behavior.

It utilizes all the clear-cut techniques of black box testing for function testing. The generation of a test case is based on requirements and presetting all the conditions by the assertion method.

The standard steps to carry out Grey box Testing are as follows:

Step 1: Selection and identification of inputs from White-Box and Black-Box testing inputs.

Step 2: Identification of probable outputs from the above-selected inputs.

Step 3: Identification of all the key paths to pass through during the testing phase.

Step 4: Identification of sub-functions to carry out deep-level testing.

Step 5: Identification of inputs for sub-functions.

Step 6: Identification of likely outputs for sub-functions.

Step 7: Execution of a test case for sub-functions.

Step 8: Verification of the appropriateness of outcome.

Step 9: Repetition of Steps 4 and 8.

Step 10: Repetition of Steps 7 and 8.

Security-related, GUI-related, Database related, Browser related, and Operational system-related testing are all part of the test cases designed for the process.

Types of Grey box testing/gray box testing/Grey box testing techniques

Matrix Testing

Matrix testing, a technique coming under Grey Box testing, defines all the used variables of a particular program. In any program, variables are the essential elements through which values can move through the program.

It should be on par with the requirement without which the readability of the program and speed of the software will be reduced. The matrix technique is a way to eliminate uninitialized and unused variables by identifying used variables from the program.

Examination of inherent risks like technical risks and business risks that are associated with the variables with different frequencies labeled by the software developer is carried out under this type of testing.

The design of test cases becomes smooth and easier when all of this information is summarized in two types of tables as in the following example:

All Info About Grey Box Testing (With Examples) All Info About Grey Box Testing (With Examples)

From the information in the above two tables, the testing analyst can immediately make out that the technical and business aspect of the code, namely saving and deleting records requires testing.

Regression Testing

This type of testing is carried out after executing a functional development or repair to the program.

To verify whether the modification in any of the previous versions of the software has regressed or caused any unintended or adverse side effect in other aspects of the program in the new version, the following testing strategies can be pursued:

  • Retesting within a firewall where dependencies are analyzed for choosing baseline tests
  • Retesting risky use cases where the risk factor is considered
  • Retesting all existing test cases
  • Retesting by profile where time is allocated in proportion to the operational profile
  • Retesting changed segment where code changes are compared for choosing baseline tests

At some stage in confirmation testing, if any defect got rectified, and that part of the software started functioning as intended, there might be a possibility that the rectified defect may have initiated a different defect somewhere else in the software.

Here, regression testing takes care of these types of defects by utilizing the above-mentioned testing strategies. The tester, as a reference, may use 80% of the allowed time to run existing test cases and 20% of the allowed time to execute exploratory testing.

Orthogonal Array Testing or OAT

The intention behind this testing is to locate defective logic in the system by providing coverage with the maximum code as well as GUI functions and with minimum test cases in a statistical and organized way of software testing.

Complex applications and e-comm products can be tested with this technique. Orthogonal Array Testing is composed of an array of values in which a variable is represented in each column and a test case is represented in each row.

A simple example is as follows:

All Info About Grey Box Testing (With Examples)

By conveying values for each factor and then, of course, extrapolating for combined pairing, the total number of test cases will surely come down to nine from 27.

Though simple, this effective technique helps in maximizing the required testing coverage.

Pattern Testing

This testing is carried out by using the record of analysis on the historical data of the previous system defects. These analyses may contain specific reasons for the defect or bug with information on the problem that has been addressed, applicable situation, generic test cases, etc.

Unlike black box testing, grey box testing plows within the code to determine the reason for the failure so that they can be fixed in the next software. It is noteworthy that pattern testing is applicable only to such type of software that has been developed by following the same pattern of previous software as the possibility of similar defects occurs in this software only.

Generally, the Grey box methodology employs automated software testing tools to conduct the testing. Module drivers and stubs are created to relieve the tester from manually generating the code.

Examples for grey/gray box testing

Grey Box Testing is said to be performed when –

  • The codes for two modules or units are studied for designing test cases which is the White Box Testing method and then
  • Actual tests are conducted using the exposed interfaces which are the Black Box Testing method.

For example, during testing of Drupal website containing links, if an error crops up while clicking that link, changes can be made in the HTML code for further checking. Here the user is carrying out white box testing by altering the code and black-box testing by testing on the front end.

Types of testing

Objectives of Grey Box Testing

Some of the main objectives are:

  1. To help combine the inputs from both testers and developers to get the best results
  2. To improve the overall quality of the product with less cost
  3. To find defects early and get the developers more time to fix the issues
  4. To combine the advantages of both black box and white box testing
  5. To reduce the overhead of functional and non-functional test documentations

Advantages of Grey Box Testing

Now, let us look at some of the advantages of choosing Grey Box testing.

  1. The testing is carried out from a user perspective and hence helps to improve the overall quality of the application.
  2. In most cases, the testers do not need technical or programming knowledge to get started with grey box testing. This also means that the manual and automation testers can both perform this testing with equal ease.
  3. Since the defects are found earlier, it gives the development teams more time to fix and deploy the changes.
  4. The clarity and transparency of the test ensure there are no conflicts between the testers and developers.
  5. It can be much more effective both quality-wise and cost-wise when compared to integration testing

Disadvantages of Grey Box Testing

In this section, we look at some disadvantages of Grey Box testing

  1. Since we are looking at only part of the system, it is very difficult to assign defects to a particular module.
  2. Since the testers have only limited access to the code, they have only limited knowledge about the paths traversed. This can reduce the coverage.
  3. It can be difficult to design effective test cases for grey box testing
  4. It can not be used for algorithm testing
  5. Neither white box nor black box testing benefits can be reaped fully through the process.

Challenges in Grey Box Testing

Here, we discuss few common challenges related to Grey Box Testing, that are preventing companies from utilizing it fully.

  1. In some cases, the test case may be a pass but the displayed results would be incorrect. Such cases can not be handled well in grey box testing.
  2. In case the module under test crashes it may lead to aborting the test and it would be difficult to find the reason.
  3. Testers do not have access to the source code, hence they may miss some critical vulnerabilities in the application
  4. For large applications, it can be very time-consuming to check all the input combinations and traverse all the different paths involved.

Tools used for Grey Box Testing

The tools used for automation of black and white box testing can also very well be used for Grey Box Testing. The most popular tools used are:

  • Selenium
  • Appium
  • Postman
  • Chrome Dev Tools
  • Burp Suite
  • JUnit
  • Cucumber
  • RestAssured

What is gray box penetration testing?

The main idea behind the gray box/ grey box pen testing is to form a precise idea about network security.  By leveraging the information provided in the design document of a particular network assessments can be made that can be used to predict risk-prone areas in a network.  Usually minimal credential and information is available for this type of testing.  The level of access a hacker could gain can be envisioned using this type of testing. In short, both internal and external attacks can be simulated

Grey-box-penetration-testing

Conclusion

Nowadays in this modern world, nobody is indisputably safe from cybercrime irrespective of whether it is a big corporate or an individual, government organization, or non-benefit association.

The potentiality of becoming a cybercrime target looms large. Grey box testing comes up as a priceless tool for securing security in software. Significant vulnerabilities can be uncovered by giving in less effort and cost.

Frequently Asked Question(s)

Grey box testing is the effective combination of both black box testing and white box testing performed for better test coverage for an application

Imagine that there is module which has codes. For testing it you need white box testing. For designing the test cases for the entire application and to conduct actual tests you need black box testing

Since it's a combination of two testing methods, effectiveness will be double than that of any normal testing methods, other advantages include, better user validation, excellent test scenarios can be designed and lastly, testing is performed with high level database diagram and data flow management.

Grey box resting can be performed by testers with high knowledge or someone who has programming skills as well.

Mail

Hire

Cost Calc.

Call Us