更新时间:2021-07-08 10:45:13
封面
版权页
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Hello TDD!
What is TDD?
Why TDD?
Changing our approach to problem solving
Brief introduction to Scala and SBT
Hello World!
Summary
Chapter 2. First Test-Driven Application
Testing frameworks
ScalaTest
Problem statements
IDE
Project structure
Write a failing test – RED
Writing application code to fix the test – GREEN
More tests – REPEAT
Intercepting exceptions
Chapter 3. Clean Code Using ScalaTest
Assertions
Some more Matchers
Matchers
Base test classes
Test fixtures
Problem statement
Chapter 4. Refactor Mercilessly
Clean code
Red-Green-Refactor
Code smell
To refactor or not to refactor
Refactoring techniques
Chapter 5. Another Level of Testing
Integration testing
Behavior-driven development
Talk is cheap
Chapter 6. Mock Objects and Stubs
History
Coupling
Stubs
Mock objects
Fakes
Spy
Mocking frameworks
Mockito
ScalaMock
Chapter 7. Property-Based Testing
Introduction to property-based testing
Generator-driven properties
ScalaCheck
Chapter 8. Scala TDD with Specs2
Introduction to Specs2
Differences between Specs2 and ScalaTest
Setting up Specs2
Styles
Acceptance specification
Specs2 data tables
Running Specs2 tests
Chapter 9. Miscellaneous and Emerging Trends in Scala TDD
Scala Futures and Promises
The Inside trait
The OptionValue trait
The EitherValue trait
Eventually
Consumer-Driven Contracts