0% found this document useful (0 votes)
1 views19 pages

CH 5 Software Testing

Chapter 5 of the Software Engineering document discusses software testing, defining it as a method to assess software functionality against requirements and identify errors. It covers various types of testing, including manual (white box, black box, gray box) and automation testing, as well as the Software Testing Life Cycle (STLC) phases. Additionally, it highlights the differences between unit testing and component testing, and the importance of system testing in ensuring overall system functionality.

Uploaded by

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

CH 5 Software Testing

Chapter 5 of the Software Engineering document discusses software testing, defining it as a method to assess software functionality against requirements and identify errors. It covers various types of testing, including manual (white box, black box, gray box) and automation testing, as well as the Software Testing Life Cycle (STLC) phases. Additionally, it highlights the differences between unit testing and component testing, and the importance of system testing in ensuring overall system functionality.

Uploaded by

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

Software Engineering

Chapter 5: Software Testing

What is Software Testing?

Software Testing is a method to assess the functionality of the


software program. The process checks whether the actual software matches
the expected requirements and ensures the software is bug-free. The purpose
of software testing is to identify the errors, faults, or missing requirements in
contrast to actual requirements.

Types of software Testing

BCA College, Nidasoshi Page 1


Software Engineering
Manual testing
The process of checking the functionality of an application as per the
customer needs without taking any help of automation tools is known as
manual testing. While performing the manual testing on any application, we
do not need any specific knowledge of any testing tool.
Manual testing can be further divided into three types of testing,
which are as follows:
o White box testing
o Black box testing
o Gray box testing

Automation testing
Automation testing is a process of converting any manual test cases
into the test scripts with the help of automation tools, or any programming
language is known as automation testing.
With the help of automation testing, we can enhance the speed of our
test execution because here, we do not require any human efforts. We need
to write a test script and execute those scripts.

White-box testing
The white box testing is done by Developer, where they check
every line of a code before giving it to the Test Engineer. Since the code is
visible for the Developer during the testing, that's why it is also known as
glass box testing, clear box testing and transparent box testing.

BCA College, Nidasoshi Page 2


Software Engineering
Black box testing
The black box testing is done by the Test Engineer, where they can
check the functionality of an application or the software according to the
customer /client's needs. In this, the code is not visible while performing the
testing; that's why it is known as black-box testing.

Gray Box testing


Gray box testing is a combination of white box and Black box
testing. It can be performed by a person who knew both coding and testing.
And if the single person performs white box, as well as black-box testing for
the application, is known as Gray box testing.

White-box testing

1. White box testing techniques analyze Internal design, Code structure &
working of the complete software product.
2. It is also called Clear box testing, Open box testing, Transparent box
testing. Code-based testing and Glass box testing.
3. Tester has knowledge about the internal structure or the programming
of the software.
4. It is mostly done by software developers.
5. Perform with Unit Testing & Integration Testing.
6. 2White Box Testing Tools: EclEmma, Nunit, PyUnit, HTMLUnit,
CppUnit

BCA College, Nidasoshi Page 3


Software Engineering

White Box Testing Techniques

1. Path Coverage/Testing:

 Testing is dependent on the program's control or flow structure.


 All possible paths are defined with entry to exit points in the system.

2. Loop Testing:

 There are loops such as while, for and do-while loops etc.
 It checks all Simple, Nested loops.

BCA College, Nidasoshi Page 4


Software Engineering
3. Branch Coverage / Condition Testing:

 The logical conditions for every value are checked, whether it is true or
false.
 This means that both the if and else conditions are verified.

4. Statement Coverage:

 Statement coverage is a testing technique in which tester traverse all


statements in code.
 It ensure that each statement of the code is executed at least once.
 Hence each line of the code is verified.

Advantages of White Box Testing:

1. White box testing optimizes code so hidden errors can be


identified.
2. Test cases of white box testing can be easily automated.
3. Early detection of errors that improve code quality.
4. It cover most path & code of the software.
BCA College, Nidasoshi Page 5
Software Engineering
Disadvantages of White Box Testing:

1. White box testing can be quite Complex, Expensive & Time-


