Video description
Written for the working developer, it offers state-of-the-art software testing techniques. Perfect for training the next generation of effective software testers.
From the Foreword by Dr. Arie Van Deursen
Go beyond basic testing! Great software testing makes the entire development process more efficient. This book reveals a systemic and effective approach that will help you customize your testing coverage and catch bugs in tricky corner cases.
In Effective Software Testing you will learn how to:
- Engineer tests with a much higher chance of finding bugs
- Read code coverage metrics and use them to improve your test suite
- Understand when to use unit tests, integration tests, and system tests
- Use mocks and stubs to simplify your unit testing
- Think of pre-conditions, post-conditions, invariants, and contracts
- Implement property-based tests
- Utilize coding practices like dependency injection and hexagonal architecture that make your software easier to test
- Write good and maintainable test code
Effective Software Testing teaches you a systematic approach to software testing that will ensure the quality of your code. It’s full of techniques drawn from proven research in software engineering, and each chapter puts a new technique into practice. Follow the real-world use cases and detailed code samples, and you’ll soon be engineering tests that find bugs in edge cases and parts of code you’d never think of testing! Along the way, you’ll develop an intuition for testing that can save years of learning by trial and error.
about the technology
Effective testing ensures that you’ll deliver quality software. For software engineers, testing is a key part of the development process. Mastering specification-based testing, boundary testing, structural testing, and other core strategies is essential to writing good tests and catching bugs before they hit production.
about the book
Effective Software Testing is a hands-on guide to creating bug-free software. Written for developers, it guides you through all the different types of testing, from single units up to entire components. You’ll also learn how to engineer code that facilitates testing and how to write easy-to-maintain test code. Offering a thorough, systematic approach, this book includes annotated source code samples, realistic scenarios, and reasoned explanations.
about the audience
The Java-based examples illustrate concepts you can use for any object-oriented language.
about the author
Dr. Maurício Aniche is the Tech Academy Lead at Adyen and an Assistant Professor in Software Engineering at the Delft University of Technology.
The combination of theory and practice shows the depth of Maurício’s experience as an academic and as a working programmer!
From the Foreword by Steve Freeman
Whether you’re a developer, tester, or student, you’ll find this text an essential part of your work.
James McKean Wood, Trimble PPM
The first book I’ve read where I finally understood how to write a good unit test, and how to pair it with testable code.
James Liu, Mediaocean
NARRATED BY ADAM NEWMARK
Table of Contents
Chapter 1. Effective and systematic software testing
Chapter 1. Developers who test vs. developers who do not
Chapter 1. Effective software testing for developers
Chapter 1. The myth of “correctness by design”
Chapter 1. Principles of software testing (or, why testing is so difficult)
Chapter 1. The testing pyramid, and where we should focus
Chapter 1. System testing
Chapter 1. What if you disagree with the testing pyramid?
Chapter 1. Exercises
Chapter 2. Specification-based testing
Chapter 2. Step 1: Understanding the requirements, inputs, and outputs
Chapter 2. Step 4: Analyze the boundaries
Chapter 2. Step 5: Devise test cases
Chapter 2. Step 7: Augment the test suite with creativity and experience
Chapter 2. Finding bugs with specification testing Part 1
Chapter 2. Finding bugs with specification testing Part 2
Chapter 2. Use variations of the same input to facilitate understanding
Chapter 2. Exercises
Chapter 3. Structural testing and code coverage
Chapter 3. Code coverage criteria
Chapter 3. Creating a test suite that achieves MC/DC
Chapter 3. Criteria subsumption, and choosing a criterion
Chapter 3. Boundary testing and structural testing
Chapter 3. What does it mean to achieve 100% coverage?
Chapter 3. What should not be covered?
Chapter 3. Exercises
Chapter 4. Designing contracts
Chapter 4. Invariants
Chapter 4. Inheritance and contracts
Chapter 4. Design-by-contract in the real world
Chapter 4. Exception or soft return values?
Chapter 5. Property-based testing
Chapter 5. Example 1: The passing grade program
Chapter 5. Example 3: Testing the indexOf method
Chapter 5. Example 4: Testing the Basket class
Chapter 5. Property-based testing in the real world
Chapter 6. Test doubles and mocks
Chapter 6. An introduction to mocking frameworks
Chapter 6. Mocks and expectations
Chapter 6. Simulating exceptions
Chapter 6. What to mock and what not to mock
Chapter 6. Date and time wrappers
Chapter 6. What do others say about mocking?
Chapter 7. Designing for testability
Chapter 7. Separating infrastructure code from domain code
Chapter 7. Dependency injection and controllability
Chapter 7. Making your classes and methods observable
Chapter 7. Dependency via class constructor or value via method parameter?
Chapter 7. The cohesion of the class under test
Chapter 7. The Hexagonal Architecture and mocks as a design technique
Chapter 8. Test-driven development
Chapter 8. Our first TDD session
Chapter 8. Reflecting on our first TDD experience
Chapter 8. What does the research say about TDD?
Chapter 8. Exercises
Chapter 9. Writing larger tests
Chapter 9. Testing larger components
Chapter 9. Testing larger components that go beyond our code base
Chapter 9. Database and SQL testing
Chapter 9. Writing automated tests for SQL queries
Chapter 9. Setting up infrastructure for SQL tests
Chapter 9. System tests
Chapter 9. Designing page objects Part 1
Chapter 9. Designing page objects Part 2
Chapter 9. Patterns and best practices
Chapter 9. Final notes on larger tests
Chapter 10. Test code quality
Chapter 10. Tests should break if the behavior changes
Chapter 10. Test smells
Chapter 10. Sensitive assertions
Chapter 11. Wrapping up the book