0% found this document useful (0 votes)
127 views

UNIT IV Software Engineering Notes

The document discusses various types of software testing including black box testing, white box testing, and unit testing. Black box testing focuses on validating software functionality without knowledge of internal code structure. White box testing examines internal code structure and logic. Unit testing validates individual software units or components in isolation to ensure they function as intended.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views

UNIT IV Software Engineering Notes

The document discusses various types of software testing including black box testing, white box testing, and unit testing. Black box testing focuses on validating software functionality without knowledge of internal code structure. White box testing examines internal code structure and logic. Unit testing validates individual software units or components in isolation to ensure they function as intended.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

A strategic approach to software testing

Software Testing
• Software Testing is the process of evaluating a software
application to identify if it meets specified
requirements and to identify any defects
• Software Testing is a type of investigation to find out if
there is any default or error present in the software so
that the errors can be reduced or removed to increase
the quality of the software and to check whether it
fulfills the specifies requirements or not.
According to Glen Myers, software testing has the
following objectives:

• The process of investigating and checking a program to


find whether there is an error or not and does it fulfill
the requirements or not is called testing.
• When the number of errors found during the testing is
high, it indicates that the testing was good and is a sign
of good test case.
• Finding an unknown error that wasn’t discovered yet is
a sign of a successful and a good test case.
Test strategies for conventional software
The following are common testing strategies:
1.Black box testing – Tests the functionality of the
software without looking at the internal code structure.
2.White box testing – Tests the internal code structure
and logic of the software.
3.Unit testing – Tests individual units or components of
the software to ensure they are functioning as intended.
4.Integration testing – Tests the integration of different
components of the software to ensure they work
together as a system.
5.Functional testing – Tests the functional requirements of
the software to ensure they are met.
6.System testing – Tests the complete software system to
ensure it meets the specified requirements.
7.Acceptance testing – Tests the software to ensure it
meets the customer’s or end-user’s expectations.
8.Regression testing – Tests the software after changes or
modifications have been made to ensure the changes have
not introduced new defects.
9.Performance testing – Tests the software to determine
its performance characteristics such as speed, scalability,
and stability.
10.Security testing – Tests the software to identify
vulnerabilities and ensure it meets security requirements.
Black box testing

• Black-box testing is a type of software testing in which the tester is not


concerned with the internal knowledge or implementation details of the
software, but rather focuses on validating the functionality based on the
provided specifications or requirements.

• Black Box Testing Types are following


1. Functional Testing
2. Regression Testing
3. Nonfunctional Testing (NFT)

1.Functional Testing: It determines the system’s software functional


requirements.
2.Regression Testing: It ensures that the newly added code is compatible
with the existing code. In other words, a new software update has no impact
on the functionality of the software. This is carried out after a system
maintenance operation and upgrades.
3.Nonfunctional Testing: Nonfunctional testing is also known as NFT. This
testing is not functional testing of software. It focuses on the software’s
performance, usability, and scalability.

• Tools Used for Black Box Testing:

Appium
Selenium
Microsoft Coded UI
Applitools HP QTP.
• Black box testing Methods
1. Syntax-Driven Testing – This type of testing is applied to systems that
can be syntactically represented by some language. For example- compilers,
language that can be represented by context-free grammar. In this, the test
cases are generated so that each grammar rule is used at least once.

2. Equivalence partitioning – It is often seen that many types of inputs


work similarly so instead of giving all of them separately we can group
them and test only one input of each group.
• This technique involves two steps:
(i)Identification of equivalence class – Partition any input domain into a
minimum of two sets: valid values and invalid values. For example, if the
valid range is 0 to 100 then select one valid input like 49 and one invalid like
104.
(ii)Generating test cases – (a) To each valid and invalid class of input assign a
unique identification number. (b) Write a test case covering all valid and
invalid test cases

3. Boundary value analysis – Boundaries are very good places for errors to
occur. Hence if test cases are designed for boundary values of the input
domain then the efficiency of testing improves and the probability of finding
errors also increases. For example – If the valid range is 10 to 100 then test
for 10,100 also apart from valid and invalid inputs.

4. Requirement-based testing – It includes validating the requirements


given in the SRS of a software system.
5. Cause effect Graphing – This technique establishes a relationship
between logical input called causes with corresponding actions called the
effect. The causes and effects are represented using Boolean graphs.

Advantages of Black Box Testing:

The tester does not need to have more functional knowledge or


