what is unit testing? It comes under white box or Black Box
testing?

Answer Posted / sylesh

I think it depends on how you define the so called 'unit'.
Consider a situation where you wrote an application with
just one functionality, which is implemented in precisely
one function. Assume this function contains 3 logical
blocks of code, say an if..else, a for loop and then
another block of statements.

If we are to say that a white box testing has been done on
that code, we should have tested each of these different
blocks of statements, ensure coverage by carrying out
various and as many tests required by inputting as many
varied parameters to ensure that the execution of code has
been tested through each of the lines / blocks of code.

Same time, the programmer would have tested the function
just by passing the input parameters as specified / assumed
from the functionality of the application and would have
verified whether the output has come right.

So if we consider the unit under consideration to be a
function then I think the so called unit test in that case
should be considered more close to black box where as if
the programmer has catered for complete coverage
considering each and every line of code, it should be
considered white box.

Obviously white box testing is more fail safe but sometimes
programmers end up writing unit test cases just for public
functions in which case I prefer to say it is close to
black box.

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain decision tables?

666


What are the main key components in web applications and client and server applications? And explain the differences between them?

672


Write the function test case to add a customer to database.

1707


Have you ever completely tested any part of a product? How?

2025


I have an Interview about Guidewire claimcenter,so could you provide any info regd it?.I would really appreciate any kind of help- email at hvshah2001@gmail.com

1968






Do you know anything about Set Top Boxes?

7734


1. what exactly is heuristic checklist approach for unit testing ?

2212


What is meant my Firewall testing? how the testing is performed on it?

1781


how to connect oracle with test director? in testdirector we will be getting only reports? pls answer Thanks in Advance

1414


What is early testing?

667


What is bucket testing?

656


What is back to back testing?

1481


You may be overqualified for this position we have to offer

1733


Hi Friends, This is Chennamsubbaraidu.i Have 2+ Years Realtime Exp in Manual Testing.Am Looking to Shift From My Present Company.Please if u Have Any Openings in Your Company's, Please Let Me Know.Any Location Prefer.Thanks.

1422


What is Batch testing? Facets Benefit Configuration

2149