Introduction

To ensure the quality and correctness of your code, you should have automated software tests. Django provides tools for you to write test suites for your website. Test suites automatically check your website and its components to ensure that everything is working correctly. When you modify your code, you can run the tests to check whether your changes affected the application's behavior negatively.

The world of automated software testing has a wide range of divisions and terminologies. For the sake of this book, we will divide testing into the following categories:

  • Unit testing refers to tests that are strictly targeted at individual pieces, or units, of code. Most commonly, a unit corresponds to a single file or module, and unit tests do their best to validate that the logic and behaviors are as expected.
  • Integration testing goes one step further, dealing with the way that two or more units work with one another. Such tests do not get as granular as unit tests, and they are generally written under the assumption that all unit tests have passed by the time an integration is validated. Hence, integration tests only cover the set of behaviors that must be true for the units to work properly with one another.
  • Component interface testing is a higher-order form of integration testing, in which a single component is verified from end to end. Such tests are written in a way that is ignorant of the underlying logic used to provide the behaviors of the component, so that logic can change without modifying the behavior, and the tests will still pass.
  • System testing verifies the end-to-end integration of all components that make up a system, often corresponding to complete user flows.
  • Operational acceptance testing checks that all of the non-functional aspects of a system operate correctly. Acceptance tests check the business logic to find out whether the project works the way it is supposed to, from an end user's point of view.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.246.203