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

What a team leader will test first when s/he will get new module to test?

1556


How do your characteristics compare to the profile of the ideal manager that you just described?

2703


What is the difference between three tier and two tier application?

676


What are the different levels of manual testing?

678


Explain Operational Acceptance Testing with example ?

900






How can data caching have a negative effect on load testing results?

2381


Can you explain the various elements of function points ftr, ilf, eif, ei, eo, eq, and gsc?

782


What is boundary value testing? Give an example.

720


sanity testing is done during regression testing.is it true.if it is true plz explain?

1470


I HAVE AN INTERVIEW IN A SOFTWARE COMPANY FOR THE POST OF FUNCTIONAL TEST ENGINEER. THEY WANT THE PERSON FROM BCOM BACK GROUND( I AM A BCOME GRADUATE 2006) AND THE PERSON SHOULD HAVE GOOD ACCOUNTS KNOWLEDGE. NOW I WANT TO KNOW WHAT KINDS OF QUESTIONS THEY CAN ASK OR CAN GIVE IN WRITTEN TEST. I M NERVOUS COZ ITS BEEN 5 YEARS I HAVE DONE BCOM. SO HOW SHUD I PREPARE FOR INTERVIEW.PLEASE HELP? reply me pls. its urgent. thanks

1563


write 5 critical test cases on product payment form on flipkart.com?

1514


What is defect cascading in software testing?

731


What is mutation testing & when can it be done?

694


How to do the performance testing manually? Does you have a test case for that?

695


What is the difference between baseline and traceability matrix?

738