5.4. Types of Tests

Testing is an integral part of any development process. That said, there are different kinds of tests, and each has its own distinct place in the development cycle. It is important to separate your testing into discrete segments, according to what you are trying to test and how you are trying to test it.

All tests are written to test some piece of code. That code may stand completely on its own, or it may have dependencies on other code, external systems, or resources of various kinds. Pieces of code with differing levels of dependency require different levels of testing, possibly with different tools.

Mixing different kinds of tests can cause confusion and consternation among developers, QA engineers, and potentially management as well. Different kinds of tests are meant to test different things, and to be written and defined by different people.

When writing any tests, you need to decide ahead of time what your intentions are. There are a number of questions to ask yourself, including:

  • Are you writing stand-alone tests meant to prove the correctness of an algorithm?

  • Are you writing tests to prove that two components are working together properly?

  • Are you validating behavior that will be experienced by end users?

These situations demand different testing strategies and may require the use of different tools to achieve the results you want.

Here are some other questions to consider:

  • Do you need to include performance testing for your application?

  • When and how ...

Get Code Leader: Using People, Tools, and Processes to Build Successful Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.