更新时间:2021-06-24 18:32:33
coverpage
Title Page
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Why Should I Care for Test-Driven Development?
Why TDD?
Understanding TDD
Red-Green-Refactor
Speed is the key
It's not about testing
Testing
Black-box testing
White-box testing
The difference between quality checking and quality assurance
Better tests
Mocking
Executable documentation
No debugging
Summary
Tools Frameworks and Environments
Git
Virtual machines
Vagrant
Docker
Build tools
The integrated development environment
The IDEA demo project
Unit-testing frameworks
JUnit
TestNG
Hamcrest and AssertJ
Hamcrest
AssertJ
Code coverage tools
JaCoCo
Mocking frameworks
Mockito
EasyMock
Extra power for mocks
User interface testing
Web-testing frameworks
Selenium
Selenide
Behavior-driven development
JBehave
Cucumber
Red-Green-Refactor – From Failure Through Success until Perfection
Setting up the environment with Gradle and JUnit
Setting up Gradle/Java project in IntelliJ IDEA
The Red-Green-Refactor process
Writing a test
Running all the tests and confirming that the last one is failing
Writing the implementation code
Running all the tests
Refactoring
Repeating
Tic-Tac-Toe game requirements
Developing Tic-Tac-Toe
Requirement 1 – placing pieces
Test – board boundaries I
Implementation
Test – board boundaries II
Test – occupied spot
Requirement 2 – adding two-player support
Test – X plays first
Test – O plays right after X
Test – X plays right after O
Requirement 3 – adding winning conditions
Test – by default there's no winner
Test – winning condition I
Test – winning condition II
Test – winning condition III
Test – winning condition IV