programming skills to implement the Black Box Testing.
It is efficient for implementing the tests in the larger system.
Tests are executed from the user’s or client’s point of view.
Test cases are easily reproducible.
It is used in finding the ambiguity and contradictions in the functional
specifications.
Disadvantages of Black Box Testing:
There is a possibility of repeating the same tests while implementing the
testing process.
Without clear functional specifications, test cases are difficult to implement.
It is difficult to execute the test cases because of complex inputs at different
stages of testing.
Sometimes, the reason for the test failure cannot be detected.
White box Testing
• White box testing techniques analyze the internal structures the used data
structures, internal design, code structure, and the working of the
software rather than just the functionality as in black box testing.

• It is also called glass box testing or clear box testing or structural testing.
White Box Testing is also known as transparent testing or open box testing.
• White box testing is a software testing technique that involves testing the
internal structure and workings of a software application.

• The tester has access to the source code and uses this knowledge to
design test cases that can verify the correctness of the software at the
code level.
• White box testing is also known as structural testing or code-based testing,
and it is used to test the software’s internal logic, flow, and structure. The
tester creates test cases to examine the code paths and logic flows to
ensure they meet the specified requirements.

• White Testing is Performed in 2 Steps:

1. Tester should understand the code well


2. Tester should write some code for test cases and execute them
• Tools required for White box Testing:

PyUnit
Sqlmap
Nmap
Parasoft Jtest
Nunit
• Features of white box testing:
Code coverage analysis: White box testing helps to analyze the code
coverage of an application, which helps to identify the areas of the code that
are not being tested.
Access to the source code: White box testing requires access to the
application’s source code, which makes it possible to test individual functions,
methods, and modules.
Knowledge of programming languages: Testers performing white box testing
must have knowledge of programming languages like Java, C++, Python, and
PHP to understand the code structure and write tests.
Identifying logical errors: White box testing helps to identify logical errors in
the code, such as infinite loops or incorrect conditional statements.

White boxTesting techniques:

1.Statement coverage: In this technique, the aim is to traverse all statements


at least once. Hence, each line of code is tested. In the case of a flowchart,
every node must be traversed at least once. Since all lines of code are
covered, helps in pointing out faulty code.
2.Branch Coverage: In this technique, test cases are designed so that each
branch from all decision points is traversed at least once. In a flowchart, all
edges must be traversed at least once.

3.Multiple Condition Coverage: In this technique, all the possible


combinations of the possible outcomes of conditions are tested at least once.

4.Basis Path Testing: In this technique, control flow graphs are made from
code or flowchart and then Cyclomatic complexity is calculated which defines
the number of independent paths so that the minimal number of test cases
can be designed for each independent path.
Advantages:
• White box testing is thorough as the entire code and structures are tested.
• It results in the optimization of code removing errors and helps in removing
extra lines of code.
• It can start at an earlier stage as it doesn’t require any interface as in the
case of black box testing.
• Easy to automate.

Disadvantages:

• It is very expensive.
• Redesigning code and rewriting code needs test cases to be written again.
• Testers are required to have in-depth knowledge of the code and
programming language as opposed to black-box testing.
Differences between Black Box Testing vs White Box Testing:
Unit Testing

• Unit testing is a type of software testing that focuses on individual units or


components of a software system.
• The purpose of unit testing is to validate that each unit of the software
works as intended and meets the requirements.
• Unit testing is typically performed by developers, and it is performed early
in the development process before the code is integrated and tested as a
whole system.
• Unit tests are automated and are run each time the code is changed to
ensure that new code does not break existing functionality.
• Unit tests are designed to validate the smallest possible unit of code, such
as a function or a method, and test it in isolation from the rest of the
system.
Objective of Unit Testing:
The objective of Unit Testing is:

• To isolate a section of code.


• To verify the correctness of the code.
• To test every function and procedure.
• To fix bugs early in the development cycle and to save costs.
• To help the developers to understand the code base and enable them to
make changes quickly.
• To help with code reuse.

Unit Testing Techniques:


There are 3 types of Unit Testing Techniques. They are
1.Black Box Testing: This testing technique is used in covering the unit tests for
input, user interface, and output parts.
2.White Box Testing: This technique is used in testing the functional behavior of
the system by giving the input and checking the functionality output including
the internal design structure and code of the modules.
3.Gray Box Testing: This technique is used in executing the relevant test cases,
test methods, test functions, and analyzing the code performance for the
modules.
Unit Testing Tools:
Here are some commonly used Unit Testing tools:

