You are on page 1of 16

A

MICROPROJECT REPORT ON

“ White Box Testing”


SUBMITTED BY

NAME ER. NO. EXAM SEATNO.

• Kamble Gitanjali Subhash 2115600279 405139

• Shaikh Insha Sultanahemad 2115600280 405140

• Khande Vaishnavi Abasaheb 2015600205 405135


GUIDE

PROF. S.S.Tawade

DEPARTMENT OF COMPUTER ENGINEERING


Ashok Garmin Shikshan Sanstha’s

Ashok Institute of Engineering & Technology Polytechnic Ashoknagar

Tal. Shrirampur, Dist. Ahmedanagar, Pin- 413717

2022-2023
1

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI

CERTIFICATE
This is to certify that the Micro Project work entitled

“Black Box Testing”


As partial fulfilment of Diploma course in Computer Engineering under the Maharashtra
State of Technical Education, Mumbai during academic year 2021-2022.The said work
has been assessed by us and we are satisfied that the same is up to the standard
envisaged for the level of the course, and that the said work may be presented to the
examiner.

SUBMITTED BY

NAME ER. NO. EXAM SEAT NO.


• Kamble Gitanjali Subhash 2115600279 405139

• Shaikh Insha Sultanahemad 2115600280 405140

• Khande Vaishnavi Abasaheb 2015600205 405135

On / / 2022

PROF.S.S.Tawade Prof. Ghogre V.D. Prof.ShindeA.P


2
GUIDE HOD PRINCIPAL
Institute Code: - 1560
DEPARTMENT OF COMPUTER ENGINEERING
Ashok Institute of Engineering & Technology Polytechnic Ashoknagar
Tal. Shrirampur, Dist. Ahmedanagar2021-2022

ACKNOWLEDGEMENT
It has been a privilege for me to be associated with my guide PROF. Tawade S. S.
during this Micro Project work. I have been greatly benefited by their valuable
suggestions and ideas. It is with great pleasure that I express my deep sense of gratitude
to her for their guidance, constant encouragement, for their kindness, moral support and
patience throughout this work.

Prof. Ghogre V.D Head of Department of Computer Engineering, has been indeed
a great source of inspiration for all of us in the campus, so it gives me an immense
pleasure in expressing my indebtedness to his for him kindness and moral support.

At outset, I take opportunity to express my sincere gratitude to Prof. Shinde A.P.,


Principal for giving me an opportunity to pursue my studies for the present work.

I am heartily thankful to all staff of our department from Ashok Polytechnic,


Ashoknagar for giving me valuable support.

Finally, I would like to express my deep, incomparable appreciation and gratitude to


my family members for their constant spiritual support and encouragement to pursue the
higher technical education.

Date: - / / 2022

Place: - Ashoknagar

Submitted By:
Kamble Gitanjali Subhash 2115600279

Shaikh Insha Sultanahemad 2115600280

Khande Vaishnavi Abasaheb 2015600205

3
ABSTRACT
Software testing, the most commonly used technique for validating the quality of
software, is a labor intensive process, and typically accounts for about half the total
cost of software development and maintenance. Automating testing not only reduces
the cost of producing software but also increases the reliability of modern software.
White-box testing and black-box testing are two commonly used techniques that have
complementary strengths. White-box testing uses the internal structures (such as
control flow or data flow) of programs. Black-box uses an external interface.
Automated approaches to black-box testing make extensive use of specifications,
e.g., to specify test inputs or test oracles. In unit testing of object-oriented code,
preconditions, which define constraints on legal method inputs, and postconditions,
which define expected behavior and outputs, form an integral part of specifications.

4
INDEX
SR.NO. CHAPTER NAME PAGE No.
1 Acknowledgment 3

2 Abstract 4

3 Introduction 6

4 Types 8

5 Techniques 9

6 Benefits 10

7 How do you perform? 11

8 Examples 13

9 Testing Tools 14

10 Advantages 15

11 Disadvantages 16

12 Conclusion 17

13 Reference 18

5
Introduction
The box testing approach of software testing consists of black box testing and white box
testing. We are discussing here white box testing which also known as glass box is
testing, structural testing, clear box testing, open box testing and transparent box
testing. It tests internal coding and infrastructure of a software focus on checking of
predefined inputs against expected and desired outputs. It is based on inner workings of
an application and revolves around internal structure testing. In this type of testing
programming skills are required to design test cases. The primary goal of white box
testing is to focus on the flow of inputs and outputs through the software and
strengthening the security of the software.

The term 'white box' is used because of the internal perspective of the system. The clear
box or white box or transparent box name denote the ability to see through the
software's outer shell into its inner workings.

Developers do white box testing. In this, the developer will test every line of the code of
the program. The developers perform the White-box testing and then send the
application or the software to the testing team, where they will perform the black box
testing

and verify the application along with the requirements and identify the bugs and sends it to the developer.

The developer fixes the bugs and does one round of white box testing and sends it to the
testing team. Here, fixing the bugs implies that the bug is deleted, and the particular
feature is working fine on the application.

Types of White Box Testing

6
1.Unit testing −

