SE File
SE File
Unit Testing:- Unit testing, a testing technique using which individual modules are
tested to determine if there are any issues by the developer himself. It is concerned with
functional correctness of the standalone modules. The main aim is to isolate each unit
of the system to identify, analyze and fix the defects.
Unit Testing Life
cycle:-
• Defects are found at an early stage. Since it is done by the dev team by testing
individual pieces of code before integration, it helps in fixing the issues early on in
source code without affecting other source codes.
• It helps maintain the code. Since it is done by individual developers, stress is being
put on making the code less inter dependent, which in turn reduces the chances of
impacting other sets of source code.
• It helps in reducing the cost of defect fixes since bugs are found early on in the
development cycle.
• It helps in simplifying the debugging process. Only latest changes made in the code
need to be debugged if a test case fails while doing unit testing.
Disadvantages:
• It’s difficult to write good unit tests and the whole process may take a lot of time
• A developer can make a mistake that will affect the whole system.
• Not all errors can be detected, since every module it tested separately and later
different integration bugs may appear.
• Testing will not catch every error in the program, because it cannot evaluate every
execution path in any but the most trivial programs. This problem is a superset of the
halting problem, which is un decidable.
• The same is true for unit testing. Additionally, unit testing by definition only tests the
functionality of the units themselves. Therefore, it will not catch integration errors or
broader system-level errors (such as functions performed across multiple units, or
non-functional test areas such as performance).
• Unit testing should be done in conjunction with other software testing activities, as
they can only show the presence or absence of particular errors; they cannot prove a
complete absence of errors.
• To guarantee correct behaviour for every execution path and every possible input,
and ensure the absence of errors, other techniques are required, namely the
application of formal methods to proving that a software component has no
unexpected behaviour. Unit Testing Techniques:
1. Black Box Testing - Using which the user interface, input and output are tested.
2. White Box Testing - used to test each one of those functions behavior is tested.
3. Gray Box Testing - Used to execute tests, risks and assessment methods.
Advantage: Big Bang testing has the advantage that everything is finished before
integration testing starts.
System Testing: - System Testing (ST) is a black box testing technique performed to
evaluate the complete system the system's compliance against specified requirements.
In System testing, the functionalities of the system are tested from an end-to-end
perspective. System Testing is usually carried out by a team that is independent of the
development team in order to measure the quality of the system unbiased. It includes
both functional and Non- Functional testing.
Experiment No:8
Aim: - To perform various white box and black box testing techniques.
White Box Testing: -
White Box Testing is the testing of a software solution's internal coding and
infrastructure. It focuses primarily on strengthening security, the flow of inputs and
outputs through the application, and improving design and usability. White box testing
is also known as Clear Box testing, Open Box testing, Structural testing, Transparent
Box testing, Code-Based testing, and Glass Box testing.
It is one of two parts of the "box testing" approach of software testing. Its counter-
part, black box testing, involves testing from an external or end-user type perspective.
On the other hand, White box testing is based on the inner workings of an application
and revolves around internal testing.
The term "white box" was used because of the see-through box concept. The clear box
or white box name symbolizes the ability to see through the software's outer shell (or
"box") into its inner workings. Likewise, the "black box" in "Black Box Testing"
symbolizes not being able to see the inner workings of the software so that only the end-
user experience can be tested.
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 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 the most important 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. There are many
tools available to assist developers/testers with memory leak testing, example, Rational
Purify for windows 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.
Integration Testing: - Integration testing is a level of software testing where individual
units are combined and tested as a group. The purpose of this level of testing is to expose
faults in the interaction between integrated units. Test drivers and test stubs are used to
assist in Integration Testing.
Advantages of White Box Testing: - •
Code optimization by finding hidden
errors.
• White box tests cases can be easily automated.
• Testing is more thorough as all code paths are usually covered.
• Testing can start early in SDLC even if GUI is not available.
Disadvantages of White Box Testing: -
• White box testing can be quite complex and expensive.
• Developers who usually execute white box test cases detest it. The white box testing
by developers is not detailed can lead to production errors.
• White box testing requires professional resources, with a detailed understanding of
programming and implementation.
• White-box testing is time-consuming, bigger programming applications take the time
to test fully
Black Box Testing
Black box testing is a software testing techniques in which functionality of the software
under test (SUT) is tested without looking at the internal code structure, implementation
details and knowledge of internal paths of the software. This type of testing is based
entirely on the software requirements and specifications. In Black Box Testing we just
focus on inputs and output of the software system without bothering about internal
knowledge of the software program.