0% found this document useful (0 votes)
43 views6 pages

Saket Singh B248 70021118053 Btech Cs Se Assignment 3 Sem Vi

The document discusses the principles of software testing and differentiates between black box and white box testing. It provides 7 principles of software testing: testing shows presence of defects, exhaustive testing is not possible, early testing, defect clustering, pesticide paradox, testing is context dependent, and absence of errors fallacy. It then defines and compares black box and white box testing, providing examples of each. Black box testing focuses on external functionality without knowledge of internal structure, while white box testing requires knowledge of internal structure to test code elements like paths and conditions.

Uploaded by

Saket Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views6 pages

Saket Singh B248 70021118053 Btech Cs Se Assignment 3 Sem Vi

The document discusses the principles of software testing and differentiates between black box and white box testing. It provides 7 principles of software testing: testing shows presence of defects, exhaustive testing is not possible, early testing, defect clustering, pesticide paradox, testing is context dependent, and absence of errors fallacy. It then defines and compares black box and white box testing, providing examples of each. Black box testing focuses on external functionality without knowledge of internal structure, while white box testing requires knowledge of internal structure to test code elements like paths and conditions.

Uploaded by

Saket Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Saket Singh B248 70021118053

BTECH CS SE ASSIGNMENT 3 SEM VI

Q1. Explain in details about Testing Principal


ANS: Software testing is a process of executing a program with the aim of finding the error.
To make our software perform well it should be error free. If testing is done successfully it will
remove all the errors from the software.

There are seven principles in software testing:


1. Testing shows presence of defects
2. Exhaustive testing is not possible
3. Early testing
4. Defect clustering
5. Pesticide paradox
6. Testing is context dependent
7. Absence of errors fallacy

 Testing shows presence of defects: 


The goal of software testing is to make the software fail. Software testing reduces
the presence of defects. Software testing talks about the presence of defects and
doesn’t talk about the absence of defects. Software testing can ensure that defects
are present but it cannot prove that software is defects free. Even multiple testing
can never ensure that software is 100% bug-free. Testing can reduce the number of
defects but not removes all defects.

 Exhaustive testing is not possible:


It is the process of testing the functionality of a software in all possible inputs (valid
or invalid) and pre-conditions is known as exhaustive testing. Exhaustive testing is
impossible means the software can never test at every test cases. It can test only
some test cases and assume that software is correct and it will produce the correct
output in every test cases. If the software will test every test case then it will take
more cost, effort, etc. and which is impractical.

 Early Testing:
To find the defect in the software, early test activity shall be started. The defect
detected in early phases of SDLC will very less expensive. For better performance
of software, software testing will start at initial phase i.e., testing will perform at the
requirement analysis phase.

 Defect clustering: 
In a project, a small number of the module can contain most of the defects. Pareto
Principle to software testing state that 80% of software defect comes from 20% of
modules.

 Pesticide paradox: 
Repeating the same test cases again and again will not find new bugs. So, it is
necessary to review the test cases and add or update test cases to find new bugs.

 Testing is context dependent: 


Testing approach depends on context of software developed. Different types of
software need to perform different types of testing. For example, the testing of the
e-commerce site is different from the testing of the Android application.

 Absence of errors fallacy: 


If a built software is 99% bug-free but it does not follow the user requirement then
it is unusable. It is not only necessary that software is 99% bug-free but it also
mandatory to fulfil all the customer requirements.

Q2. Differentiate between white box and Black box testing with proper
example and type of it.

ANS:

Black Box testing:

In Black-box testing, a tester doesn't have any information about the internal working of the
software system. Black box testing is a high level of testing that focuses on the behavior of the
software. It involves testing from an external or end-user perspective. Black box testing can be
applied to virtually every level of software testing: unit, integration, system, and acceptance.
White Box testing:

White-box testing is a testing technique which checks the internal functioning of the system. In
this method, testing is based on coverage of code statements, branches, paths or conditions.
White-Box testing is considered as low-level testing. It is also called glass box, transparent box,
clear box or code base testing. The white-box Testing method assumes that the path of the logic
in a unit or program is known.

DIFFERENCE BETWEEN BLACK BOX AND WHITE BOX TESTING:

             Black Box Testing                    White Box Testing

