ElixirConf 2023 - Jenny Bramble - Black Box Techniques for Unit Tests

Discover powerful black box techniques to write better unit tests, including state transition testing, pairwise testing, and more, and learn how to prioritize testing for effective and efficient testing.

Key takeaways
  • Don’t try to test everything, focus on the important parts.
  • Black box techniques help you understand what testing is and how it can be applied to unit tests.
  • Use state transition testing to move through a system’s states and ensure that all states are interacted with.
  • Pairwise testing can reduce test cases without losing coverage.
  • Combinatorial testing makes it easier to test complex systems.
  • Decision tables can help you spot equivalence partitioning.
  • Boundaries are where special cases are.
  • Test everything, including invalid and valid partitions.
  • Reduce test cases by focusing on the most important parts.
  • Use tools like Hexawise and Pairwise to make testing easier.
  • Black box testing is where you don’t consider the code.
  • White box testing is where you have full knowledge of the code.
  • Gray box testing is where you have some knowledge of the code.
  • Testers should be aware of all inputs and outputs.
  • Testers should be able to fill in tables to represent their testing.
  • Test cases should be run in a specific order to ensure full coverage.
  • Testing can help you prevent errors and ensure that your system performs as expected.
  • Black box techniques can help you determine which tests are necessary and which can be removed.
  • Equivalence partitioning can help you identify and test different partitions of your system.
  • Decision tables can help you identify and test different partitions of your system.
  • Boundary value analysis can help you identify and test special cases.
  • Leave out unnecessary test cases, and focus on the most important parts.
  • Macros can help you automate testing.
  • Use tables to represent your testing.
  • Gift wrapping presents can help you understand your system.