White box testing: Need, Skill required and Limitations

What is White Box Testing?
White box testing (WBT) is also called Structural or Glass box testing.

White box testing involves looking at the structure of the code. When you know the internal structure of a product, tests can be conducted to ensure that the internal operations performed according to the specification. And all internal components have been adequately exercised.

White Box Testing is coverage of the specification in the code.

Code coverage:

Segment coverage:
Ensure that each code statement is executed once.

Branch Coverage or Node Testing:
Coverage of each code branch in from all possible was.

Compound Condition Coverage:
For multiple condition test each condition with multiple paths and combination of different path to reach that condition.

Basis Path Testing:
Each independent path in the code is taken for testing.

Data Flow Testing (DFT):
In this approach you track the specific variables through each possible calculation, thus defining the set of intermediate paths through the code.DFT tends to reflect dependencies but it is mainly through sequences of data manipulation. In short each data variable is tracked and its use is verified.
This approach tends to uncover bugs like variables used but not initialize, or declared but not used, and so on.

Path Testing:
Path testing is where all possible paths through the code are defined and covered. Its a time consuming task.

Loop Testing:
These strategies relate to testing single loops, concatenated loops, and nested loops. Independent and dependent code loops and values are tested by this approach.

Why we do White Box Testing?
To ensure:

  • That all independent paths within a module have been exercised at least once.
  • All logical decisions verified on their true and false values.
  • All loops executed at their boundaries and within their operational bounds internal data structures validity.

Need of White Box Testing?
To discover the following types of bugs:

------------

  • Logical error tend to creep into our work when we design and implement functions, conditions or controls that are out of the program
  • The design errors due to difference between logical flow of the program and the actual implementation
  • Typographical errors and syntax checking

Skills Required:
We need to write test cases that ensure the complete coverage of the program logic.
For this we need to know the program well i.e. We should know the specification and the code to be tested. Knowledge of programming languages and logic.

Limitations of WBT:
Not possible for testing each and every path of the loops in program. This means exhaustive testing is impossible for large systems.
This does not mean that WBT is not effective. By selecting important logical paths and data structure for testing is practically possible and effective.
Reference- http://www.softrel.org/stgb.html

Comment out your queries on white box testing below. Meantime I will cover Black box testing in detail.



Get FREE eBook + Blog Updates By Email!

Subscribe to get software testing awesome articles and free resources. Enter your email address and click 'SIGN UP NOW' button.


55 comments ↓

#1 Nikhil on 08.08.07 at 4:21 pm

At what depth should we know programming languages? Is WBT done by dev’s?

#2 What is black box testing? Black box testing types and techniques on 08.09.07 at 6:17 pm

[...] ← White box testing: Need, Skill required and Limitations [...]

#3 shweta on 09.21.07 at 6:09 am

automation tools used for white box testing?????

#4 Selvi on 09.22.07 at 1:51 pm

some of the tools available in white box testing???

#5 Vijay on 09.28.07 at 8:04 am

@ Nikhil- If you have basic idea of programming language then also you can do WBT. Just you need to learn on the fly each time on your project and need to get clear idea of the application working flow.
It would be simple for you if you use any source code analysis tool if you have basic knowledge of the language in which your application is written.
Source code understanding is most important for every white box test case as you modify the code to execute the test cases.
White box testing can also be efficient just by seeing the source code of the application. When you know some weak points where you can think this code can break simply apply those cases manually as black box testing. This concept is referred as gray box testing.

@ Shweta and Selvi: You can see a comprehensive list of testing tools listed on this page:
http://www.aptest.com/resources.html

#6 vikas on 10.08.07 at 9:26 am

The source code generally written by developers,but if a tester performs this WBT then :
(i)How much in depth knowledge a tester should have abt a progg languge?
(ii)If a another developer perform WBT for that module,will that be a better option?

What should be done exactly??

#7 Jitu on 12.04.07 at 12:50 pm

Hi friends,
There are tools like nUnit,JUnit for white box testing.

White box testing is done mainly by Developers , But If tester haves the required programing language knowledge then he can also perform white box testing.Tester should know the basics, like how to call function, pass parameters to function , store the values in database or text files… etc..

#8 jenny on 02.29.08 at 7:08 am

As a manual tester in a product based company is it necessary to do white box testing??

#9 jitu on 02.29.08 at 9:43 am

not necessary that we should have white box knowledge to work in product based company… It depends on your role and type of testing…