Black box testing is the Software testing White box testing is the software testing
method which is used to test the software method in which internal structure is being
without knowing the internal structure of code known to tester who is going to test the
or program. software.

Generally, this type of testing is carried out by


This type of testing is carried out by testers.
software developers.

Implementation Knowledge is not required to Implementation Knowledge is required to


carry out Black Box Testing. carry out White Box Testing.

Programming Knowledge is not required to Programming Knowledge is required to carry


carry out Black Box Testing. out White Box Testing.

Testing is applicable on higher levels of testing Testing is applicable on lower level of testing
like System Testing, Acceptance testing. like Unit Testing, Integration testing.

Black box testing means functional test or White box testing means structural test or
external testing. interior testing.

In White Box testing is primarily concentrate


In Black Box testing is primarily concentrate on the testing of program code of the system
on the functionality of the system under test. under test like code structure, branches,
conditions, loops etc.

The main aim of this testing to check on what The main aim of White Box testing to check
functionality is performing by the system under
on how System is performing.
test.

Black Box testing can be started based on White Box testing can be started based on
Requirement Specifications documents. Detail Design documents.

The Structural testing, Logic testing, Path


The Functional testing, Behavior testing, Close
testing, Loop testing, Code coverage testing,
box testing is carried out under Black Box
Open box testing is carried out under White
testing, so there is no required of the
Box testing, so there is compulsory to know
programming knowledge.
about programming knowledge.

Example: search something on google by


Example: by input to check and verify loops
using keywords

Black box testing example:


A simple login screen of software or a web application will be tested for seamless user login. The
login screen has two fields, username and password as an input and the output will be to enable
access to the system.
A black box testing will not consider the specifications of the code, and it will test the valid
username and password to login to the right account.
This form of testing technique will check the input and output.
 A user logged in when inputs a present username and correct password
 A user receives an error message when enters username and incorrect
password
The black box testing is also known as an opaque, closed box, function-centric testing. It
emphasizes on the behavior of the software. Black box testing checks scenarios where the system
can break.
For example, a user might enter the password in the wrong format, and a user might not receive
an error message on entering an incorrect password.

WhiteBox Testing Example

Consider the following piece of code

Printme (int a, int b) { ------------ Printme is a function


int result = a+ b;
If (result> 0)
Print ("Positive", result)
Else
Print ("Negative", result)
} ----------- End of the source code

The goal of WhiteBox testing in software engineering is to verify all the decision branches,
loops, statements in the code.

To exercise the statements in the above white box testing example, WhiteBox test cases would
be

 A = 1, B = 1
 A = -1, B = -3

Types of Black Box Testing: 


 
 Functional Testing 
This black box testing type is related to the functional requirements of a system; it is done
by software testers.
 
 Non-functional testing 
This type of black box testing is not related to testing of specific functionality, but non-
functional requirements such as performance, scalability, usability. 

 Regression Testing
 Regression Testing is done after code fixes, upgrades or any other system maintenance to
check the new code has not affected the existing code.

Types of White Box Testing:  

White box testing encompasses several testing types used to evaluate the usability of an
application, block of code or specific software package. There are listed below --

 Unit Testing: It is often the first type of testing done on an application. Unit Testing is
performed on each unit or block of code as it is developed. Unit Testing is essentially
done by the programmer. As a software developer, you develop a few lines of code, a
single function or an object and test it to make sure it works before continuing Unit
Testing helps identify a majority of bugs, early in the software development lifecycle.
Bugs identified in this stage are cheaper and easy to fix.
 Testing for Memory Leaks: Memory leaks are leading causes of slower running
applications. A QA specialist who is experienced at detecting memory leaks is essential
in cases where you have a slow running software application.

Apart from above, a few testing types are part of both black box and white box testing. They are
listed as below

 White Box Penetration Testing: In this testing, the tester/developer has full information
of the application's source code, detailed network information, IP addresses involved and
all server information the application runs on.  The aim is to attack the code from several
angles to expose security threats
 White Box Mutation Testing: Mutation testing is often used to discover the best coding
techniques to use for expanding a software solution.

You might also like