Cargando…

Testing with JUnit : master high-quality software development driven by unit tests /

Master high quality software development driven by unit tests About This Book Design and implement robust system components by means of the de facto unit testing standard in Java Reduce defect rate and maintenance effort, plus simultaneously increase code quality and development pace Follow a step-b...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Appel, Frank (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, UK : Packt Publishing, 2015.
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo (Requiere registro previo con correo institucional)
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started; Why you should busy yourself with unit tests; Reducing the defect rate; Improving the code quality; Increasing the development pace; Enhancing the specification density; Boosting confidence and courage; Setting the table; Choosing the ingredients; Organizing your code; Serving the starter; Introducing the example app; Understanding the nature of a unit test; Writing the first test; Evaluating test results; Writing tests first; Summary.
  • Chapter 2: Writing Well-structured TestsThe four phases of a unit test; Using a common test structure; Setting up the fixture; What goes up must come down; Verification; Choosing the next functionality to test; Start with the happy path; Conclude with corner cases; After the war; Getting the test names right; Test prefix; Behavior expressing patterns; Reducing names to the essentials; Summary; Chapter 3: Developing Independently Testable Units; Decomposing requirements; Separating concerns; Component dependencies; Understanding isolation; Delegating responsibilities to DOCs.
  • Indirect input and outputUnit isolation with test doubles; Working with test doubles; Placeholder dummies; Fake it till you make it; Providing indirect input with stubs; Recording interactions with spies; Verifying behavior with mocks; Increasing efficiency with mock frameworks; The promised land?; Basic stubbing; Indirect output verification; Using test helpers; Motivation; The test helper class; The test helper object; Summary; Chapter 4: Testing Exceptional Flow; Testing patterns; Using the fail statement; Annotated expectations; Verification with the ExpectedException rule.
  • Capturing exceptions with closuresTreating collaborators; Fail fast; The stubbing of exceptional behavior; Summary; Chapter 5: Using Runners for Particular Testing Purposes; Understanding the architecture; What are runners good for?; Looking at the big picture; Writing your own extension; Using custom runners; Furnishing a suite with test cases; Structuring suites into categories; Populating suites automatically; How about creating test doubles with annotations?; Writing dataset tests; Using parameterized tests; Reduce glue code with JUnitParams.
  • Increase the expressiveness of test descriptions with BurstSummary; Chapter 6: Reducing Boilerplate with JUnit Rules; Understanding rules; What are JUnit rules?; Writing your own rule; Configuring the fixture with annotations; Working with advanced concepts; Using ClassRules; The Ordering of rule execution; Employing custom solutions; Working with system settings; Ignoring tests conditionally; Summary; Chapter 7: Improving Readability with Custom Assertions; Working with the JUnit built-in assert approach; Understanding the basics; Reviewing the file session storage.