#10 swetha on 02.29.08 at 10:31 am

Could u please explain how to test a smart card application manually? what are the different types of testing we should keep in mind before starting…

#11 swetha on 03.01.08 at 4:54 am

im a fresher in testing field. nw I’m testing a smart card application. i want to know what all procedures( in WBT & BBT) I hav to do for a successful test.

#12 anil on 03.03.08 at 9:20 am

can you tell me the types of errors

#13 swetha on 03.18.08 at 6:32 am

How to write test cases in White Box Testing??..

#14 Gaurav on 06.12.08 at 1:47 pm

Swetha…firstly devide the testing into positive and negative testing.

Determine the unit which is to be tested, then decide the positive test case input values, which includes the border inputs as well. Then set the expected results. And finally test them against the actual results.

Same TBD with negative test cases.

#15 Kranthi on 08.23.08 at 4:30 pm

Diffrence between White-box Testing & Block-box Testing

#16 Kranthi on 08.23.08 at 4:32 pm

Iam a fresher in testing field. nw I’m testing a web based application. i want to know what all procedures( in WBT & BBT) I hav to do for a successful test.

#17 Poornima on 08.31.08 at 10:28 am

Kindly can someone list out the tools used for White Box Testing?

#18 Poornima on 09.08.08 at 4:25 am

Hi,

Kindly can someone tell me the differences between Nunit and Junit plz?

It would be of great help as I am doing my assignments..

Thanks,
Poornima

#19 Ashish on 12.17.08 at 5:58 am

What are manual WBT types??? Do we have to write SQL queries for WBT???? Plz give any live case eg.

Thanks
Ashish

#20 Ash on 01.11.09 at 2:18 pm

Can any1 answer dis question wid reason???

Considering the following pseudo-code, calculate the MINIMUM number of test cases for statement coverage, and the MINIMUM number of test cases for decision coverage respectively.

READ A
READ B
READ C
IF C>A THEN
IF C>B THEN
PRINT “C must be smaller than at least one number”
ELSE
PRINT “Proceed to next stage”
ENDIF
ELSE
PRINT “B can be smaller than C”
ENDIF

A 3, 3.
B 2, 3.
C 2, 4.
D 3, 2.

#21 shivanand on 03.18.09 at 6:09 am

as there are 3 read statments(Read a,Read b,Read c) so we need 3 statment coverage
consider C=3 B=2 and A=1,so if both IF condition satisfies than “PRINT “C must be smaller than at least one number” and “PRINT “B can be smaller than C”
will be executed , and next if both IF condition fails than
“PRINT “Proceed to next stage”
ENDIF
ELSE
PRINT “B can be smaller than C”
will be executed .so we need min 2 branch coverage.

so answer is D..
let me know if m wrong….

#22 chaitanya on 03.20.09 at 6:30 am

i think shiv you are wrong in explaining statement coverage. it means all executable codes should be executed atleast once.

#23 rajesh on 09.04.09 at 1:00 pm

please any one send material for software testing (manual)
and interview questions

#24 hi,i need notes on c programming on 10.26.09 at 11:51 am

your notes have given me hopes in my studies.

#25 siri on 12.08.09 at 2:07 pm

I am a fresher in testing field,please any one send material for software testing (manual)
and how to prepare the interview questions

#26 Jagdish on 12.08.09 at 2:43 pm

Siri..

Pls drop ur mail ID. I will send you the documents

#27 Bharath on 12.15.09 at 6:10 am

Hi Shiv,

Following is a decision table to achieve decision coverage:

Causes Values Combinations

C>A T,F T T F F
C>B T,F F T T F
—————
Effects/Results: 2 3 1 1

Where:

1. B can be smaller than C
2. Proceed to next stage
3. C must be smaller than at least one number

Now we can see that 3rd and 4th combinations are indifferent because, if the first condition fails, the result will be “B can be smaller than C” irrespective of the second condition. So we can reduce a combination and the table is as follows.

Causes Values Combinations

C>A T,F T T F
C>B T,F F T -
———–
Effects/Results: 2 3 1

So, we need 3 test cases for decision coverage. Please let me know if I am wrong.

I am not sure how to write test cases for statement coverage. Should we write a test case for each line in the code? If so, what about projects where there are 10000 and more lines of code? Some one please elaborate!

#28 Srinivas.D on 05.24.10 at 5:41 am

WBT is performed on develoer side i.e. if there is any errors during developing the code then they will conduct WBT.

