In this tutorial we will start with Software Testing Methods and different types of Software Testing Methods so let’s begin with topic.
There are three types of software testing methods:
White Box Testing
Black Box Testing
Grey Box Testing
1.White Box Testing:
- Testing each and every line of code is nothing but software testing.
- It is also known as Clear Box Testing, Glass Box Testing, Structural Testing, Transparent Box Testing, Code-Based Testing or Open Box Testing, .
- It has access to source code and tester knows the implementation of the item .
- Developer performs white box testing.
Steps to perform White box testing:
- Understanding the functionality:Understanding different functions of application through its source code.Tester(developer) must be well versed with the programming language.
- Writing Test cases and execute it: Writing down test cases by understanding functionality .All test cases should cover branch ,path,loop of the code.Finally perform execution of test cases.
White Box Testing techniques:
- Statement coverage
- Branch coverage
- Path coverage
1. Statement coverage:
It involves testing each and every lines of code.Here it validates each and every line of code at least once.
Statement coverage is also called as unit testing.Here unit implies line of code.
2 Branch Coverage
“Branch” in a programming language is like the “IF statements”. If a statement has two branches: true and false.
So in Branch coverage (also called Decision coverage), we validate that each branch is executed at least once.
In case of an “IF statement”, there will be two test conditions:
- First to validate the true branch and
- second to validate the false branch
Hence, in theory, Branch Coverage is a testing method which when executed ensures that each branch from each decision point is executed.
In path coverage we test each and every possible path of the application/software.
This is a comprehensive technique which ensures that all the paths of the program are traversed at least once.
Path Coverage is even more powerful that of Branch coverage. This technique is useful for testing the complex programs.
Input X & Y
IF Z > 100
Here in above pseudo code it only evaluates true condition and not false condition.So for maximum coverage we need to consider Branch coverage
Input X & Y
IF Z > 100
here in above code it evaluates true as well as false conditions.
- Branch Coverage ensures more coverage than Statement coverage.
- Branch coverage is more powerful than Statement coverage,
- 100% Branch coverage itself means 100% statement coverage,
- 100 % statement coverage does not guarantee 100% branch coverage.
Input X & Y
IF Z > 100
IF X > 50
here we require 4 different inputs we can call it as test cases to cover all possible paths :
i) X = 50 ,Y= 60
ii)X = 55 ,Y= 40
iii)X = 40 ,Y= 65
iv)X = 30 ,Y= 30
In white box testing other kinds of testings are included:
Memory point of view testing :
- In memory point of you testing developer need to concentrate on size of an application while developing an application .
- Developer need to follow set of rules: Generic methods, inbuilt functions, proper logic.
Common mistakes done by developer
i) Repetition of code: To overcome this drawback developer should use generic methods common methods which can be accessed through out the application is called generic methods.
ii) Improper logic because of not using inbuilt function
iii) Because of an used variables and methods .
- Developer need to delete unused variables and an used methods from the programs but manual it’s not possible so developer will use a tool called rational purifier.
- In a program rational purifier first text one variable checks whether it is available if it is present it takes next variable otherwise it will repeat as output.
Performance point of view testing:
Testing speed and response time of an application is called as performance testing.
In performance testing we will check how much load application is able to handle for performance testing is done in manual and automation.
We can’t apply load on any feature or an application manually therefore we will go for automation
Some performance testing tools are: Loadrunner – HP commercial, Jmetre, Silk test
In performance point of view testing developer will check how much time which program is taken to execute the program.
Performance testing is not possible manually so developers uses a tool called rational quantifier.
Thin line indicates less time for thick line represent more time.
Advantages of White box testing:
- Useful in code optimization.
- Due to White box testing defects can be identified at early the early stage of software development thereby can save the cost of fixing the bug.
- The thorough nature of white-box testing also gives a clear structure to testing.
- As the tester is aware of internal coding structure, then it is helpful to derive which type of input data is needed to testing software application effectively.
- White box test cases can be automated.
- Testing can start early in SDLC even if GUI is not available.
Disadvantages of white box testing:
- Tests can be very complex, highly skilled resources are required, with thorough knowledge of programming and implementation.
- Coding knowledge is required.
- Script maintenance can prove hectic if implementation changes frequently.
2.Black box Testing:
Testing each and every feature functionality according to requirement is called as Black box testing.
It is also called closed box testing, behavioral testing.
Test engineer not able to see programs of an application so it is called closed box testing.
As a test engineer we are going to test behavior of each features so it is called behavior testing.
Tester does not have knowledge of underlying codes,he only care about requirement and expected result .
After providing input actual result is compared with expected result.Besides how software is working it is non of concern for the tester.
Black box testing only observes functionality of the application hence it is also called functionality(functional)testing.
Advantages of Black box testing:
- Does not require coding knowledge.
- Tests are done from end user’s point of view.
- Test cases can be designed as soon as the functional specifications are ready. Testers do not have to wait for the development to be completed.
Disadvantages of Black box testing:
- Unidentified path can be discovered during testing.
- Difficult to identify all possible inputs in limited time.
- Chances of having repetition of tests.
3. Grey box testing:
Grey box testing is the combination of white box and black box testing.
Mainly used for penetration tests.
It is non-intrusive and unbiased.
With respect to internal processes, gray box testing treats a program as a black box that must be analyzed from the outside.
During a gray box test, the person may know how the system components interact but not have detailed knowledge about internal program functions and operation.
A clear distinction exists between the developer and the tester, thereby minimizing the risk of personnel conflicts.
Software Testing Methods