Sei sulla pagina 1di 3

Black box testing:

Black Box Testing is testing without knowledge of the internal workings of the item being tested. For
example, when black box testing is applied to software engineering, the tester would only know the
"legal" inputs and what the expected outputs should be, but not how the program actually arrives at
those outputs. It is because of this that black box testing can be considered testing with respect to the
specifications, no other knowledge of the program is necessary. For this reason, the tester and the
programmer can be independent of one another, avoiding programmer bias toward his own work. For
this testing, test groups are often used, "Test groups are sometimes called professional idiots...people
who are good at designing incorrect data." 1 Also, do to the nature of black box testing, the test
planning can begin as soon as the specifications are written. The opposite of this would be glass box
testing, where test data are derived from direct examination of the code to be tested. For glass box
testing, the test cases cannot be determined until the code has actually been written. Both of these
testing techniques have advantages and disadvantages, but when combined, they help to ensure
thorough testing of the product.

Advantages of Black Box Testing


1. More effective on larger units of code than glass box testing
2. Tester needs no knowledge of implementation, including specific programming languages
3. Tester and programmer are independent of each other
4. Tests are done from a user's point of view
5. Will help to expose any ambiguities or inconsistencies in the specifications
6. Test cases can be designed as soon as the specifications are complete.

Disadvantages of Black Box Testing


only a small number of possible inputs can actually be tested, to test every possible input stream would
take nearly forever
without clear and concise specifications, test cases are hard to design
there may be unnecessary repetition of test inputs if the tester is not informed of test cases the
programmer has already tried
may leave many program paths untested
cannot be directed toward specific segments of code which may be very complex (and therefore more
error prone)
most testing related research has been directed toward glass box testing.

White box testing


White box testing strategy deals with the internal logic and structure of the code. White box testing is
also called as glass, structural, open box or clear box testing. The tests written based on the white box
testing strategy incorporate coverage of the code written, branches, paths, statements and internal logic
of the code etc. In order to implement white box testing, the tester has to deal with the code and hence
is needed to possess knowledge of coding and logic i.e. internal working of the code. White box test also
needs the tester to look into the code and find out which unit/statement/chunk of the code is
malfunctioning.

Advantages of White box testing are:


i) As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which
type of input/data can help in testing the application effectively.
ii) The other advantage of white box testing is that it helps in optimizing the code
iii) It helps in removing the extra lines of code, which can bring in hidden defects

Disadvantages of white box testing are:


i) As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out
this type of testing, which increases the cost.
ii) And it is nearly impossible to look into every bit of code to find out hidden errors, which may create
problems, resulting in failure of the application.

Types of testing under White/Glass Box Testing Strategy:

Unit Testing: The developer carries out unit testing in order to check if the particular module or unit of
code is working fine. The Unit Testing comes at the very basic level as it is carried out as and when the
unit of the code is developed or a particular functionality is built.
Static and dynamic Analysis: Static analysis involves going through the code in order to find out any
possible defect in the code. Dynamic analysis involves executing the code and analyzing the output.

Statement Coverage: In this type of testing the code is executed in such a manner that every statement
of the application is executed at least once. It helps in assuring that all the statements execute without
any side effect.

Branch Coverage: No software application can be written in a continuous mode of coding, at some point
we need to branch out the code in order to perform a particular functionality. Branch coverage testing
helps in validating of all the branches in the code and making sure that no branching leads to abnormal
behavior of the application.

Security Testing: Security Testing is carried out in order to find out how well the system can protect
itself from unauthorized access, hacking – cracking, any code damage etc. which deals with the code of
application. This type of testing needs sophisticated testing techniques.

Mutation Testing: A kind of testing in which, the application is tested for the code that was modified
after fixing a particular bug/defect. It also helps in finding out which code and which strategy of coding
can help in developing the functionality effectively.
Besides all the testing types given above, there are some more types which fall under both Black box
and White box testing strategies such as: Functional testing (which deals with the code in order to check
its functional performance), Incremental integration testing (which deals with the testing of newly
added code in the application), Performance and Load testing (which helps in finding out how the
particular code manages resources and give performance etc.) etc.

Top-Down Testing
Top-down software testing is an incremental unit testing method which beginsby testing the top level
module, and progressively adds in lower levelmodules, one at a time.The idea is simple. Begin with the
highest-level module, using stubs tostand in for any module it invokes. For the next test, add in any
modulewhich satisfies the following rule:THE GOLDEN RULE OF TOP-DOWN SOFTWARE TESTINGIn order
to test a unit, you must first have tested at least one modulewhich calls it. (Exception: the top-level unit,
which is not called by anymodule.)

Advantages of top down testing:


1. There is less overhead than with the big bang method: Nodrivers need to be written when top-down
testing is used.
2. Top-down testing provides an early working model of theprogram. This model can be presented to
the user for an early test ofthe system. Design flaws can thus be detected early and corrected.
Disadvantages of top-down testing:
1. It is hard to farm out top-down software testing to independent testingteams. Why? Each module can
only be tested after a module that invokes it has been tested.

Bottom-up testing:
Bottom-up testing starts with the details of the system and proceeds to a higher levels by a progressive
aggregation of details until they collectively fit the requirements of the system.this approach is more
approprite for testing the individual objects in the system. in Bottom-Up testing yoou start with the
methods and classes that call or rely on no others.you test them thoroughly.then you progree to the
next level up:those methods and classes that use only the bottom level ones already tested.next you
test combinations of the bottom two layers.proceed until you are testing the entire program.this
strategy makes sense because the behavior of the code is shecked before it is used by another.
Advantages of using a bottom-up approach
to software testing is the fact that there is no need for stubsor drivers and errors in critical modules are
found earlier.

Disadvantages of bottom-up approach


1.Test drivers are needed.
2.Interface errors are discovered late.

Potrebbero piacerti anche