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.




Related Posts:

  • Practical approaches to improving your testing by maximizing code coverage [White paper for download]
  • Some interesting Software testing interview questions
  • Black Box Testing: Types and techniques of BBT
  • Web testers required at Connoisseur
  • Urgent opening with Microsoft Hyderabad
  • 23 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 What is white box testing - CrazyEngineers Forum on 03.16.08 at 5:20 pm

    […] typically used in unit and integration testing. Do read a good post on White box testing here - What is white box testing? Need and limitations of White box or glass box testing __________________ -The Big K- Founder & Administrator ? The Big K?s Superblog? ? About CE ? […]

    #14 swetha on 03.18.08 at 6:32 am

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

    #15 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.

    #16 Kranthi on 08.23.08 at 4:30 pm

    Diffrence between White-box Testing & Block-box Testing

    #17 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.

    #18 Poornima on 08.31.08 at 10:28 am

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

    #19 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

    #20 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

    #21 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.

    #22 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….

    #23 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.

    Leave a Comment