consuming.
2. Requires professional resources with detailed understanding of
Programming.
3. Missing functionalities cannot be detected.
4. Redesign of code needs test cases to be written again.

Black-box testing

1. In Black Box Testing, the functionalities of software applications are


tested without having knowledge of Internal code structure,
Implementation details and Internal paths.
2. Tester gives input value to examine its functionality & checks whether
function is giving expected output or not.
3. If the function produces correct output, then it is passed in testing,
otherwise failed.
4. It is also known as Behavioral Testing, Functional & Closed box
Testing.
5. Perform by the Software Testers.
6. Black Box Testing Tools: QTP, Selenium, Loadrunner & Jmeter.

BCA College, Nidasoshi Page 6


Software Engineering

Black- Box Testing Techniques

1. Equivalent Partitioning

 Here, input values that provide to system are divided into different
classes or groups based on its similarity in the outcome.
 Instead of using each & every input value, use any one value from the
group to test outcome.

2. Boundary Value Analysis:

 It test, boundary values are those that contain the upper and lower limit
of a variable.
 It tests, while entering boundary value whether the software is
producing correct output or not.

3. Decision table testing

 Various input combinations & their respective system behavior are


captured in tabular form.

BCA College, Nidasoshi Page 7


Software Engineering
 Check logical relationship between two and more than two inputs. Ex.
Gmail Account.

4. Error Guessing

 It is based on the experience of the tester, where tester uses experience


to guess the problematic areas of the software.
 Examples: Handling null values in text fields, Accepting the Submit
button without any value, File upload without attachment, File upload
with less than or more than the limit size.

5. All Pairs testing techniques.


 It is used to test all the possible discrete combinations of values.
 This combinational method is used for testing the application that
uses checkbox input, radio button input, list box, text box etc.

Advantages of Black Box Testing:

1. The tester does not need to have more functional knowledge or


programming skills.
2. It is efficient for implementing the tests in the larger system.
3. Tests are executed from the user's or client's point of view.

Disadvantages of Black Box Testing:


1. Without clear programming knowledge, test cases are difficult to
Implement.
2. Working with a large sample space of inputs can be
consumes a lot of time.

BCA College, Nidasoshi Page 8


Software Engineering

Difference between White box and Black box testing

White box testing Black box testing


The internal structure and working of The internal structure and working of
the software is known to the tester the software did not known to the
tester.
Code implementation is necessary for Implementation of code is not
white box testing. needed for black box testing.
It is mostly done by software It is mostly done by software
developers. testers.
Knowledge of implementation is No knowledge of implementation is
required. needed.
It is the internal software It can be referred as
testing. external software testing.
It is mandatory to have knowledge of No knowledge of programming is
programming. required.
It is most time consuming It is least time consuming
Types of White Box Testing: Types of Black Box Testing:
1. Path testing 1. Functional Testing
2. Loop testing 2. Non-functional testing
3. Condition testing 3. Regression Testing

Stages of Testing Development

The procedure of software testing is also known as STLC


(Software Testing Life Cycle) which includes phases of the testing process.
The testing process is executed in a well-planned and systematic manner. All
activities are done to improve the quality of the software product.
The main goal of the STLC is to identify and document any defects
or issues in the software application as early as possible in the development
process. This allows for issues to be addressed and resolved before the
software is released to the public.

BCA College, Nidasoshi Page 9


Software Engineering
Software testing life cycle contains the following steps:

1. Requirement Analysis: Requirement Analysis is the first step of the


Software Testing Life Cycle (STLC). In this phase quality assurance team
understands the requirements like what is to be tested. If anything is
missing or not understandable then the quality assurance team meets with
the stakeholders to better understand the detailed knowledge of
requirements.

2. Test Planning: Test Planning is the most efficient phase of the software
testing life cycle where all testing plans are defined. In this phase manager
of the testing team estimate the time and cost required for testing. This
phase gets started once the requirement-gathering phase is completed.

3. Test Case Development: The test case development phase gets started
once the test planning phase is completed. In this phase testing team notes
down the detailed test cases. The testing team also prepares the required
test data for the testing. When the test cases are prepared then they are
reviewed by the quality assurance team.

4. Test Environment Setup: Test environment setup is a vital part of the


