7 Integration testing

 

This chapter covers

  • Understanding the differences between unit testing and integration testing
  • Using integration testing effectively
  • Comparing Rust’s built-in integration testing to external testing
  • Exploring libraries and tools for integration testing
  • Fuzzing your tests

In chapter 6, we discussed unit testing in Rust. In this chapter, we’ll discuss how to use integration testing in Rust, and how it compares to unit testing. Both unit testing and integration testing are powerful strategies to improve the quality of your software. They are often used together with slightly different goals.

Integration testing can sometimes be a little more difficult because it may require more work to create harnesses and test cases, depending on the type of software being tested. It’s more common to find unit tests than integration tests, but Rust provides the basic tools you need to write effective integration tests without spending too much time on boilerplate and harnesses. We’ll also explore some libraries that can help turbocharge your integration testing without requiring much additional work.

7.1 Comparing integration and unit testing

7.2 Integration testing strategies

7.3 Built-in integration testing vs. external integration testing

7.4 Integration testing libraries and tooling

7.4.1 Using assert_cmd to test CLI applications

7.4.2 Using proptest with integration tests

7.4.3 Other integration testing tools

7.5 Fuzz testing

Summary

sitemap