Unit 3 ST Rejinpaul
Unit 3 ST Rejinpaul
com
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
IT8076-SOFTWARE TESTING (2017 Regulation)
UNIT-III
The Need of Levels of testing, Unit test , Unit test planning, Designing the unit test. Test Harness, Running the
unit tests and recording results. Integration Tests- Designing Integration test- Integration Test Planning-
Scenario Testing –Defect Bash Elimination-System testing -Acceptance testing-Performance Testing-Regression
Testing-Internationalization Testing- Adhoc Testing-Alpha-Beta Tests-Testing OO Systems-Usability and
Accessibility Testing- configuration testing – compatibility testing –testing the documentation –website testing
There may be overriding of methods where a subclass may replace an inherited methods with a locally define
methods.
Designing a new set of test cases may be necessary.
This is because the two methods may be structurally different
triangle (color() )
Suppose the shape superclass has a subclass, triangle, and triangle has a subclass, equilateral triangle. Also
suppose that the method display in shape needs to call the method color for its operation.
It is very important that the tester at any level of testing to carefully record, review and check test results.
The tester must determine from the results whether the unit has passed or failed the test
If the test is failed, the nature of the problem should be recorded in what is sometimes called the test incident
report.
Differences from expected behavior should be described. When a unit fails a test there may be several reasons
for the failure.
fault in the unit implementation
A fault in the test case specification (the input or the output was not specified correctly)
A fault in test procedures execution( the test should be rerun)
A fault in the test environment (perhaps a database was not set up properly)
A fault in the unit design (the code correctly adheres to the design specification , but the latter is
incorrect)
When a unit has been completely tested and finally passes all of the required tests it is ready for integration
Integration Test-Goals
Integration test for procedural code has two major goals
To detect defects that occur on the interfaces of units
To assemble the individual unit into working subsystem and finally a complete system that is ready for
system test.
In unit test the tester attempts to detect defects that are related to the functionality and structure of the unit.
Some simple unit interfaces are more adequately tested during integration test when each unit is finally
connected to a full and working implementation of those unit it calls, and those that call it.
Component 1
Component 9
Component 5 Component 6 Component 7 Component 10
Component 8
“A set of Modules and Interfaces”
In the above diagram, it is clear that there are at least 12 interfaces between the modules to be tested (9 explicit and
3 explicit). Now what will be the order of interface to be tested. There are several methodologies available , to in
decide the order for integration testing. These are as follows:-
1. Top Down Integration
2. Bottom up Integration
11
12
Component 8
13
Component 1
Component 6 Component 8
Component 7
14
15
Agent
Actor
Que
Cheque ry
.
System
Response
.
se
pon
Cash Res
.
Actor and System Response in Use Case for ATM cash withdrawal
16
19
20
25
26
27
• If this suite fails , escalating to the developer to identify the changes or roll back to the state where
smoke test suite succeeds
2. Understand the criteria for Selecting test cases
1. Include TC that has max defects.
2. Include TC where changes are made.
3. Include TC that test the basic functionality.
4. Include TC in which problems are reported.
5. Include TC that test end-to-end behavior.
6. Include TC for positive conditions.
7. Include the TC that are visible to the user.
3. Classifying test cases
Alternative methodology :
1. Regress all
2. Priority based ( priority 0,1, 2 )
3. Regress Changes
4. Random Regression
5. Context based dynamic regression
5.Resetting test cases for execution
• When there is a major change in the product
• When there is a change in the build procedure that affects the product
• In a large release cycle where some test cases have not been executed for a long time
• When you are in the final regression test cycle with a few selected test cases
• In a situation in which the expected results could be quite different from history
6. How to conclude results
29
PASS( with FAIL Analyze the work Work round needs good review as they
round and if create side effects
work around)
satisfied mark as
PASS
PASS PASS PASS This test case could have been included for
finding side-effects or Wrong selection
INTERNATIONALIZATION TESTING:-
Introduction I18n validation
Primer Fake language testing
Terminology Language testing
Test phases for I18n Localization testing
Enabling testing Tools
Locale testing
Introduction:-
Market of software is becoming truly global. The advent of Internet has removed some of the technology barriers on
widespread usage of software products and has simplified the distribution of Software Products
Building Software for the International market, supporting multiple languages, in a cost effective and timely manner is
a matter of using internationalization standards throughout the software development life cycle- from requirements
capture through design, development, testing and maintenance.
If some Guidelines are not followed in the SDLC for internationalization, the effort and additional cost to
support every new language will increase significantly overtime. Testing for Internationalization is done to ensure that
the software does not assume any specific language or conventions associated with a specific language. Testing for
language or conventions associated with a specific language. Testing for Internationalization has to be done in various
phases of SDLC.
Terminology Used in Internationalization
Definition of Language :-
Language – Language is a tool used for communication. Language has Semantics or the meanings associated
with the sentences. For the same language , the spoken usage , word usage and grammar could vary from
country to another, however the character /alphabets may remain the same in most cases.
Character Set
ASCII – American Standard Code for Information Interchange:
– Uses 8 bit for representing characters
30
Locale
– Each of the languages is spoken differently in different countries and states
– There could be many countries speaking the same language, using the same characters, punctuations,
etc.
– But some conventions may be different (currency and date format)
– For example, English is used widely in the US and India, but
Currency : $ and Rs.
$1,000,000 and Rs. 1,00,000
– There could be multiple currencies in a country (Euro and Franc in France)
– There could be multiple locale for a language in the same country
Terminology
• Internationalization(I18n)
• also called I18n, the subscript 18 is used to mean that there are 18 characters between “I” and the last
“n” in the word Internationalization
31
Message Consolidation
1. Enabling testing
2. Locale testing
Message Translation
3. I18N Testing and
Validation Include messages into
4. Fake language Testing the product
The Testing for internationalization is done in multiple phases in the project life cycle. The diagram below Elaborates
the SDLC V model described and how the different phases of this model are related to various I18n testing Activities.
Enabling testing is done by the developer as a part of the Unit testing Phase.
Some Important Aspects of Internationalization testing are:-
32
Acceptance
Acceptance
Testing
Testing
Localization
LocalizationTesting
Testing System
SystemTesting
Testing
Language
LanguageTesting
Testing Integration
IntegrationTesting
Testing
Fake
FakeLanguage
LanguageTesting
Testing
II n Validation
18 n Validation
18
Component
Locale ComponentTesting
Testing
LocaleTesting
Testing
Enabling
EnablingTesting
Testing Unit
UnitTesting
Testing
Enabling Testing:-
Enabling Testing is a white box testing methodology , which is done to ensure that the source code used in the
software allows internationalization. A source code , which has hard coded currency format and date format, fixed
length GUI screens or dialog boxes, read and print messages directly on the media is not considered enabled code.
An activity of code review or code inspection mixed with test cases for unit testing, with an objective to catch
I18n defects is called enabling testing. The year 2000 is a classic I18n defect. Enabling testing finds the majority of
I18n defects If this is not done in the unit test phase, exponential effort has to be spent in later phases as it impacts
code, design, etc. Also other I18n testing for fake language, l10n has to be repeated.
Enabling Testing – Checklist:-
• Find out those APIs/function calls that can’t be used for I18n (printf, scanf) – NLSAPI, unicode, GNU gives
some APIs instead
• Check the code for hard-coded date, currency format, ASCII usage or character constants.
• Check the code for arithmetic operations on date ie there is no computations (additions and subtractions) done
on date variables or different format forced to the date in the code.
• Check that no format is forced to date field
• Check each field in the screen for extra space (normally 50% extra space is allotted)
• Ensure that region-based messages/slang are not used (e.g., Hi, references to colour)
• Ensure no string operations are performed on the code (substring search, concatenation); only APIs provided by
I18n are to be used
• The code does not assume any predefined path, filename, directory name in NLS directory
• Check code doesn’t make any assumptions about bit representation (8, 16, 32), and bit operations are not used
• Ensure adequate length is allocated to accommodate translated messages
• Check that pictures, logos and bitmaps do not have embedded text
• Ensure that all messages have code in-line comments for helping translators (e.g. pre-ponement of meeting)
• Ensure all resources are (dialog boxes, screen shots, bitmaps, etc.)
33
J
a English J
p a
a p English
n a
Arabic n
e
s e Arabic
e s
e
Locale Testing:-
Locale Testing is not as elaborate procedure as enabling testing. The focus of Locale testing is Limited to :-
Changing the different locale using the system settings or environment variables, and testing the software
functionality, number, date, time and currency format is called locale testing.
It is to used validate the effects of locale change in the product. A locale change affects date, currency format,
the display of items in the screen, dialog boxes and the text.
Black box methodology tests all component features for each locale.
In Microsoft Windows 2000, you can change locale by clicking “Start->Settings->Control Panel->Regional
options (demo).
Locale Testing focuses on testing the conventions for number, punctuations, date and time, and currency format.
Locale Testing - Checklist
All features that are applicable to I18n are tested with different locales of the software for which it is intended.
Some of the activities that need not be considered for I18n testing are auditing, debug code, log of activities
and such features that are used only by English administrators and programmers.
Hot keys, function keys and help screens are tested with different applicable locales (this is to check whether
locale change would affect the keyboard settings).
Date and time format is in line with the defined locale of the language. For example if the US English locale is
selected, the software should display data in mm/dd/yyyy date format.
Currency is in line with the selected locale and language. For example, currency should be AUS$ if the
language is AUS English.
Number format is in line with the selected locale and language. For example, the correct decimal punctuations
are used and the punctuation is put at the right places.
34
35
The Following items in the checklist can be used for Fake Language Testing:-
1. Ensure the software functionality is tested for at least one of the European single byte fake languages (e.g.,
Pig Latin) Ensure the software functionality is tested for at least one double byte language (e.g., Wide
Roman)
2. Ensure all strings are displayed properly in the screen
3. Ensure the screen width, size of pop-ups and dialog boxes are adequate for string display with the fake
languages.
Fake Language testing helps in simulating the functionality of the localized product for a different language
using software translator.
36
Server
Japanese
German
English
I speak only
English but can
deal with anyone
Localization Testing :-
1. Build tools consolidate all messages.
2. Documents and other artifacts are collected.
3. They are sent to language experts for translation.
37
America America
Brasil Brasil
Canada Canada
China Cyberia
Cyberia China
India India
38
39
Constant interaction with developers and other project team members may lead to better understanding of the product
from various perspectives. Since Adhoc tests require better understanding of the product, it is importance to stay
“Connected”.
Due to lack of communication, change in the requirements may not be informed to the test team. When test Engineer
does not know the requirements changes, it is possible to miss few tests. This may result in a few undetected defects. It
is possible to unintentionally miss some perspectives due to changed requirements.
Interaction with developers and other team members may help in getting only a set of perspectives. These type of
interaction may bias the testing team. Hence it is important to constantly question the test cases and also interact with
people outside the organization to find different ways of using the product and use them in adhoc testing.
Adhoc testing can be performed on a product at any time, but the return from adhoc testing are more if they are run
after running planned test cases. Adhoc testing can be planned in one of two ways:-
1. After a Certain number of planned test cases are executed. In this case, the product is likely to be in a better
shape and thus newer perspectives and defects can be uncovered. Since Adhoc testing does not require all the
test cases to be documented immediately, this provides an opportunity to catch multiple missing perspectives
with minimal time delay.
2. Prior to planned testing. This will enable gaining better clarity on requirement and assessing the quality of the
product upfront.
Drawbacks of Adhoc Testing and Their Resolutions:-
Drawback Possible resolution
Difficult to ensure the perspectives covered Document ad hoc tests after test completion
in ad hoc testing are used in future
Large number of defects found in ad hoc Schedule a meeting to discuss defect impacts
testing Improve the test cases for planned testing
Lack of comfort on coverage of ad hoc When producing test reports combine the planned test and
testing ad hoc test
Plan for additional planned test and ad hoc test cycles
40
Buddy Testing :-
Def: A developer and tester working as buddies to help each other on testing and in understanding the specifications
is called Buddy Testing
Two team members (developer and a tester )are identified as buddies. The buddies mutually help each other,
with a common goal of identifying defects early and correcting them
This good working relationship as buddies overcome fear.
Budding people with good working relationships yet having diverse backgrounds is a kind of a safety measure
that improves the chance of detecting errors in the program very early
Buddies should not feel mutually threatened or get a feeling of insecurity during buddy testing. They are trained
on the philosophy and objective of buddy training.
They also have to agree on the modalities and the terms of working before actually starting the testing work.
They stay close together to be able to follow the agreed plan
The Buddy can check for compliance to coding standards , appropriate variable definitions , missing code,
sufficient inline code documentation , error checking.
Buddy testing uses both white box and black box testing approaches.
after testing generates specific review developers.
The more specific the feedback, easier it is for the developer to fix the defects . The buddy may also suggest
ideas to fix the code when pointing out an error in the work product. A buddy test may help avoid errors of
omission, misunderstanding, and miscommunication by providing varied perspectives or interactive exchanges
between the buddies,
Buddy testing not only helps in finding errors in the code but also helps the tester to understand how the code is
written and provides clarity on specifications. Buddy testing is normally done at the unit phase , where there
are both coding and testing activities .
Pair Testing:-
Pair testing is testing done by two testers working simultaneously on the same machine to find defects in the product
.Example:-
41
Pair testing takes advantage of the concept of the presence of one senior member can also help in pairing; this
can cut down on the time spent on the learning curve of the product. It enables better training to be given to the
team members; The impact of the requirements can be fully understood and explained to less experienced
individuals.
Pair testing can be done during any phase of testing. It encourages idea generating right from the requirements
analysis phase, taking it forward to the design, coding and testing phases .
Testers can pair together during the coding phase to generate various ideas to test the code and various
components.
After completion of component testing, during integration, tester can be paired to test the interfaces together.
Pair testing during system testing ensures that product level defects are found and addressed.
When the product is in new domain and not many people have the desired knowledge pair testing will be useful.
Pair testing can track that vague defect that is not caught by a single person testing,
A defect found during such pair testing may be explained better by representation of two members. Pair testing
is extension of the “Pair Programming” concept used as a technique in the extreme programming model.
Pair testing require interaction and exchange of ideas between two individuals. Team members pair with
different persons during project life cycle, the entire project team can have a good understanding of each other ,
Situation when Pair Testing Becomes Ineffective:-
Tests
Business
Business Acceptance
Acceptance
Requirements
Requirements Testing
Testing
Tests Tests
Project
Project System
SystemTesting
Testing
Specification
Specification
Tests Tests
System
System Integration
IntegrationTesting
Testing
Specification
Specification
Tests Tests
Design
Design Component
ComponentTesting
Testing
Specification
Specification
Tests Tests
Code
Code Unit
UnitTesting
Testing
During pairing, teaming up individual high performers may lead to problem may be possible that during the
course of the session , one person takes the lead and other has a laid back attitude . This may not produce the desired
42
Guesses
Past defects
Error handling
Discussions
43
Customer will have a usable product at the end of every iteration .It is possible to stop the product development at any
particular iteration and market the product as an independent entity.
Customer and Management can notice the impact of defects and the product functionality at the end of each iteration.
They can take a call to proceed to the next level or not, base don the observations made in the last iterations. A test plan
is created at the beginning of the first iterations and update for every subsequent iterations. This can be broadly defined
the type and scope of testing to be done for each of the iterations. Developers create unit test cases to ensure that the
44
Agile and Extreme (XP) models take the processes to the extreme to ensure that customer requirements are met
in a timely manner. Customer partner with the project teams to go step by step in bringing the project to completion in
a phased manner. The customer becomes part of the project team so as to clarify any doubts/questions.
Agile and Extreme (XP) methodology emphasizes the involvement of the entire team, and their interactions
with each other, to produce workable software that can satisfy a given set of features. As a result of such interactions,
all ideas are exchanged. Software is delivered as a small release with features being introduced in increments.
A typical XP project day start with a meeting called the Stand Up meeting . At the start of each day, the team
meets to decide on the plans of actions for the day. During this meeting the team brings up any clarifications or
concerns. They are discussed and resolved. The entire team gets a consistent view of what each team members is
working on. Tester present to the project team the progress of the project based on the test results.
45
• Technically, driving a car using a joystick is easier , But customers are comfortable with steering wheels
The basic steps that are carried out :-
46
Cost of Change:-
Defect Seeding:-
Def: Defect seeding is a method of intentionally introducing defects into a product to check the rate of detection and
residual defects.
Error Seeding is also known as Debugging . It acts as a reliability measure for the release of the product. Usually one
group members in the project injects the defects while an other group tests to remove them. The purpose of this
exercise is while finding the known seeded defects, the unseeded/ un earthed defects may also be uncovered . Defects
that are seeded are similar to real defects. Defects that can be seeded may vary from sever or critical defects to cosmetic
errors. Defect Seeding may act as a guide to check the efficiency of the inspection or testing process. It serves as a
confidence measure to know the percentage of defects removal rates. It acts as a measure to estimate the number of
defect yet to be discovered in the system.
Defects that can be seeded may vary from severe or critical defects to cosmetic errors.
• For example : a team seeds 20 defects, and testing finds out 12 seeded defects and 25 other defects
Total latent defects = (defects seeded / defects seeded found ) * Other defects found
• 20 / 12 * 25 = 41.67 = 42
Based on the above calculation , the number of estimated defects yet to be found is 42.
47
48
49
Class rectangle
{
private int length, breadth;
public:
new (float length, .float. breadth)
(
this->length = length;
this->breadth = breadth;
float area ()
{
return (length*breadth1;
return (2*(length+breadth))
}
};
Objects
Objects are the dynamic instantiation of a class. Multiple objects are instantiated using a given (static) class
definition. Such specific instantiations are done using a constructor function.
Constructor
A constructor function brings to life an instance of the class. Each class can have more than one constructor
function. Depending on the parameters passed or the signature of the function, the right constructor is called.
Encapsulation
Encapsulation provides the right level of abstraction about the variables and methods to the outside world.
Polymorphism
This property of two methods-in different classes-having the same name but performing different functions is
called polymorphism.
Inheritance
Inheritance enables the derivation of one class from another without losing sight of the common features. This
ability is called inheritance. The original class is called the parent class (or super-class) and the new class is
called a child class (or derived class, or sub-class). Inheritance allows objects (or at least parts of the object) to
be reused. A derived class inherits the properties of the parent class-in fact, of all the parent classes, as there can
be a hierarchy of classes. Thus, for those properties of the parent class that are inherited and used as is, the
development and
testing costs can be saved.
50
SUBCLASS
SUBCLASS SUBCLASS
SUBCLASS
DIFFERENCES IN OO TESTING
From a testing perspective, the implication is that testing an oo system should tightly integrate data and
algorithms .. The dichotomy between data and algorithm that drove the types of testing m procedure-oriented
languages has to be broken. Testing OO systems broadly covers the following topics.
1. Unit testing a class
2. Putting classes to work together (integration testing of classes)
3. System testing
4. Regression testing
5. Tools for testing OO systems
51
Since OOsystems are ·designed to be made up of a number of smaller components or classes that are meant to
be reused (with necessary redefinitions), testing that classes work together becomes the next step, once the basic
classes themselves are found to be tested thoroughly. In the case of OO systems, because of the emphasis on
reuse and classes, testing this integration unit becomes crucial. in an OO system, the way in which the various
classes communicate with each other is through messages. A message of the format
calls the method of the specified name, in the named instance, or object (of the appropriate class) with the
appropriate variables.
Methods with the same name perform different functions polymorphism. From a testing perspective,
polymorphism is especially challenging because it defies the conventional definition of code coverage and static
inspection of code.
52
Class diagram
A class diagram is useful for testing in several ways.
1.It identifies the elements of a class and hence enables the identification of the boundary value analysis, equivalence
partitioning, and such tests.
2.The associations help in identifying tests for referential integrity constraints across classes.
3.Generalizations help in identifying class hierarchies and thus help in planning incremental class testing as and when
new variables and methods are introduced in child classes.
53
Activity diagram
While a sequence diagram looks at the sequence of messages, an activity diagram depicts the sequence of activities that
take place. It is used for modeling a typical work flow in an application and brings out the elements of interaction
between manual and automated processes. Since an activity diagram represents a sequence of activities, it is very
similar to a flow chart and has parallels to most of the elements of a conventional flow chart.
Given that an activity diagram represents control flow, its relevance for testing comes from
1. The ability to derive various paths through execution. Similar to the flow graph discussed in white box testing, an
activity diagram can be used to arrive at the code complexity and independent paths through a program code.
54
Conclusion
A view expressed by one user of the product may not be the view of another.
easy for one user -->may not be easy for another
fast (interms of say, response time) e slow for another user
beautiful by someone look ugly to another.
APPROACH TO USABILITY
For example , when a Philips ( or a star) screwdriver was invented, it saved only few
milliseconds per operation to adjust the screwdriver to the angle of the screw compared to a flat
screwdriver.
55
Web application interfaces are designed before designing functionality . That gives adequate time for
doing two phases of usability testing.
AESTHETICS TESTING
It ensures the product is pleasing to the eye.
Ex: A pleasant look for menus, pleasing colors, nice icons, and so on can improve aesthetics. It is
generally considered as gold plating, which is not right.
ACCESSIBILITY TESTING
Verifying the product usability for physically challenged users
I) Basic Accessibility
1) Keyboard accessibility
Sticky keys(ctrl, alt, del -->login , Sound keys
logout) Arrow keys to control mouse
Filter keys Narrator (text to audio)
Toggle key sound
57
In the recording section of the lab - A user is requested to come to the lab with a prefixed set of
operations that are to be performed with the product
In the observations section of the lab - it is one way glass – the experts can see the user but the
user cannot see the experts . some usability experts sit and observe the user for body language
and associate the defects with the screens and events that caused it.
Peripherals. Peripherals, shown in Figure are the printers, scanners, mice, keyboards,
59
Interfaces. The components and peripherals plug into your PC through various types of
interface connectors .These interfaces can be internal or external to the PC. Typical names for them are ISA, PCI,
USB, PS/2, RS/232, and Firewire. There are so many different possibilities that hardware manufacturers will often
create the same
peripheral with different interfaces. It’s possible to buy the exact same mouse in three
different configurations!
• Options and memory. Many components and peripherals can be purchased with different hardware options and
memory sizes. Printers can be upgraded to support extra fonts or accept more memory to speed up printing.
Graphics cards with more memory can support additional colors and higher resolutions.
• Device Drivers. All components and peripherals communicate with the operating system and the software
applications through low-level software called device drivers. These drivers are often provided by the hardware
device manufacturer and are installed when you set up the hardware. Although technically they are software, for
testing purposes they are considered part of the hardware configuration.
2. Decide What Hardware Brands, Models, and Device Drivers Are Available
Decide what device drivers you’re going to test with. Your options are usually the drivers
included with the operating system, the drivers included with the device, or the latest drivers available on the
hardware or operating system company’s Web site.
5. Identify Your Software’s Unique Features That Work with the Hardware Configurations
For example, if you’re testing a word processor such as WordPad ), you don’t need to test the file save and load
feature in each configuration. File saving and loading has nothing to do with printing. A good test would be to
create a document that contains different fonts, point sizes, colors, embedded pictures, and so on. You would then
attempt to print this document on each chosen printer configuration
61
Website Testing
• Web Page Fundamentals
• Black-Box Testing
• Gray-Box Testing
• White-Box Testing
• Configuration and Compatibility Testing
• Usability Testing
62
Text
Check the audience level,
the terminology,
the content and subject matter,
the accuracy—especially of information that can become outdated—and
always check spelling.
each page has a correct title
An often overlooked type of text is called ALT text, for ALTernate text. Figure shows an
example of ALT text. When a user puts the mouse cursor over a graphic on the page he gets a pop-up description of
what the graphic represents. Web browsers that don’t display graphics use ALT text. Also, with ALT text blind users
can use graphically rich Web sites—an audible reader interprets the ALT text and reads it out through the computer’s
speakers.
Hyperlinks
Links can be tied to text or graphics. Each link should be checked to make sure that it jumps to the correct destination
and opens in the correct window.
Check
Text links are usually underlined, and the mouse pointer should change to a hand pointer when it’s over any
kind of hyperlink—text or graphic.
Look for orphan pages, which are part of the Web site but can’t be accessed through a hyperlink
do all graphics load and display properly? If a graphic is missing or is incorrectly named, it won’t load and the
Web page will display an error where the graphic was to be placed.
If text and graphics are intermixed on the page, make sure that the text wraps properly around the graphics. Try
resizing the browser’s window to see if strange wrapping occurs around the graphic.
How’s the performance of loading the page? Are there so many graphics on the page, resulting in a large
amount of data to be transferred and displayed, that the Web site’s performance is too slow?
What if it’s displayed over a slow dial-up modem connection on a poor-quality phone line?
If a graphic can’t load onto a Web page, an error box is put in its location
63
Make sure your Web site’s form fields are positioned properly. Notice in this Apple Developer signup form that the
middle initial (M.I.) field is misplaced.
Gray-Box Testing
graybox testing, is a mixture of the black box & white box testing —hence the name. 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 provide themselves nicely to gray-box testing.
Most Web pages are built with HTML (Hypertext Markup Language). Listing shows a few lines of the HTML used to
create the Web page
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1”>
….
HTML and Web pages can be tested as a gray box because HTML isn’t a programming language it’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
2) White-Box Testing
Web page also has customizable and dynamic changing content. Remember, HTML isn’t a programming language—
it’s merely a tagging system for text and graphics. To create these extra dynamic features requires the HTML to be
64
the important bugs that you have some knowledge of the Web site’s system structure and programming:
• Dynamic Content. Dynamic content is graphics and text that changes based on certain
conditions—for example, the time of day, the user’s preferences, or specific user actions.
Supported by
Client side scripting :It’s possible that the programming for the content is done in a simple scripting language
such as JavaScript and is embedded within the HTML. apply gray-box testing techniques when you examine the
script and view the HTML.
server-side scripting : For efficiency, most dynamic content programming is located on the Web site’s server;
and would require to have access to the Web server to view the code.
• Database-Driven Web Pages. Many e-commerce Web pages that show catalogs or
inventories are database driven. The HTML provides a simple layout for the Web content
and then pictures, text descriptions, pricing information, and so on are pulled from a
database on the Web site’s server and plugged into the pages.
• Programmatically Created Web Pages. Many Web pages, especially ones with
dynamic content, are programmatically generated—that is, the HTML and possibly even
the programming is created by software. A Web page designer may type entries in a database and drag and drop
elements in a layout program, press a button, and out comes the HTML that displays a Web page. If you’re testing such
a system, you have to check that the HTML it creates is what the designer expects.
• Server Performance and Loading. Popular Web sites might receive millions of individual
hits a day. Each one requires a download of data from the Web site’s server to the
browser’s computer. If you wanted to test a system for performance and loading, you’d
have to find a way to simulate the millions of connections and downloads.
• Security. Web site security issues are always in the news as hackers try new and different ways to gain access to a
Web site’s internal data. Financial, medical, and other Web sites that contain personal data are especially at risk and
require intimate knowledge of server technology to test them for proper security.
65
4) Usability Testing
The following list is adapted from his Top Ten Mistakes in Web Design:
• Gratuitous Use of Bleeding-Edge Technology. Your Web site shouldn’t try to attract
users by bragging about its use of the latest Web technology. When desktop publishing was young, people put 20
different fonts in their documents; try to avoid similar design bloat on the Web.
• Scrolling Text, Marquees, and Constantly Running Animations. Never allow page
elements that move incessantly. Moving images have an overpowering effect on human
peripheral vision.
• Long Scrolling Pages. Users typically don’t like to scroll beyond the information visible
onscreen when a page comes up. All critical content and navigation options should be on
the top part of the page. Recent studies have shown that users are becoming more willing
66
67