STLC. Test environment is a setup of software and hardware for the testing

BCA College, Nidasoshi Page 10


Software Engineering
teams to execute test cases. In this process, the testing team is not involved.
Either the developer or the customer creates the testing environment.

5. Test Execution: After the test case development and test environment
setup test execution phase gets started. In this phase testing team starts
executing test cases based on prepared test cases in the earlier step.

6. Test Closure: Test closure is the final stage of the Software Testing Life
Cycle (STLC). The main objective of the test closure stage is to ensure that
all testing-related activities have been completed and that the software is
ready for release.

Unit Testing

1. Unit testing involves the testing of each unit or an individual component


of the software application. It is the first level of functional testing. The
aim behind unit testing is to validate unit components with its
performance.
2. Unit tests are used to test individual blocks (unit) of software system and
tested during the development phase of the application software.
3. The purpose of unit testing is to test the correctness of code. White box
testing approach used for unit testing and usually done by the developers.
4. Whenever the application is ready and given to the Test engineer, he/she
will start checking every component of the module or module of the
application independently or one by one, and this process is known as
Unit testing or components testing.

Unit Testing Techniques:


Unit testing uses all white box testing techniques as it uses the code of
software application:
1) Path flow Testing
2) Branch Coverage Testing
3) Statement Coverage Testing
4) Decision Coverage Testing

BCA College, Nidasoshi Page 11


Software Engineering
Advantages
1) It helps you to write better code.
2) It helps you to catch bugs earlier.
3) It makes your code easy to re-factor.
4) Reduced cost for testing and bug fixing.

Disadvantages
1) It takes time to write test cases.
2) Unit testing is not able to catch each and every error in a program.
3) If developer can make a mistake that will impact the whole system.

Component Testing

Another type of software testing is Component Testing. It is used to


test all the components separately. It is further known as Module Testing.
Component testing has an important role in finding the issue. Before
processing with the integration testing, component testing is performed in
order to ensure that each component of the application is working correctly
and as per requirement.

Component Testing Process

BCA College, Nidasoshi Page 12


Software Engineering
Step1: Requirement Analysis
The first step of component testing is requirement analysis, where User
requirement related to each component is observed.

Step2: Test Planning


Once the requirement analysis phase is done, we will move to the next step
of component testing process, which is test planning. In this phase, Test is
planned according to the analysis of the requirements of the user.

Step3: Test Specification


Once the test planning phase is done, we will move to the next phase, known
as test specification. In this section it is specified that which test case must
be run. .

Step4: Test Implementation


The forth step in the component testing process is Test implementation.
Once the test cases are specified according to the user requirements, test
cases are executed.

Step5: Test Recording


When all the above steps have been completed successfully, we will go to
the next step that is, Test Recording. Test recording is the having record of
the defects that are detected.

Step6: Test Verification


Once the bugs or defects have been recorded successfully, we will proceed
to the test verification phase. Test verification is the process to determine
whether the product meet specification.

Step7: Completion
After completed all the above steps successfully, we will come to the last
step of the component testing process. In this particular step, the results will
be evaluated in order to deliver a good quality product.

BCA College, Nidasoshi Page 13


Software Engineering
Difference between Unit Testing and Component testing

Unit Testing Component testing


Unit testing is performed by the team Component testing is performed by
of developers. the team of Test engineers.
Unit testing is white box testing. Component testing is black box
testing.
The tester knows the internal design The tester does not know the internal
of the software. design of the software.
Detection of defects is easy in unit Detection of defects is little difficult
testing. as compared to unit testing
Unit testing is performed after every Once the whole software is
development step. developed then only component
testing is performed.

System Testing

 System Testing means testing the system as a whole. All the


modules/components are integrated in order to verify if the system
works as expected or not.
 The purpose of system test is to evaluate the end to end system
specifications.
 System testing detects defects within both the integrated units and the
whole system.
 The result of system testing is the observed behavior of a component
or a system when it is tested.
 System Testing is a black-box testing. System Testing is performed
after the integration testing and before the acceptance testing.

BCA College, Nidasoshi Page 14


Software Engineering
System Testing Process:


 Test Environment Setup: Create testing environment for the better
