Unit 4 Notes SW
Unit 4 Notes SW
Software Static and Dynamic analysis, Code inspections, Software Testing, Fundamentals, Software
Test Process, Testing Levels, Test Criteria, Test Case Design, Test Oracles, Test Techniques, Black- Box
Testing, White-Box Unit Testing and Unit, Testing Frameworks, Integration Testing, System Testing
and other Specialized, Testing, Test Plan, Test Metrics, Testing Tools. , Introduction to Object-
oriented analysis, design and comparison with structured Software Engg.
Automation Testing
Principles of Testing
• All the tests should meet the customer’s requirements.
• To make our software testing should be performed by a third party.
• Exhaustive testing is not possible. As we need the optimal amount of
testing based on the risk assessment of the application.
• All the tests to be conducted should be planned before implementing it
• It follows the Pareto rule(80/20 rule) which states that 80% of errors
come from 20% of program components.
• Start testing with small parts and extend it to large parts.
Software Static and Dynamic analysis
Static analysis and dynamic analysis act as a two-pronged approach to improving the development
process in terms of reliability, bug detection, efficiency, and security. But how do they differ, and
why is each important?
Finding and fixing bugs early in development pays off in many ways. It can
reduce development time, cut costs, and prevent data breaches or other
security vulnerabilities. In particular with DevOps, incorporating testing into the
SDLC early and continuously can be extremely helpful.
This is where both dynamic and static analysis testing come in. They each
serve different purposes within the SDLC while also delivering unique and
almost immediate ROIs for any development team.
This also means that each approach offers different benefits at different
stages of the development process. In order to understand these differences,
let’s review the following.
Pattern-based static analysis looks for code patterns that violate defined
coding rules. In addition to ensuring that code meets uniform expectations for
regulatory compliance or internal initiatives, it helps teams prevent defects
such as resource leaks, performance and security issues, logical errors, and
API misuse.
Flow-based static analysis involves finding and analyzing the various paths
that can be taken through the code. This can happen by control (the order in
which lines can be executed) and by data (the sequences in which a variable
or similar entity can be created, changed, used, and destroyed). These
processes can expose problems that lead to critical defects such as:
It can also detect security issues by pointing out paths that bypass security-
critical code such as code for authentication or encryption.
Dynamic analysis testing detects and reports internal failures the instant they
occur. This makes it easier for the tester to precisely correlate these failures
with test actions for incident reporting.
DAST also extends the capability of empirical testing at all levels—from unit to
acceptance. It does this by making it possible to detect internal failures that
point to otherwise unobservable external failures that occur or will occur after
testing has stopped.
As with all avenues toward DevSecOps perfection, there are pros and cons
with static analysis testing.
PROS
CONS
• Can return false positives and false negatives that might distract developers.
• Can take a long time to operate manually.
• Can’t locate bugs or vulnerabilities that come about in runtime environments.
• Deciding which industry coding standards to apply can be confusing.
• May be challenging to determine if deviating from a rule violation is
appropriate.
While the list of cons might look intimidating, the holes of static analysis can
be patched with two things.
2. Black box Testing: Black box testing looks only at the functionality of
the Application Under Test (AUT). In this testing, the testers are
unaware of the system’s underlying code. They check whether the
system is generating the expected output according to the
requirements. The Black box testing is further classified as, Functional
Testing and Non-functional Testing.
Benefits of Dynamic Testing
Below are some of the benefits of dynamic testing:
1. Reveals runtime errors: Dynamic testing helps to reveal runtime
errors, performance bottlenecks, memory leaks, and other issues that
become visible only during the execution.
2. Verifies integration of modules: Dynamic testing helps to verify the
integration of modules, databases, and APIs, ensuring that the system
is working seamlessly.
3. Accurate reliability assessment: Dynamic testing helps to provide
accurate quality and reliability assessment of the software thus
verifying that the software meets the specified requirements and
functions as intended. This helps to make sure that the software
functions correctly in different usage scenarios.
Limitations of Dynamic Testing
Below are some of the limitations of dynamic testing:
1. Time-consuming: Dynamic testing can be time-consuming in the case
of complex systems and large test suites.
2. Requires effort: It requires significant effort in complex systems to
debug and pinpoint the exact cause.
3. Challenging: In case of testing exceptional or rare conditions it can be
challenging to conduct.
4. May not cover all scenarios: Dynamic testing may not cover all
possible scenarios due to a large number of potential inputs and
execution paths.
Static Testing vs Dynamic Testing
Below are the differences between static testing and dynamic testing:
Parameters Static Testing Dynamic Testing
Test Oracle is a mechanism, different from the program itself, that can be
used to test the accuracy of a program’s output for test cases.
Conceptually, we can consider testing a process in which test cases are
given for testing and the program under test. The output of the two then
compares to determine whether the program behaves correctly for test
cases. This is shown in figure.
Decision Table
State Transition
Advantages of software testing techniques:
1. Improves software quality and reliability – By using different testing
techniques, software developers can identify and fix defects early in
the development process, reducing the risk of failure or unexpected
behaviour in the final product.
2. Enhances user experience – Techniques like usability testing can help
to identify usability issues and improve the overall user experience.
3. Increases confidence – By testing the software, developers, and
stakeholders can have confidence that the software meets the
requirements and works as intended.
4. Facilitates maintenance – By identifying and fixing defects early,
testing makes it easier to maintain and update the software.
5. Reduces costs – Finding and fixing defects early in the development
process is less expensive than fixing them later in the life cycle.
Disadvantages of software testing techniques:
1. Time-consuming – Testing can take a significant amount of time,
particularly if thorough testing is performed.
2. Resource-intensive – Testing requires specialized skills and resources,
which can be expensive.
3. Limited coverage – Testing can only reveal defects that are present in
the test cases, and defects can be missed.
4. Unpredictable results – The outcome of testing is not always
predictable, and defects can be hard to replicate and fix.
5. Delivery delays – Testing can delay the delivery of the software if
testing takes longer than expected or if significant defects are
identified.
6. Automated testing limitations – Automated testing tools may have
limitations, such as difficulty in testing certain aspects of the software,
and may require significant maintenance and updates.