Welcome to Software Testing: From Theory to Practice!

This book covers the most important testing techniques needed to build high quality software systems. Specific topics covered are quality attributes, maintainability and testability, manual and exploratory testing, automated testing, devops, test adequacy, model-based testing, state-based testing, decision tables, reviews and inspections, design-by-contract, test-driven design, unit versus integration testing, mocks and stubs.

We expect readers to be able to:

  • Create unit, integration, and system tests using current existing tools (i.e., JUnit, Mockito, and JaCoCo) that effectively test complex software systems.

  • Derive test cases that deal with exceptional, corner, and bad weather cases by performing several different techniques (i.e., boundary analysis, state-based testing, decision tables) as well as able to reflect about their limitations, when and when not to apply them in a given context.

  • Measure and reflect about the efficiency of the developed test suites by means of different test adequacy metrics (i.e., line, branch, condition, MC/DC coverage).

  • Design and implement testable software systems by means of architectural patterns such as dependency injection, and ports and adapters.

  • Write maintainable test code by avoiding well-known test code smells (e.g., Assertion Roulette, Slow or Obscure Tests).

Target audience: 1st year Computer Science students. Knowledge in programming is required. Code examples are in Java, although easy transferrable to other languages.

Authors

Maurício Aniche
Assistant Professor in Software Engineering
TU Delft
Arie van Deursen
Full Professor in Software Engineering
TU Delft

Acknowledgments

  • Annibale Panichella: chapter on mutation testing
  • Wouter Polet: Jekyll implementation and initial transcripts of the lectures.
  • TU Delft’s New Media Centre: video recording and editing

Adopting this book

Feel free to adopt this book in your software testing course. The slides we use in the background of our videos can be found in our video slides repository. We should release our accompanying lectures slides soon. If you adopt this book, please let us know; the more universities adopt it, the more reasons we have to keep updating it!

Exercises

This book contains several code examples. You can find them all in our code examples repository. Student: learn from it!

How to contribute

We accept any kind of contribution, from typo fixes, rephrasing, illustrations, videos, exercises, code examples to full chapters. Just open a Pull Request in our GitHub repository. Or, if you feel you are not ready to contribute, but want to see some content here, just open an issue.

Note that everything you create will be licensed under the license below. We will add your name in acknowledgements.

License

This book is licensed under CC-BY-NC-SA 4.0 International. You are free to share, copy, and redistribute the material in any medium or format as well as adapt, remix, transform, and build upon the material under the following terms: (1) you must give appropriate credit, (2) you may not use the material for commercial purposes, (3) if you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original, (4) you may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

For commercial use, please contact us.

Main cover picture by Agence Olloweb.