hey,
i have been working on my final year project, the program is finished and now i have do the testing.
i have finished black box testing but i have no clue how to do white box testing. i have looked around the web but there is only definition of whitebox testing, i want examples of it cos i have no idea how to perform whitebox testing
any suggestions will be appreciated

kind regards

thanks for the link above,
i still dont fully get what it does (sorry)...
in the test above why did both tests failed? and what is the point of this testing?
sorry i am really not familiar with the concept of white box testing.
i know these questions might be very silly


thanks for the help

Make it long story short JUnit is testing framework used for "obviously" testing. In ideal circumstances you would first decide what feature you wish to implement, write basic failing test and then write what ever code you need to get this working. Test doesn't have to test whole feature, you may use incremental process.
So what you do is provided input data you need to work with.

As per linked example author takes two values, calls method for calculation and asserts result from method with what ever he expected. If the test fails that mean something is not correct

if you only start whitebox testing after your blackbox testing is complete, you've started way too late, as it should have been (largely) the other way around.

Black box testing tests the system as a whole, based on its external specification, without any particular reference to how it is built internally - it treats the system as a "black box" with unknown contents

White-box testing (better known as clear box or glass box testing) is based on a knowledge of how the system is implemented, so unlike black-box testing it can look at internal states and intermediate results, and can target specific use cases or data combinations that look challenging for the actual implementation.

eg:
BB tests for a personnel system will enter employee data and request reports and check that the reports are correct.
GlassBox testing will also look at database dumps to see if the tables have been populated correctly, and will have specific test data that hits and passes the known database limits on field sizes etc.

In theory BB is all you need - if the correct inputs lead to the correct outputs, and incorrect inputs are handled appropriately then the system is good.
However, no tests can cover every possible sequence of correct and incorrect inputs, so glass box testing is useful to target additional effort into places where problems are more likely to be found.

thanks a lot everyone for the advice.
i think is too late for me to do full system white box testing. and if i am correct i understand that while i was developing the system i was white box testing all the time, in order to make it work. am i right ?

thanks again

thanks to everybody for all the advice.
while we are on the testing subject could somebody also explain how stress testing is performed and how to stress test the system

thank you very much

This article has been dead for over six months. Start a new discussion instead.