Gray-Box Testing


You're already familiar with black-box and white-box testing, but another type of testing, gray-box testing, is a mixture of the twohence the name. With gray-box testing, you straddle the line between black-box and white-box testing. You still test the software as a black-box, but you supplement the work by taking a peek (not a full look, as in white-box testing) at what makes the software work.

Web pages lend themselves nicely to gray-box testing. Most web pages are built with HTML (Hypertext Markup Language). Listing 14.1 shows a few lines of the HTML used to create the web page shown in Figure 14.6.

Listing 14.1. Sample HTML Showing Some of What's Behind a Web Page
 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <title>Superior Packing Systems</title> <meta name="Microsoft Theme" content="sandston 111, default"> <meta name="Microsoft Border" content="t, default"> </head> <body background="_themes/sandston/stonbk.jpg" bgcolor="#FFFFCC"   text="#333333" link="#993300" vlink="#666633" alink="#CC6633">   <!--msnavigation--><table border="0" cellpadding="0" cellspacing="0"   width="100%"><tr><td><!--mstheme--><font face="Arial, Helvetica"> <h1 align="center"><!--mstheme--><font color="#660000">   <img src="/books/4/223/1/html/2/_derived/index.htm_cmp_sandston110_bnr.gif" width="600"   height="60" border="0" alt="Superior Packing Systems"><br> &nbsp; <br> <a href="./"><img src="/books/4/223/1/html/2/_derived/home_cmp_sandston110_gbtn.gif" width="95"   height="20" border="0" alt="Home" align="middle"></a> <a href="services.htm">   <img src="/books/4/223/1/html/2/_derived/services.htm_cmp_sandston110_gbtn.gif" width="95"   height="20" border="0" alt="Services" align="middle"></a>   <a href="contact.htm"><img src="/books/4/223/1/html/2/_derived/contact.htm_cmp_sandston110_gbtn.gif"   width="95" height="20" border="0" alt="Contact Us" align="middle">   </a><!--mstheme--></font></h1> 

Figure 14.6. Part of this web page is created by the HTML in Listing 14.1.


NOTE

If you're not familiar with creating your own website, you might want to read a little on the subject. An introductory book such as Sams Teach Yourself to Create Web Pages in 24 Hours, would be a great way to learn the basics and help you discover a few ways to apply gray-box testing techniques.


HTML and web pages can be simply tested as a gray box because HTML isn't a programming language that's been compiled and inaccessible to the testerit's a markup language. In the early days of word processors, you couldn't just select text and make it bold or italic. You had to embed markups, sometimes called field tags, in the text. For example, to create the bolded phrase

This is bold text.

you would enter something such as this into your word processor:

[begin bold]This is bold text.[end bold]

HTML works the same way. To create the line in HTML you would enter

<b>This is bold text.</b>

HTML has evolved to where it now has hundreds of different field tags and options, as evidenced by the HTML in Listing 14.1. But, in the end, HTML is nothing but a fancy old-word-processor-like markup language. The difference between HTML and a program is that HTML doesn't execute or run, it just determines how text and graphics appear onscreen.

TIP

To see the HTML for a web page, right-click a blank area of the page (not on a graphic) and select View Source (IE) or View Page Source (Firefox) from the menu.


Since HTML isn't a programming language and is so easy for you, as the tester, to view, you might as well take advantage of it and supplement your testing. If you're a black-box tester, it's the perfect opportunity to start moving toward white-box testing.

Start by learning to create your own simple web pages. Learn the basic and common HTML tags. Look at the HTML for many different pages on the Web, see what techniques are used and how those techniques make things work on the page. Once you become familiar with HTML, you'll be able to look at the web pages you're testing in a whole new way and be a more effective tester.



    Software Testing
    Lessons Learned in Software Testing
    ISBN: 0471081124
    EAN: 2147483647
    Year: 2005
    Pages: 233

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net