quality testing.
 Create Test Case: Generate test case for the testing process.
 Create Test Data: Generate the data that is to be tested.
 Execute Test Case: After the generation of the test case and the test
data, test cases are executed.
 Defect Reporting: Defects in the system are detected.
 Regression Testing: It is carried out to test the side effects of the
testing process.
 Log Defects: Defects are fixed in this step.
 Retest: If the test is not successful then again test is performed.

Advantages of System Testing:


1) Verifies the overall functionality of the system.
2) Detects and identifies system-level problems early in the development
cycle.
3) Helps to validate the requirements and ensure the system meets the
user needs.
4) Improves system reliability and quality.
5) Enhances the overall performance of the system.

BCA College, Nidasoshi Page 15


Software Engineering
Disadvantages of System Testing:
1) Can be time-consuming and expensive.
2) Can be complex and challenging, especially for large and complex
systems.
3) Requires proper planning, coordination and execution.
4) Can be impacted by changes made during development.
5) Requires specialized skills and expertise.

Test-driven development testing

Test-driven development, or TDD for short, is a software


development process. TDD is a process of modifying the code in order to
pass a test designed previously.

 Test-Driven Designing and building tests for each single function of an


application is the first step in development. Only when an automated
test fails, the TDD framework tells developers to write new code.

 It is based on the simple principle of developing and correcting failed


tests before writing new code.

 The fundamental TDD process is shown below. The steps in the


process are as follows:

BCA College, Nidasoshi Page 16


Software Engineering
1. You start by identifying the increment of functionality that is required.
2. You write a test for this functionality and implement this as an automated
test.
3. You then run the test, along with all other tests that have been
implemented. Initially, you have not implemented the functionality so the
new test will fail.
4. You then implement the functionality and re-run the test.
5. Once all tests run successfully, you move on to implementing the next
chunk of functionality.

Benefits:
1. Regression testing
A regression test suite is developed incrementally as a program is
developed.

2. Simplified debugging
When a test fails, it should be obvious where the problem lies. The
newly written code needs to be checked and modified.

3. System documentation
The tests themselves are a form of documentation that describe what the
code should be doing.

Release testing

What is Release Testing?

 Release Testing is the process of verifying that a particular release of a


software product meets the specified requirements and is “ready for
release” to the end users .
 Release testing, therefore, has to show that the system delivers its
specified functionality, performance and dependability, and that it does
not fail during normal use.
 Release testing is usually a black-box testing process where tests are
only derived from the system specification.
BCA College, Nidasoshi Page 17
Software Engineering
 Release testing is a form of system testing.
 A separate or dedicated team should be responsible for release testing.
 System testing by the development team should focus on discovering
bugs in the system (defect testing). The objective of release testing is
to check that the system meets its requirements and is good enough for
external use (validation testing).

Benefits of Release Testing

1. Improves software product quality and performance


2. It is cost-effective
3. It increases customer satisfaction

User testing

 User or customer testing is a stage in the testing process in which users


or customers provide input and advice on system testing.

 User testing is essential, even when comprehensive system and release


testing have been carried out.

Types of user testing

1. Alpha Testing
 It is a type of software testing performed to identify bugs before
releasing the product to real users or to the public.
 Alpha testing involves both, white box and black box testing
approaches and techniques.

2. Beta Testing
 Beta testing is performed by real users of the software
applications in a real environment.
 As real users perform beta testing only black box approach is
used here

BCA College, Nidasoshi Page 18


Software Engineering

3. Acceptance Testing
 Acceptance Testing is the last phase of software testing performed
after System Testing.
 Acceptance testing is a process of verifying that software
meets the expectations of users. Acceptance tests are
typically performed by end users, to determine if the
software is functioning as expected.

Acceptance testing process

There are six stages in the acceptance testing process, as shown in Figure
They are:
1. Define acceptance criteria
2. Plan acceptance testing
3. Derive acceptance tests
4. Run acceptance tests
5. Negotiate test results
6. Reject/accept system

Agile methods and acceptance testing


 In agile methods, the user/customer are part of the development team
and is responsible for making decisions on the acceptability of the
system.

 There is no separate acceptance testing process.

BCA College, Nidasoshi Page 19

You might also like