Test-Driven Java Development, Second Edition : Invoke TDD principles for end-to-end application development, 2nd Edition.
Test-driven development relies on a test-first procedure that emphasizes writing a test before the code, and then refactoring the code to optimize it. Performing TDD with Java improves the productivity of programmers and maintainability and performance of code. It also develops a deeper understandin...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Otros Autores: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing,
2018.
|
Edición: | 2nd ed. |
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Title Page; Copyright and Credits; Packt Upsell; Contributors; Table of Contents; Preface; Chapter 1: 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; Chapter 2: Tools, Frameworks, and Environments; Git; Virtual machines; Vagrant; Docker; Build tools; The integrated development environment; The IDEA demo project.
- Unit-testing frameworksJUnit; 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; Summary; Chapter 3: 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 codeRunning 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; Implementation; Test
- occupied spot; Implementation; Refactoring; Requirement 2
- adding two-player support; Test
- X plays first; Implementation; Test
- O plays right after X; Implementation; Test
- X plays right after O; Requirement 3
- adding winning conditions; Test
- by default there's no winner; Implementation; Test
- winning condition I; Implementation.
- RefactoringTest
- winning condition II; Implementation; Test
- winning condition III; Implementation; Test
- winning condition IV; Implementation; Refactoring; Requirement 4
- tie conditions; Test
- handling a tie situation; Implementation; Refactoring; Code coverage; More exercises; Summary; Chapter 4: Unit Testing
- Focusing on What You Do and Not on What Has Been Done; Unit testing; What is unit testing?; Why unit testing?; Code refactoring; Why not use unit tests exclusively?; Unit testing with TDD; TestNG; The @Test annotation.
- The @BeforeSuite, @BeforeTest, @BeforeGroups, @AfterGroups, @AfterTest, and @AfterSuite annotationsThe @BeforeClass and @AfterClass annotations; The @BeforeMethod and @AfterMethod annotations; The @Test(enable = false) annotation argument; The @Test(expectedExceptions = SomeClass.class) annotation argument; TestNG versus JUnit summary; Remote-controlled ship requirements; Developing the remote-controlled ship; Project setup; Helper classes; Requirement
- starting point and orientation; Specification
- keeping position and direction in memory; Implementation; Refactoring.