Dynamic Testing
Soad alwerfaly
Introduction :
• Definition: Dynamic testing is a type of software testing
that involves executing the code and validating the output
against expected results.
• Difference from Static Testing :
- Static Testing evaluates the code without executing it (e.g.,
code reviews, inspections).
- Dynamic Testing requires the code to be executed to
identify runtime issues.
Importance of Dynamic Testing
• Detects Actual Errors: Tests the software in a real-world
scenario, detecting bugs that static testing may miss.
• Improves Performance: Helps identify performance issues
like memory leaks, and response times, ensuring software
behaves as expected under different conditions.
What is Dynamic Testing?
• Dynamic testing refers to analyzing code’s dynamic
behavior in the software. In this type of testing, you have to
give input and get output as per the expectation through
executing a test case.
• The main purpose of dynamic testing is to validate the
software and ensure it works properly without any faults
after the installation. In a snapshot, you can say that
dynamic testing assures the overall functionality and
performance of the application. Also, it should be stable
and consistent.
Types of Dynamic Testing
1. Unit Testing : Tests individual components for correctness.
2. Integration Testing : Tests combined components to ensure
they work together.
3. System Testing : Tests the complete and integrated
software to verify it meets requirements.
4. Acceptance Testing : Validates the software against
business requirements, usually performed by end-users.
Dynamic Testing Methods
• Manual Testing : Testers execute test cases manually
without automation tools. Ideal for exploratory testing
where direct human observation is necessary.
• Automated Testing : Utilizing tools (e.g., Selenium, JUnit) to
run tests automatically. Efficient for regression testing and
repetitive tasks.
Unit Testing
• Definition : Focuses on individual components (functions,
methods) to ensure they work correctly.
• Purpose : Quickly identifies bugs before integration.
• Example : - Testing a method that calculates the sum of two
numbers:
python
def add(a, b):
return a + b
assert add(2, 3) == 5
assert add(-1, 1) == 0
Integration Testing
• Definition : Tests the interaction between integrated
components/modules.
• How to Perform :
- Choose modules to integrate and test combinations.
- Example:
- Testing a user login where the authentication module
interacts with the user database:
python
assert login("user", "password") == True
System Testing
• Definition : Comprehensive testing of the entire system against the
specified requirements.
• Stages :
- Functional Testing
- Performance Testing
- Security Testing
• Example:
Running an end-to-end scenario through the application:
- Register a user
- Log in
- Make a purchase
Acceptance Testing
• Definition : A validation process to determine if the
software meets business requirements.
• Types :
- User Acceptance Testing (UAT)
- Operational Acceptance Testing
• Example :
- A client testing the application to ensure it meets their
specifications before final acceptance:
- Scenario : Verify that all required fields in a form are
validated.
Tools for Dynamic Testing
• Manual Tools:
- JIRA for issue tracking
• Automated Tools :
- Selenium for web applications
- JUnit for Java applications
- TestNG for integrated testing
Benefits of Dynamic Testing
• Enhances Software Quality : Provides clear insights into
defects and inconsistencies.
• Reduces Time and Effort : Identifying bugs earlier in the
development process saves cost and effort in later stages.
Challenges of Dynamic Testing
• Cost Implications : Automation tools require investment and
training.
• Complexity : Creating comprehensive test scripts for large
codebases can be challenging.
Steps to Implement Dynamic Testing
1. Set Up the Test Environment : Prepare hardware and
software configurations.
2. Develop Test Cases : Based on requirements and user
scenarios.
3. Execute Tests : Run manual or automated tests and log
results.
Planning for Dynamic Testing
• Test Strategy Development : Outline the testing approach
and resource needs.
• Resource Allocation : Determine team roles,
responsibilities, and necessary tools.
Metrics for Dynamic Testing
• Defect Density : Number of defects found per size of the
software (e.g., per 1000 lines of code).
• Test Coverage : The percentage of the codebase tested by
dynamic tests.
Dynamic Testing in Agile Testing
• Role in Agile : Ensure frequent testing during iterations to find
issues quickly.
• Continuous Testing Practices : Integrating automated testing in
Continuous Integration/ Continuous Delivery pipelines to ensure
rapid feedback.
Real-World Example of Dynamic Testing
• E-Commerce Application:
- Scenario : User registration and places an order.
- Tests Performed : Validate the registration process, login,
product search, and checkout.
Steps to Create a Test Case Comparison
Table
[Link] Test Cases : Identify the functionality to be tested and define
specific test cases based on requirements.
[Link] the Table Structure : Set up a table with headings that
typically include:
- Test Case ID : Unique identifier for each test case.
- Description : Brief description of what the test case is intended to
verify.
- Expected Result : The anticipated outcome if the system operates
correctly.
- Actual Result : The outcome observed when the test case is
executed.
- Status : Indicates whether the test passed or failed.
- Comments : Additional notes or observations related to the test case.
Fill in the Table
Test Case Description Expected Actual Status Comments
ID Result Result
TC001 Login with Successful Successful Passed None
valid login page login page
credentials
TC002 Login with Error Error Passed UI message
invalid message message clear
password shown shown
TC003 Access Access Access Failed Security bug
restricted area denied granted found