Fundamentals of Testing

What is Testing?

Testing is a systematic and dynamic process aimed at evaluating and verifying that a software application or system behaves as expected. It involves the execution of software or a system component to assess one or more properties of interest.

Example:
Consider a banking application. Testing this application involves verifying that account transactions are accurately processed, user authentication works as intended, and that the application handles various scenarios such as withdrawals, deposits, and transfers correctly.

Typical Objectives of Testing

Objectives:

  • Ensuring the software meets specified requirements.
  • Identifying defects and ensuring they are corrected.
  • Validating functionality to meet user expectations.
  • Assessing reliability and performance under various conditions.

Example:
In an e-commerce website, one typical objective is to ensure that the checkout process works smoothly, from adding items to the cart to completing the payment. Testing aims to identify any issues in this process, such as incorrect calculations or failed transactions.

Testing and Debugging

Testing and debugging are complementary processes. Testing identifies defects, and debugging involves the process of finding, analyzing, and fixing these defects.

Example:
If testing reveals that the login functionality of a web application is not working as expected, the debugging process involves analyzing the code to find the source of the issue, fixing it, and then retesting to ensure the problem is resolved.

Why is Testing Necessary?

Testing’s Contributions to Success
  • Early detection and correction of defects.
  • Enhanced software quality.
  • Increased user satisfaction.
  • Reduced risk of failures in the production environment.

Example:
Identifying a critical security flaw in an online banking system during testing prevents potential financial loss for users. Fixing this issue before deployment contributes to the success of the software.

Quality Assurance and Testing

Quality assurance involves activities that ensure processes are suitable and implemented correctly. Testing is a critical component of quality assurance, providing objective evaluations to ensure the software meets specified requirements

Example:
In a healthcare software project, quality assurance may involve ensuring that the testing process adheres to industry standards and regulations to guarantee the accuracy and reliability of patient data.

Errors, Defects, and Failures

  • Errors: Mistakes made by developers.
  • Defects (Bugs): Flaws or issues in the software.
  • Failures: Inability of the software to perform its intended functions.

Example:
If a developer mistakenly writes code that results in the application not processing customer orders correctly (error), it manifests as a defect. If this defect leads to customers being unable to complete purchases, it causes a failure.

Defects, Root Causes, and Effects

  • Defects: Identified issues in the software.
  • Root Causes: Underlying reasons for defects.
  • Effects: Impact of defects on software functionality.

Example:
A defect in a healthcare software application causes incorrect patient information to be displayed. The root cause might be a miscalculation algorithm. The effect is potential misdiagnosis due to incorrect patient data.

Seven Testing Principles

1. Exhaustive testing is impossible.

  • Explanation: It is practically impossible to test every possible combination of inputs, paths, and scenarios for a software application due to the infinite number of possibilities.
  • Example: Consider a web application with multiple user roles, various browsers, and different operating systems. Exhaustively testing all combinations of these factors is not feasible. Instead, testing focuses on critical scenarios and high-risk areas.

2. Early testing is beneficial.

  • Explanation: Testing activities should start as early as possible in the software development life cycle to identify and rectify defects at their inception, reducing the cost of fixing issues later in the process.
  • Example: In an Agile development environment, testing begins during the requirements gathering phase. Testers collaborate with stakeholders to create test scenarios, ensuring that potential issues are identified and addressed before coding starts.

3. Defect clustering.

  • Explanation: Defects tend to cluster or concentrate in specific modules or components of the software. Understanding this principle helps testers focus on critical areas.
  • Example: In a large e-commerce application, statistics show that a majority of defects are found in the checkout process. Testers, knowing this, allocate more testing resources to thoroughly validate the functionality related to the checkout process.

4. Pesticide paradox.

  • Explanation: Repeating the same set of tests will not be sufficient to identify all defects. Over time, as the software evolves, the test suite needs to be modified and extended to find new defects.
  • Example: If a test suite only focuses on positive test cases, it may miss negative scenarios. Testers periodically review and update test cases to ensure they remain effective in finding defects, preventing the “pesticide paradox.”

5. Testing is context-dependent.

  • Explanation: Testing approaches and strategies vary based on the context of the project, including the software’s purpose, development methodology, and specific requirements.
  • Example: Testing a safety-critical medical device requires a different approach than testing a mobile gaming app. The context dictates the testing priorities, techniques, and criteria.

6. Absence-of-errors fallacy.

  • Explanation: Finding and fixing defects does not guarantee a defect-free software product. The absence of detected errors does not imply the absence of defects.
  • Example: A software application might pass all test cases and seem error-free, but users may still encounter issues in real-world scenarios. Continuous testing and monitoring are necessary even after the software is deemed error-free in testing.

7. Test activities should be planned, monitored, and controlled.

  • Explanation: Testing should be approached systematically with well-defined plans, effective monitoring, and control mechanisms to ensure the testing process remains on track.
  • Example: A comprehensive test plan outlines the testing strategy, scope, resources, and schedule. Monitoring involves tracking progress against the plan, and control mechanisms are in place to address deviations and ensure the testing activities align with project goals.

Adhering to these testing principles contributes to a more effective and efficient testing process, improving the overall quality of the software being developed. Each principle addresses specific challenges and considerations that testers encounter during the testing life cycle.

Test Process

Test Process in Context

Contextual Nature:
The test process is influenced by the software development lifecycle model used (e.g., waterfall, agile). It involves iterative planning, execution, and evaluation.

Example:
In a waterfall model, testing occurs after the development phase is complete. In contrast, in an agile model, testing is an ongoing process integrated with development sprints.

Test Activities and Tasks

Activities:

  • Test planning.
  • Test design.
  • Test execution.
  • Evaluation of exit criteria.

Example:
During test planning, tasks include defining the scope of testing, identifying test resources, and establishing testing schedules based on project timelines.

Test Work Products

Tangible Outcomes:
  • Test plans.
  • Test cases.
  • Test scripts.

Example:
A test plan outlines the testing approach, schedule, and resource requirements. Test cases detail the conditions, inputs, and expected outcomes for specific scenarios.

Traceability between the Test Basis and Test Work Products

Importance:
Ensures a clear connection between requirements (test basis) and test work products. Facilitates impact analysis and comprehensive test coverage.

Example:
If a requirement specifies that a login page should validate user credentials, the traceability matrix ensures that corresponding test cases cover this functionality.

The Psychology of Testing

Human Psychology and Testing

Influence:
Understanding how individuals perceive and interpret testing tasks influences collaboration, communication, and decision-making within the testing team.

Example:
A tester may approach exploratory testing differently based on their understanding of user behaviour, focusing on areas where users are likely to encounter issues.

Tester’s and Developer’s Mindsets

Different Perspectives:
Testers focus on validation, defect identification, and ensuring requirements are met. Developers focus on coding, debugging, and ensuring the functionality works as intended.

Example:
A tester might prioritize edge cases and boundary scenarios during testing, while a developer may focus on optimizing code for performance.

Summary
participants gain a thorough understanding of testing fundamentals, including its definition, objectives, relationship with debugging, and its crucial role in contributing to project success. The module also explores principles, the testing process, and the psychological aspects influencing testing activities. This foundational knowledge sets the stage for more advanced testing concepts in subsequent modules.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top