Unit testing is frequently the first type of application testing performed. As each unit or
block of code is developed, it is subjected to unit testing. The programmer is primarily
responsible for unit testing. As a software developer, you write a few lines of code, a single
function, or an object, then test it to ensure it works before moving on to the next step. Early
in the software development lifecycle, unit testing helps in the detection of the majority of
issues. Bugs discovered at this stage are less expensive and easier to fix.

2.Testing for Memory Leaks –

Memory leaks are one of the most common reasons for slow-running apps. When you have
a slow-running software application, you need a QA professional who is skilled in detecting
memory leaks. Apart from the aforementioned, both black box and white box testing include a
few forms of testing. Below is a list of them.

3.White Box Penetration Testing –

In this type of testing, the tester/developer has access to the entire source code of the
program, as well as extensive network information, IP addresses involved, and all server
information. The goal is to attack the code from several aspects in order to expose security
flaws.

4.White Box Mutation Testing –

White box mutation testing is frequently used to determine the optimum coding strategies for
growing a software solution.

White Box Testing Techniques


A major White box testing technique is Code Coverage analysis. Code Coverage analysis
eliminates gaps in a Test Case suite. It identifies areas of a program that are not exercised
by a set of test cases. Once gaps are identified, you create test cases to verify untested parts
of the code, thereby increasing the quality of the software product

There are automated tools available to perform Code coverage analysis. Below are a few
coverage analysis techniques a box tester can use:

Statement Coverage:- This technique requires every possible statement in the code to be
tested at least once during the testing process of software engineering.

7
Branch Coverage – This technique checks every possible path (if-else and other
conditional loops) of a software application.

Apart from above, there are numerous coverage types such as Condition Coverage, Multiple
Condition Coverage, Path Coverage, Function Coverage etc. Each technique has its own
merits and attempts to test (cover) all parts of software code. Using Statement and Branch
coverage you generally attain 80-90% code coverage which is sufficient.

Following are important WhiteBox Testing Techniques:

• Statement Coverage
• Decision Coverage
• Branch Coverage
• Condition Coverage
• Multiple Condition Coverage
• Finite State Machine Coverage
• Path Coverage
• Control flow testing
• Data flow testing

8
Benefits of White Box testing

• Code optimization through the detection of hidden defects.


• Cases for white-box tests are simple to automate.
• Because all code paths are usually covered, testing is more thorough.
• Even if a GUI is not accessible, testing can begin early in the SDLC.

9
How do you perform White Box Testing?
We have divided it into two basic steps to give you a simplified explanation of white box
testing. This is what testers do when testing an application using the white box testing
technique:

STEP 1) UNDERSTAND THE SOURCE CODE


The first thing a tester will often do is learn and understand the source code of the
application. Since white box testing involves the testing of the inner workings of an
application, the tester must be very knowledgeable in the programming languages used in
the applications they are testing. Also, the testing person must be highly aware of secure
coding practices. Security is often one of the primary objectives of testing software. The
tester should be able to find security issues and prevent attacks from hackers and naive
users who might inject malicious code into the application either knowingly or
unknowingly.

STEP 2) CREATE TEST CASES AND EXECUTE


The second basic step to white box testing involves testing the application’s source code for
proper flow and structure. One way is by writing more code to test the application’s source
code. The tester will develop little tests for each process or series of processes in the
application. This method requires that the tester must have intimate knowledge of the
code and is often done by the developer. Other methods include Manual Testing, trial, and
error testing and the use of testing tools as we will explain further on in this article.

10
Black box testing example:
Code −

Printme (int a, int b) {------------ it is a function int result = a+ b;


If (result > 0)

11
Print ("Positive", result)
Else
Print ("Negative", result)
} ----------- End of the code
WhiteBox testing in software engineering aims to make sure that all decision branches, loops,
and statements in the code are correct.
WhiteBox test cases would be used to put the statements in the preceding white box testing
example to the test.
A = 1; B = 1
A = -1, B = -3

White Box Testing Tools


Below is a list of top white box testing tools.
• EclEmma
• NUnit
• PyUnit
• HTMLUnit
• CppUnit

12
Advantages of White Box Testing

1.Side effects of having the knowledge of the source code is beneficial to thorough
testing.

2.Optimization of code becomes easy as inconspicuous bottlenecks are exposed.

3.Gives the programmer introspection because developers carefully describe any


new implementation.

4.Provides traceability of tests from the source, thereby allowing future changes to the
source to be easily captured in the newly added or modified tests.

5.Easy to automate.

6.Provides clear, engineering-based rules for when to stop testing.

13
Disadvantages of White Box Testing

1. White box testing is too much time consuming when it comes to large-scale
programming applications.

2.White box testing is much expensive and complex.

3.It can lead to production error because it is not detailed by the developers.

4.White box testing needs professional programmers who have a detailed knowledge and
understanding of programming language and implementation.

14
Conclusion

• White box testing can be quite complex. The complexity involved has a lot to do with
the application being tested. A small application that performs a single simple
operation could be white box tested in few minutes, while larger programming
applications take days, weeks, and even longer to fully test.
• White box testing in software testing should be done on a software application as it
is being developed after it is written and again after each modification.

15
Reference
• http://agile.csc.ncsu.edu/SEMaterials/WhiteBox.pdf
• http://research.microsoft.com/en-us/projects/pex/

16

You might also like