Lasse Koskela - Effective Unit Testing: A guide for Java Developers

Lasse Koskela - Effective Unit Testing: A guide for Java Developers
Lasse Koskela - Effective Unit Testing: A guide for Java Developers
5.2 MB
Effective Unit Testing: A guide for Java Developers
Год: 2013
Автор: Lasse Koskela
Издательство: Manning
ISBN: 9781935182573
Язык: Английский
Формат: PDF
Качество: Изначально компьютерное (eBook)
Интерактивное оглавление: Да
Количество страниц: 249
Описание: Effective Unit Testing is written to show how to write good tests—tests that are concise and to the point, expressive, useful, and maintainable. Inspired by Roy Osherove's bestselling The Art of Unit Testing, this book focuses on tools and practices specific to the Java world. It introduces you to emerging techniques like behavior-driven development and specification by example, and shows you how to add robust practices into your toolkit.
Test the components before you assemble them into a full application, and you'll get better software. For Java developers, there's now a decade of experience with well-crafted tests that anticipate problems, identify known and unknown dependencies in the code, and allow you to test components both in isolation and in the context of a full application.
Примеры страниц
Part 1 Foundations
Chapter 1 The promise of good tests
State of the union: writing better tests
The value of having tests
Tests as a design tool
Chapter 2 In search of good
Readable code is maintainable code
Structure helps make sense of things
It’s not good if it’s testing the wrong things
Independent tests run easily in solitude
Reliable tests are reliable
Every trade has its tools and tests are no exception
Chapter 3 Test doubles
The power of a test double
Types of test doubles
Guidelines for using test doubles
Part 2 Catalog
Chapter 4 Readability
Primitive assertions
Bitwise assertions
Incidental details
Split personality
Split logic
Magic numbers
Setup sermon
Overprotective tests
Chapter 5 Maintainability
Conditional logic
Flaky test
Crippling file path
Persistent temp files
Sleeping snail
Pixel perfection
Parameterized mess
Lack of cohesion in methods
Summary 113
Chapter 6 Trustworthiness
Commented-out tests
Misleading comments
Never-failing tests
Shallow promises
Lowered expectations
Platform prejudice
Conditional tests
Part 3 Diversions
Chapter 7 Testable design
What’s testable design?
Testability issues
Guidelines for testable design
Chapter 8 Writing tests in other JVM languages
The premise of mixing JVM languages
Writing unit tests with Groovy
Expressive power with BDD tools
Chapter 9 Speeding up test execution
Looking for a speed-up
Speeding up test code
Speeding up the build