News »Browse Articles »
Black Box and White Box Testing for Application Blocks
0
Black Box and White Box Testing for Application Blocks
Overview
After you complete the design and code review of the application block, you need to test the application block to make sure it meets the functional requirements and successfully implements the functionality for the usage scenarios it was designed and implemented for.
The testing effort can be divided into two categories that complement each other:
* Black box testing. This approach tests all possible combinations of end-user actions. Black box testing assumes no knowledge of code and is intended to simulate the end-user experience. You can use sample applications to integrate and test the application block for black box testing. You can begin planning for black box testing immediately after the requirements and the functional specifications are available.
* White box testing. (This is also known as glass box, clear box, and open box testing.) In white box testing, you create test cases by looking at the code to detect any potential failure scenarios. You determine the suitable input data for testing various APIs and the special code paths that need to be tested by analyzing the source code for the application block. Therefore, the test plans need to be updated before starting white box testing and only after a stable build of the code is available.
A failure of a white box test may result in a change that requires all black box testing to be repeated and white box testing paths to be reviewed and possibly changed.
The goals of testing can be summarized as follows:
* Verify that the application block is able to meet all requirements in accordance with the functional specifications document.
* Make sure that the application block has consistent and expected output for all usage scenarios for both valid and invalid inputs. For example, make sure the error messages are meaningful and help the user in diagnosing the actual problem.
You may need to develop one or more of the following to test the functionality of the application blocks:
* Test harnesses, such as NUnit test cases, to test the API of the application block for various inputs
* Prototype Windows Forms and Web Forms applications that integrate the application blocks and are deployed in simulated target deployments
* Automated scripts that test the API of the application blocks for various inputs
This chapter examines the process of black box testing and white box testing. It includes code examples and sample test cases to demonstrate the approach for black box testing and white box testing application blocks. For the purpose of the examples illustrated in this chapter, it is assumed that functionality testing is being done for the Management Application Block (CMAB). The CMAB has already been through design and code review. The requirements for the CMAB are the following:
* It provides the functionality to read and store configuration information transparently in a persistent storage medium. The storage mediums are SQL Server, the registry, and an XML file.
* It provides a configurable option to store the information in encrypted form and plain text using XML notation.
* It can be used with desktop applications and Web applications that are deployed in a Web farm.
* It caches configuration information in memory to reduce cross-process communication, such as reading from any persistent medium. This reduces the response time of the request for any configuration information. The expiration and scavenging mechanism for the data that is cached in memory is similar to the cron algorithm in UNIX.
* It can store and return data from various locales and cultures without any loss of data integrity.
Black Box Testing
Black box testing assumes the code to be a black box that responds to input stimuli. The testing focuses on the output to various types of stimuli in the targeted deployment environments. It focuses on validation tests, boundary conditions, destructive testing, reproducibility tests, performance tests, globalization, and security-related testing.
Risk analysis should be done to estimate the amount and the level of testing that needs to be done. Risk analysis gives the necessary criteria about when to stop the testing process. Risk analysis prioritizes the test cases. It takes into account the impact of the errors and the probability of occurrence of the errors. By concentrating on the test cases that can lead to high impact and high probability errors, the testing effort can be reduced and the application block can be ensured to be good enough to be used by various applications.
Preferably, black box testing should be conducted in a test environment close to the target environment. There can be one or more deployment scenarios for the application block that is being tested.
Source:
http://msdn.microsoft.com/en-us/library/ms998233.aspx
After you complete the design and code review of the application block, you need to test the application block to make sure it meets the functional requirements and successfully implements the functionality for the usage scenarios it was designed and implemented for.
The testing effort can be divided into two categories that complement each other:
* Black box testing. This approach tests all possible combinations of end-user actions. Black box testing assumes no knowledge of code and is intended to simulate the end-user experience. You can use sample applications to integrate and test the application block for black box testing. You can begin planning for black box testing immediately after the requirements and the functional specifications are available.
* White box testing. (This is also known as glass box, clear box, and open box testing.) In white box testing, you create test cases by looking at the code to detect any potential failure scenarios. You determine the suitable input data for testing various APIs and the special code paths that need to be tested by analyzing the source code for the application block. Therefore, the test plans need to be updated before starting white box testing and only after a stable build of the code is available.
A failure of a white box test may result in a change that requires all black box testing to be repeated and white box testing paths to be reviewed and possibly changed.
The goals of testing can be summarized as follows:
* Verify that the application block is able to meet all requirements in accordance with the functional specifications document.
* Make sure that the application block has consistent and expected output for all usage scenarios for both valid and invalid inputs. For example, make sure the error messages are meaningful and help the user in diagnosing the actual problem.
You may need to develop one or more of the following to test the functionality of the application blocks:
* Test harnesses, such as NUnit test cases, to test the API of the application block for various inputs
* Prototype Windows Forms and Web Forms applications that integrate the application blocks and are deployed in simulated target deployments
* Automated scripts that test the API of the application blocks for various inputs
This chapter examines the process of black box testing and white box testing. It includes code examples and sample test cases to demonstrate the approach for black box testing and white box testing application blocks. For the purpose of the examples illustrated in this chapter, it is assumed that functionality testing is being done for the Management Application Block (CMAB). The CMAB has already been through design and code review. The requirements for the CMAB are the following:
* It provides the functionality to read and store configuration information transparently in a persistent storage medium. The storage mediums are SQL Server, the registry, and an XML file.
* It provides a configurable option to store the information in encrypted form and plain text using XML notation.
* It can be used with desktop applications and Web applications that are deployed in a Web farm.
* It caches configuration information in memory to reduce cross-process communication, such as reading from any persistent medium. This reduces the response time of the request for any configuration information. The expiration and scavenging mechanism for the data that is cached in memory is similar to the cron algorithm in UNIX.
* It can store and return data from various locales and cultures without any loss of data integrity.
Black Box Testing
Black box testing assumes the code to be a black box that responds to input stimuli. The testing focuses on the output to various types of stimuli in the targeted deployment environments. It focuses on validation tests, boundary conditions, destructive testing, reproducibility tests, performance tests, globalization, and security-related testing.
Risk analysis should be done to estimate the amount and the level of testing that needs to be done. Risk analysis gives the necessary criteria about when to stop the testing process. Risk analysis prioritizes the test cases. It takes into account the impact of the errors and the probability of occurrence of the errors. By concentrating on the test cases that can lead to high impact and high probability errors, the testing effort can be reduced and the application block can be ensured to be good enough to be used by various applications.
Preferably, black box testing should be conducted in a test environment close to the target environment. There can be one or more deployment scenarios for the application block that is being tested.
Source:
http://msdn.microsoft.com/en-us/library/ms998233.aspx
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Testing community to read.
Most Popular News
-
How to Test Web Applications against SQL Injection Attacks
Published about 30-01-2009 | Rated +2 -
Top 20 practical software testing tips
Published about 02-02-2009 | Rated +2 -
India to lead in software testing
Published about 01-02-2009 | Rated +2 -
Software installation / uninstallation testing
Published about 16-02-2009 | Rated 0
Most Recent User Submitted News
- Twenty essential firefox addons for testing
Published about 03-06-2009 | Rated 0 - Recovery testing
Published about 01-10-2009 | Rated 0 - How to Start a Startup
Submitted by Maleekjan | Rated 0 - Testing Stop Process
Published about 26-06-2009 | Rated 0







