Unit 1 Notes
Unit 1 Notes
AND AUTOMATION
Course objectives:
Black box
• Black box testing are beneficial for the end users who wish
to perform software verification
Testing techniques:
Loop Testing: Loops are widely used and these are fundamental to many
algorithms hence, their testing is very important. Errors often occur at the
beginnings and ends of loops.
Types:
Simple loops
Nested loops
Concatenated loops
Tools required for White box Testing:
PyUnit
Sqlmap
Nmap
Parasoft Jtest
Nunit
Advantages:
• White box testing is thorough as the entire code and structures are
tested.
• Removing errors and helps in removing extra lines of code.
• It can start at an earlier stage as it doesn’t require any interface.
• Easy to automte.
SOFTWARE TESTING LIFE CYCLE:
• The Software Testing Life Cycle (STLC) is a systematic approach to
testing a software application to ensure that it meets the requirements
and is free of defects.
Requirement
gathering
Designing
Coding
Testing
Deployment
Maintenance
Stages of STLC:
1. Project Planning
2. Gathering Requirements & Analysis
3. Design
4. Coding or Implementation
5. Testing
6. Deployment
7. Maintenance
Project planning:
• In this phase, we identify the activities and resources which would
help to meet the testing objectives.
• During planning, we also try to identify the metrics and the method of
gathering and tracking those metrics.
Gathering Requirements & Analysis:
• In this phase quality assurance team understands the requirements
like what is to be tested.
• Identifying any missing or incomplete requirements.
Designing:
Coding or Implementation:
• Implement or create the code based on the software application.
• Before finalizing the test case, It is important to carry out a review to
ensure the correctness of the test cases.
Testing:
• The primary purpose of the Test Phase is to determine whether the
automated system/application software is ready for implementation.
Deployment:
• Once the testing is done, and the product is ready for deployment, it
is released for customers to use.
Maintenance:
• In this phase of SDLC where the developed product is taken care of.
• According to the changing user end environment or technology, the
software is updated timely.
V- MODEL OF SOFTWARE TESTING:
• The V-model is a type of SDLC model where process executes in a
sequential manner in V-shape.
• It is based on the idea of a “V” shape, with the two legs of the “V”
representing the progression of the software development process
Val
id atio
np
has
e
Verification: It involves a static analysis method (review) done without
executing code. It is the process of evaluation of the product development
process to find whether specified requirements meet.
Verification phase:
Requirement Analysis: This phase contains detailed communication with
the customer to understand their requirements and expectations.
System Design:This phase contains the system design and the complete
hardware and communication setup for developing product.
Module Design: In this phase the system breaks down into small
modules. The detailed design of modules is specified, also known as
Low-Level Design (LLD).
Validation phase:
Unit Testing: Unit Test Plans are developed during module design phase.
These Unit Test Plans are executed to eliminate bugs at code.
Integration testing: The modules are integrated and the system is tested.
Integration testing is performed on the Architecture design phase. This test
verifies the communication of modules among themselves.
System Testing: System testing test the complete application with its
functionality, inter dependency, and communication. It tests the functional
and non-functional requirements of the developed application.
Acceptance Testing : This testing verifies that the delivered system meets
user’s requirement and system is ready for use in real world.
• Easy to Understand.
• This saves a lot of time. Hence a higher chance of success over the
waterfall model.
• Works well for small plans where requirements are easily understood.
Disadvantages (Cons) of V-Model:
• If any changes happen in the midway, then the test documents along
with the required documents, has to be updated.
Program correctness and Verification:
• The focus of software testing is to run the candidate program on
selected input data and check whether the program behaves correctly
with respect to its specification.
• The behavior of the program can be analyzed only if we know what is a
correct behavior; hence the study of correctness is an integral part of
software testing.
• The study of program correctness leads to analyze candidate
programs at arbitrary levels of granularity.
• It leads to make assumptions on the behavior of the program at
specific stages in its execution.
• The same assumptions can be checked at run-time during testing, giving
us valuable information as we try to diagnose the program or establish
its correctness.
Safety:
• software system safety optimizes system safety in the design,
development, use, and maintenance of software systems and their
integration with safety-critical hardware systems in an operational
environment.
Goals:
• In complex systems where there are many interactions involved, the
safety-critical functionality should be identified and thoroughly analyzed.
• The number of safety critical interfaces are kept low to avoid injury
or death.
What is Bug?
i. Lack of resources
ii. An invalid step
iii. Inappropriate data definition
SOFTWARE TESTING PRINCIPLES:
• Software testing is a procedure of implementing software or the
application to identify the defects or bugs.
• Even multiple testing can never ensure that software is 100% bug-free.
Testing can reduce the number of defects but not remove all defects.
3.Early Testing:
• To find the defect in the software, early test activity shall be started.
The defect detected in the early phases of SDLC will be very less
expensive.
• Testing will perform at the requirement analysis phase.
4.Defect clustering:
• The defect clustering defined that throughout the testing process, it can
detect the numbers of bugs which are correlated to a small number of
modules.
5.Pesticide paradox:
• This principle defined that if we are executing the same set of test cases
again and again over a particular time, then these kinds of the test will
not be able to find the new bugs in the software or the application.
6.Testing is context-dependent:
• But there is the chance when the application is tested beside the incorrect
requirements, identified the flaws, and fixed them on a given period
would not help as testing is done on the wrong specification, which does
not apply to the client's requirements.
Program Inspections:
• Software program inspection is a process in which other developers or
team members review the code written by a developer to identify
potential errors or areas for improvement.
• This process can help improve the overall quality of the software by
identifying and resolving faults early in the development process.
STAGES OF TESTING:
1. Unit testing
2. Integration testing
3. System testing
1.Unit testing:
• 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.
Objective of Unit Testing:
1) To isolate a section of code.
2) To verify the correctness of the code.
3) To test every function and procedure.
4) To fix bugs early in the development cycle and to save costs.
5) To help the developers to understand the code base and enable them to
make changes quickly.
6) To help with code reuse.
Unit Testing Tools:
• Nunit
• Junit
• PHPunit
• Jtest&EMMA
Unit Testing Techniques:
• Data flow Testing
• Control Flow Testing
• Branch Coverage Testing
• Statement Coverage Testing
• Decision Coverage Testing
Types:
1. Manual
2. Automated
Advantages:
• It improves design.
• Unit testing allows the developer to refactor code after a number of days
and ensure the module still working without any defect.
• Unit testing uses module approach due to that any part can be tested
without waiting for completion of another parts testing.
• Reduces Cost of Testing
Disadvantages:
• In the unit testing, evaluation of all execution paths is not possible, so
unit testing is not able to catch each and every error in a program.
• It requires more time for maintenance when the source code is changed
frequently.
• Evaluation of all execution paths is not possible, so unit testing is not
able to catch each and every error in a program.
2.Integration testing:
• It is the process of testing the interface between two software units or
modules. It focuses on determining the correctness of the interface.
• Integration testing is a software testing technique that focuses on verifying
the interactions and data exchange between different components or
modules of a software application.
Integration Testing Techniques:
• Two or more than two modules are added and tested to determine the
correctness of functions.
Top down method:
• The top-down testing strategy deals with the process in which higher
level modules are tested with lower level modules until the successful
completion of testing of all the modules.
• In this type of method, we will add the modules incrementally or one
by one and check the data flow in the same order.
Advantages:
• Design defects can be found in the early
stages.
• Separately debugged module.
Disadvantages:
• Critical Modules are tested first so that
fewer chances of defects.
• It is difficult to stub design.
Bottom-Up Method:
• The bottom to up testing strategy deals with the process in which lower
level modules are tested with higher level modules until the successful
completion of testing of all the modules.
• It will add the modules from bottom to the top and check the data flow
in the same order.
Advantages:
• Do not need to wait for the development of all the modules as it saves
time.
Disadvantages:
• There is no possibility of an early prototype.
• The complexity that occurs when the system
is made up of a large number of small
subsystems.
Non- incremental Approach:
• All the modules of the system are simply put together and tested. This
approach is applicable only for very small systems.
• The main goal of this testing is to verify the overall functionality of the
system and to identify any integration problems that arise when the
components are combined.
Advantages:
• It is convenient for small systems
• Simple and straightforward approach.
• Can be completed quickly.
Disadvantages:
• Not Good for long projects.
• This may result in a lack of confidence in the development team.
• This can lead to system failure and decreased user satisfaction.
• Time provided for testing is very less.
3.System Testing:
• It evaluates the overall functionality and performance of a complete and
fully integrated software solution.
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: It will performed to check the robustness of the system under
the varying loads.
Scalability Testing: It will 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 in system testing:
1. Jmeter
2. Selenium
3. Appium
4. LoadRunner
5. SoapUI
Advantages:
• Verifies the overall functionality of the system.
• Improves system reliability and quality.
• Enhances the overall performance of the system.
• Increases user confidence and reduces risks.
Disadvantages:
• Can be impacted by changes made during development.
• Requires specialized skills.
• May require multiple test cycles to achieve desired results.
• Can be complex and challenging.