Jtest
Junit
NUnit
EMMA
PHPUnit
Advantages of Unit Testing:
• Unit Testing allows developers to learn what functionality is provided by a
unit and how to use it to gain a basic understanding of the unit API.
• Unit testing allows the programmer to refine code and make sure the
module works properly.
• Unit testing enables testing parts of the project without waiting for others to
be completed.
Disadvantages of Unit Testing:
• The process is time-consuming for writing the unit test cases.
• Unit Testing will not cover all the errors in the module because there is a
chance of having errors in the modules while doing integration testing.
• Unit Testing is not efficient for checking the errors in the UI(User Interface)
part of the module.
System Testing
• System testing is a type of software testing that evaluates the overall
functionality and performance of a complete and fully integrated software
solution.
• It tests if the system meets the specified requirements and if it is suitable
for delivery to the end-users.
• This type of testing is performed after the integration testing and before
the acceptance testing.
• System Testing is carried out on the whole system in the context of either
system requirement specifications or functional requirement specifications
or in the context of both.
• System testing tests the design and behavior of the system and also the
expectations of the customer.
• It is performed to test the system beyond the bounds mentioned in the
software requirements specification (SRS).
• System Testing is a black-box testing. System Testing is performed after the
integration testing and before the acceptance testing.

• System Testing Process: System Testing is performed in the following steps:


Types of System Testing:

Performance Testing: Performance Testing is a type of software testing that is


carried out to test the speed, scalability, stability and reliability of the software
product or application.
Load Testing: Load Testing is a type of software Testing which is carried out to
determine the behavior of a system or software product under extreme load.
Stress Testing: Stress Testing is a type of software testing performed to check
the robustness of the system under the varying loads.
Scalability Testing: Scalability Testing is a type of software testing which is
carried out to check the performance of a software application or system in
terms of its capability to scale up or scale down the number of user request
load.
Tools used for System Testing :

• JMeter
• Gallen Framework
• Selenium
Advantages of System Testing :

• The testers do not require more knowledge of programming to carry out


this testing.
• It will test the entire product or software so that we will easily detect the
errors or defects which cannot be identified during the unit testing and
integration testing.
• The testing environment is similar to that of the real time production or
business environment.
Disadvantages of System Testing :

• This testing is time consuming process than another testing techniques since
it checks the entire product or software.
• The cost for the testing will be high since it covers the testing of entire
software.
• It needs good debugging tool otherwise the hidden errors will not be found.
Debugging

• Debugging is the process of identifying and resolving errors, or bugs, in a


software system.
• It is an important aspect of software engineering because bugs can cause a
software system to malfunction, and can lead to poor performance or
incorrect results.
• Debugging can be a time-consuming and complex task, but it is essential for
ensuring that a software system is functioning correctly.
• There are several common methods and techniques used in debugging,
including:

1.Code Inspection: This involves manually reviewing the source code of a


software system to identify potential bugs or errors.
2.Debugging Tools: There are various tools available for debugging such as
debuggers, trace tools, and profilers that can be used to identify and resolve
bugs.
3.Unit Testing: This involves testing individual units or components of a software
system to identify bugs or errors.
4.Integration Testing: This involves testing the interactions between different
components of a software system to identify bugs or errors.
5.System Testing: This involves testing the entire software system to identify
bugs or errors.
6.Monitoring: This involves monitoring a software system for unusual behavior
or performance issues that can indicate the presence of bugs or errors.
7.Logging: This involves recording events and messages related to the software
system, which can be used to identify bugs or errors.
Debugging Process: Steps involved in debugging are:
• Problem identification and report preparation.
• Assigning the report to the software engineer defect to verify that it is
genuine.
• Defect Analysis using modeling, documentation, finding and testing
candidate flaws, etc.
• Defect Resolution by making required changes to the system.
• Validation of corrections.

Debugging Tools:

• Radare2
• WinDbg
• Valgrind
Advantages of Debugging:
Improved system quality: By identifying and resolving bugs, a software system
can be made more reliable and efficient, resulting in improved overall quality.

Reduced system downtime: By identifying and resolving bugs, a software


system can be made more stable and less likely to experience downtime,
which can result in improved availability for users.

Increased user satisfaction: By identifying and resolving bugs, a software


system can be made more user-friendly and better able to meet the needs of
users, which can result in increased satisfaction.
Disadvantages of Debugging:

Time-consuming: Debugging can be a time-consuming process, especially if


the bug is difficult to find or reproduce. This can cause delays in the
development process and add to the overall cost of the project.

Requires specialized skills: Debugging can be a complex task that requires


specialized skills and knowledge. This can be a challenge for developers who
are not familiar with the tools and techniques used in debugging.

Can be difficult to reproduce: Some bugs may be difficult to reproduce, which


can make it challenging to identify and resolve them.
Differences between Testing and Debugging

You might also like