xUnit Test Patterns: Refactoring Test CodeAutomated testing is a cornerstone of agile development. An effective testing strategy will deliver new functionality more aggressively, accelerate user feedback, and improve quality. However, for many developers, creating effective automated tests is a unique and unfamiliar challenge.
xUnit Test Patterns is the definitive guide to writing automated tests using xUnit, the most popular unit testing framework in use today. Agile coach and test automation expert Gerard Meszaros describes 68 proven patterns for making tests easier to write, understand, and maintain. He then shows you how to make them more robust and repeatable--and far more cost-effective. Loaded with information, this book feels like three books in one. The first part is a detailed tutorial on test automation that covers everything from test strategy to in-depth test coding. The second part, a catalog of 18 frequently encountered "test smells," provides trouble-shooting guidelines to help you determine the root cause of problems and the most applicable patterns. The third part contains detailed descriptions of each pattern, including refactoring instructions illustrated by extensive code samples in multiple programming languages. |
From inside the book
Results 1-5 of 58
... Indirect Inputs and Outputs? Why Do We Care about Indirect Inputs? Why Do We Care about Indirect Outputs? How Do We Control Indirect Inputs? How Do We Verify Indirect Outputs? Testing with Doubles Types of Test Doubles Providing the ...
... indirect inputs of the SUT. If there are Untested Requirements (see Production Bugs) because not all of the system's behavior is observable via its public interface, we can use a Mock Object (page 544) to intercept and verify the indirect ...
... indirect inputs ( return values , out parameters , or exceptions ) into the SUT to verify that it handles these cases correctly . In Figure 4.2 , we have reversed the order in which we build our classes . Because the subordinate classes ...
... indirect inputs or because we need to perform Behavior Verification by intercepting its indirect outputs. It may also be because parts of the application's behavior have unacceptable side effects or dependencies that are impossible to ...
... indirect inputs of the SUT. This design for testability makes our tests more repeatable and robust. Principle: Minimize Test Overlap Most applications have lots of functionality to verify. Proving that all of the functionality works ...
Contents
A Roadmap to Effective Test Automation | |
The Test Smells | |
Behavior Smells | |
Project Smells | |
Test Strategy Patterns | |
DesignforTestability Patterns | |
Value Patterns | |
Appendix A Test Refactorings | |
Whats Next? | |
Transient Fixture Management | |
Persistent Fixture Management | |
Result Verification | |
Using Test Doubles | |
Organizing Our Tests | |
Test Code Reuse | |
Appendix B xUnit Terminology | |
Tools | |
Appendix F Smells Aliases and Causes | |
Glossary | |
References | |
Index | |