The Cucumber for Java Book: Behaviour-Driven Development for Testers and Developers
Book information
Description
Teams working on the JVM can now say goodbye forever to misunderstood requirements, tedious manual acceptance tests, and out-of-date documentation. Cucumber - the popular, open-source tool that helps teams communicate more effectively with their customers - now has a Java version, and our bestsellingCucumber Bookhas been updated to match.The Cucumber for Java Bookhas the same great advice about how to deliver rock-solid applications collaboratively, but with all code completely rewritten in Java. New chapters cover features unique to the Java version of Cucumber, and reflect insights from the Cucumber team since the original book was published. Until now it's been difficult for teams developing Java applications to learn how to benefit from Behaviour-Driven Development (BDD). This book changes all that by describing in detail how to use Cucumber to harness the power of plain language specifications in your development process. In part 1, you'll discover how to use Cucumber's Gherkin DSL to describe the behavior your customers want from the system. You'll also learn how to write Java code that interprets those plain language specifications and checks them against your application. Part 2 guides you through a worked example, using Spring, MySQL, and Jetty. Enhanced chapters teach you how to use Selenium to drive your application and handle asynchronous Ajax calls, and new chapters cover Dependency Injection (DI) and advanced techniques to help keep your test suites fast. Part 3 shows you how to integrate Cucumber with your Continuous Integration (CI) system, work with a REST web service, and even use BDD with legacy applications. Written by the creator of Cucumber and two of its most experienced users and contributors,The Cucumber for Java Bookis an authoritative guide that will give you and your team all the knowledge you need to start using Cucumber with confidence. Cover......Page 1 Table of Contents......Page 8 Foreword......Page 12 Acknowledgments......Page 14 Preface......Page 16 Who This Book Is For......Page 17 How This Book Is Organized......Page 18 Running the Code Examples......Page 19 Online Resources......Page 20 Part I?Cucumber Fundamentals......Page 21 1. Why Cucumber?......Page 22 Behaviour-Driven Development......Page 23 Living Documentation......Page 25 How Cucumber Works......Page 26 What We Just Learned......Page 27 Understanding Our Goal......Page 29 Creating a Feature......Page 30 Creating Step Definitions......Page 35 Implementing Our First Step Definition......Page 37 Changing Cucumber's Output......Page 38 Testing Our Checkout Class......Page 39 Adding an Assertion......Page 41 Making It Pass......Page 43 What We Just Learned......Page 46 What's Gherkin For?......Page 48 Format and Syntax......Page 51 Feature......Page 52 Scenario......Page 53 Comments......Page 57 Spoken Languages......Page 58 What We Just Learned......Page 59 4. Step Definitions: From the Outside......Page 61 Steps and Step Definitions......Page 62 Capturing Arguments......Page 67 Multiple Captures......Page 71 Flexibility......Page 72 Returning Results......Page 74 What We Just Learned......Page 82 Background......Page 84 Data Tables......Page 87 Scenario Outline......Page 94 Too Much Information......Page 99 Doc Strings......Page 101 Staying Organized with Tags and Subfolders......Page 102 What We Just Learned......Page 105 6. Keeping Your Cucumbers Sweet......Page 106 Feeling the Pain......Page 107 Working Together......Page 110 Caring for Your Tests......Page 117 Stop the Line and Defect Prevention......Page 125 What We Just Learned......Page 127 Part II?A Worked Example......Page 129 7. Step Definitions: On the Inside......Page 130 Sketching Out the Domain Model......Page 131 Staying Honest with Transforms......Page 136 Adding Custom Helper Methods......Page 140 Organizing the Code......Page 147 Dependency Injection......Page 150 What We Just Learned......Page 151 8. Support Code......Page 153 Fixing the Bug......Page 154 Bootstrapping the User Interface......Page 161 Making the Switch......Page 163 Using Hooks......Page 168 Getting to Green......Page 172 What We Just Learned......Page 178 Our New Asynchronous Architecture......Page 180 How to Synchronize......Page 181 Implementing the New Architecture......Page 183 Fixing the Flickering Scenario......Page 190 What We Just Learned......Page 195 Iterative Database Development......Page 196 Refactoring to Use a Database......Page 199 Reading and Writing to the Database......Page 205 Cleaning the Database with Transactions......Page 210 Cleaning the Database with Truncation......Page 213 What We Just Learned......Page 215 DI and Cucumber......Page 216 Improving Our Design Using DI......Page 218 PicoContainer Is Almost Invisible......Page 224 Moving to Guice......Page 225 Spring in Your Steps......Page 229 CDI with Weld......Page 232 What We Just Learned......Page 234 Selenium WebDriver......Page 235 Handling Failure......Page 238 Reusing the Browser......Page 243 Ajax......Page 245 What We Just Learned......Page 252 Partitioning Features and Scenarios......Page 254 What Sort of Tests?......Page 257 Environment-Specific Step Definitions......Page 259 Changing Step Definitions Using Tags......Page 262 What We Just Learned......Page 265 Part III?More Techniques......Page 266 Cucumber's Runtime Options......Page 267 Overriding Cucumber Options......Page 273 Automating Cucumber......Page 274 What We Just Learned......Page 280 15. Working with a REST Web Service......Page 281 Structure Your Step Definitions......Page 282 Storing Some Fruit......Page 283 Building a Skeleton Web Server......Page 284 The Fruits of Our Labor......Page 288 What We Just Learned......Page 291 16. Working with Legacy Applications......Page 293 Characterization Tests......Page 294 Squashing Bugs......Page 296 Adding New Behavior......Page 297 Are Your Scenarios Sufficient?......Page 299 What We Just Learned......Page 300 Choosing Your JARs......Page 301 External Dependencies......Page 303 Console Colors on Windows......Page 304 A2. Cucumber and Other JVM Languages......Page 305 Groovy......Page 306 Scala......Page 310 Clojure......Page 311 A3. Bibliography......Page 314 ? B ?......Page 316 ? D ?......Page 317 ? J ?......Page 318 ? R ?......Page 319 ? T ?......Page 320 ? X ?......Page 321
Similar books
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF
Professional Linux kernel architecture ''Wrox programmer to programmer''--Cover. - ''What you are reading right now is the result of an evolution over more than seven years: After two years of writing, the first edition was published in German by Carl Hanser Verlag in 2003. It then described kernel 2.6.0. The test was used as a basis for the low-level design documentation for the EAL4+ security evaluation of Red Hat Enterprise Linux 5, requiring to update it to kernel 2.6.18 (if the EAL acronym does not mean anything to you, then Wikipedia is once more your friend). Hewlett-Packard sponsored the translation into English and has, thankfully, granted the rights to publish the result. Updates to kernel 2.6.24 were then performed specifically for this book''--P. ix
2008 · PDF