Generally, WBT is done by developers. so, I think we don’t worry about WBT.
InCase If we have to do the WBT then just we have require basic knowledge on that particular domail/language.

#29 pinku on 06.07.10 at 1:28 pm

white box testing is not better in large application. i prefer black box testing better.

#30 Jitu on 06.08.10 at 4:59 am

@pinku – Type of testing is not decided by large or small application… It is decided at the level of testing..Levels like (unit testing ,Integration Test, System test,UAT Test)…White box is used mainly in Unit testing

#31 Bhoodev on 07.06.10 at 9:13 am

plz any one send me testing(manual) material ….and atomatiomation testing tools…

Email id-phoenix.bhoodev@gmail.com
thank’s advance

#32 pranita on 09.08.10 at 10:10 am

for large pgm which test as considerd??????? white or black ????????? i think black ? yes

#33 Hari on 10.18.10 at 10:23 am

Hi..Can anyone send me the manual testing material as I doing the course.

Hari

#34 hari on 02.01.11 at 2:47 am

this is nice..understandable clear

#35 Divya on 02.18.11 at 6:51 am

I am doing black box testing. How to correlate with white box testing as I am ineterested. Information on automation tools. Could any one send brief description on statement, branch and decision coverage.

#36 hi on 04.25.11 at 9:19 am

test

#37 keerthi mai on 05.13.11 at 2:28 pm

please can any one send me manual material

#38 madu on 07.28.11 at 9:10 am

if we start project can u tell me first process in that project. Means test plan or test cases plz give me clarity.

#39 Manikandan on 11.11.11 at 8:55 am

First Testing Process starts with Requirement Analysis then Test Plan
Test Scenario
Test Case
Test Execution
Defect Logging
Regression Testing

#40 1 on 12.12.11 at 1:00 pm

t

#41 Geetha on 02.16.12 at 7:10 am

Very Useful

#42 p shilpa on 06.29.12 at 7:28 am

what is black box testing how it perform plz send me any one my mail is pshilpa235@gmail.com

#43 p shilpa on 06.29.12 at 7:31 am

what is black box testing why it is used in testing plz any one send me my mail pshilpa235@gmail.com

#44 Neeraja on 11.18.12 at 5:17 pm

please can any one send me testing(manual) material ….and automation testing tools.

Thank You

#45 rashid on 11.21.12 at 8:12 am

please send me testing manual and material automation testing tools and white box and black box testing how i can test so i need practical

#46 Megha on 11.28.12 at 12:21 pm

All the below questions were asked in interview,please reply back

1.When there would be need of a white box tester?

2.What all testcases can be written for “Amount” with a blank text box ,where you can enter the values

3.Place the order in descending i.e from first to be executed to the last with valid reasoning:
1.Regression
2.Integration
3.Retesting
4.Smoke
5.Sanity

Regards,
Megha

#47 Megha on 11.28.12 at 12:24 pm

Please reply back for the answers on mchaware@gmail.com

#48 satyanarayna on 12.19.12 at 12:50 pm

hi i am working as the manual test engineer.i write all the testcases for the web applications.i familiar with automation also.

#49 KADAR on 06.14.13 at 11:54 am

hi, i want s/w testing material ( manual testing & automated testing) and interview questions . pl help me
kadarshereef@gmail.com

#50 saurabh on 11.18.13 at 6:10 am

i am a software developer in .NET technology from almost last 4 years, i am very much interested to go in WBT.
Can i go with this scenario, and if the please tell me to the way out, what should i need to learn or know?

Thanks in Advance:
Saurabh kr.

#51 kundan kumar on 02.02.14 at 11:38 am

White box testing is one of the most important testing phase in software engineering field.
This test is mainly done by developer teams,it is also known as clear box testing.This testing requres full knowledge of internal structure of a programm………

#52 kashyap on 02.18.14 at 3:02 am

can anyone tell what are the tools used for White Box Testing ?

#53 Annam on 02.23.14 at 1:22 pm

Hi, can anyone help me with testing meterials.
email id : prathima490@gmail.com

#54 Deepak on 03.04.14 at 5:51 am

Hi, i’m working in JAVA Technology and manual testing i know to write test cases and traceability matrix but i don’t know automation tools and also White box testing & Black box testing..can any one tell me to go with Testing..

#55 Priti on 03.05.14 at 6:24 pm

Hey,

Can I get some Test case samples?

Thanks,
Priti