Testing

Introduction to Testing

  • Testing is a critical phase in the development of programs to ensure that they function as expected. It involves checking each part of the program individually and collectively.
  • Correctly functioning programs should not only produce the correct output, but also handle errors gracefully. An error may occur due to incorrect user input, system issues or logical errors in the code.

The Purpose of Testing

  • Debugging: Testing helps to identify any errors or bugs in the code so they can be fixed.
  • Verification: Verification is used to confirm that the product is meeting the specified requirements.
  • Validation: Validation is carried out to check whether the system fulfils the user’s requirements.

Types of Testing

  • Unit Testing: Involves testing individual units of a program (such as functions or methods) in isolation. This helps pinpoint specific problematic areas in your code.
  • Integration Testing: This type of testing checks that different modules or services work together as expected.
  • System Testing: Ensures that the system works as a whole and meets all identified system requirements.
  • User Acceptance Testing (UAT): This is the final phase of testing, where the users test the system to ensure it meets their needs and requirements.

Test Cases

  • Test cases are specific conditions or variables that a tester will use to evaluate the functionality and performance of software. They are used to ensure that all various routes of code execution are tested and working correctly.
  • Test cases should involve normal, boundary and erroneous data. Normal data is what the program expects to receive, boundary data tests the limits of the program and erroneous data is input that the program should not accept.

Debugging

  • Debugging is the process of identifying and correcting errors or bugs in a program.
  • Debugging steps include identifying the error, isolating the source of the error, correcting the error, and then testing the correction to ensure the program functions as expected.

Test Plan

  • A Test Plan is a detailed document that outlines the test strategy, objectives, resources, estimate of time and schedule of activities related to testing.
  • It is a critical component of good software development and includes various elements such as test coverage, techniques of testing, resources available for testing and so on.

Review of Code

  • Reviewing code is a practice where other developers examine the code for errors, readability, and efficiency. This extra set of eyes can often catch problems that the original developer missed.
  • Code reviews help maintain an understandable and maintainable codebase, and they also promote a team understanding of the code, which comes in handy if the original developer becomes unavailable.