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
What is the difference between a bug, a defect and an error?
How to test an application if it was already developed and it is in the state of changing the functionality according to the customer requirement How to start testing in this situation. I got an application to test.It is a desktop application.It is still developing and started 8 months back.how can i start to test this application? Is it the right way to test it in "Random testing"? or writing the testcases from page one and executing them.i have an another responsibility that is I have to automate that application. can anyone tell me what is the process to test this application.
Why testers wil prepare useracceptance testcases,system testcases and integration testcases,What is the differenece between all this test cases
i have source and target having same data structure 500 fields and one lacks records. how to validate data. write 5 scenarios.
What is the negative testing and example
What is Difference between Test Strategy and Test Methodology?
Which testing model is best as per your understanding, and why?
HOW TO CREATE SRS REVIEW REPORT TO PL?
What is Wound Fixing?
What is the test case?
How can data caching have a negative effect on load testing results?
How to test the Online Games?? Suggest tricks. I have experience in server-client application testing.
how can we do database testing. In database testing we verify the data integrity and data validation. how can we do testing of Index, triggers, views, ransactions,cursors etc
How do u go about testing of web application?
How will you determine when to stop testing?