Books: 24

Unit Testing

Building Quality into Software
To build high-quality software, you need to write testable code. That's harder than it seems: it requires insights drawn from arenas ranging from software craftsmanship to unit testing, refactoring to test-driven development. Most programming books either discuss testing only briefly, or drill down on more » just one or two techniques, with little guidance on how to systematically verify code. Most testing books, on the other hand, focus on a specific testing process, without showing how to write software that can be easily and systematically tested. In Developer Testing, leading software engineering consultant Alexander Tarnowski strikes an optimal balance, integrating insights from multiple disciplines to help frustrated practitioners get better results. Drawing on his extensive experience as a mentor and trainer, he offers insights that help you accelerate through the typical software assurance learning curve, so you can progress far more rapidly. Tarnowski organizes his insights into "chunks" to help you quickly absorb key concepts, and focuses on technology-agnostic approaches you can keep using with any new language, platform, or toolset. Along the way, he answers many questions development teams often ask about testing, including: * What makes code testable? What makes it hard to test? * When have I done enough testing on a piece of code? * How many unit tests do I need to write? * Exactly what should my test verify? * How do I transform monolithic legacy code into manageable pieces I can test? * What's the best way to structure my tests? The first guide to cover testing mindset, techniques, and applications from the developer's perspective, Developer Testing will help developers get what they really want: better code. « less
Take Python beyond scripting to build robust, reusable, and efficient applications
KEY FEATURES * Get to grips with Python techniques that address commonly encountered problems in general application development. * Develop, package, and deploy efficient applications in a fun way. * All-practical coverage of the major areas of application development, including best practices, exception more » handling, testing, refactoring, design patterns, performance, and GUI application development. BOOK DESCRIPTION Python is one of the most widely used dynamic programming languages, supported by a rich set of libraries and frameworks that enable rapid development. But fast paced development often comes with its own baggage that could bring down the quality, performance, and extensibility of an application. This book will show you ways to handle such problems and write better Python applications. From the basics of simple command-line applications, develop your skills all the way to designing efficient and advanced Python apps. Guided by a light-hearted fantasy learning theme, overcome the real-world problems of complex Python development with practical solutions. Beginning with a focus on robustness, packaging, and releasing application code, you'll move on to focus on improving application lifetime by making code extensible, reusable, and readable. Get to grips with Python refactoring, design patterns and best practices. Techniques to identify the bottlenecks and improve performance are covered in a series of chapters devoted to performance, before closing with a look at developing Python GUIs. WHAT YOU WILL LEARN * Build a robust application by handling exceptions. * Modularize, package, and release the source distribution. * Document the code and implement coding standards. * Create automated tests to catch bugs in the early development stage. * Identify and re-factor badly written code to improve application life. * Detect recurring problems in the code and apply design patterns. * Improve code efficiency by identifying performance bottlenecks and fixing them. * Develop simple GUI applications using Python. ABOUT THE AUTHOR Ninad Sathaye has spent several years of his professional career designing and developing performance-critical engineering applications written in a variety of languages, including Python and C++. He has worked as a software architect in the semiconductor industry, and more recently in the domain of Internet of Things. He holds a master's degree in mechanical engineering. TABLE OF CONTENTS 1. Developing Simple Applications 2. Dealing with Exceptions 3. Modularize, Package, Deploy! 4. Documentation and Best Practices 5. Unit Testing and Refactoring 6. Design Patterns 7. Performance – Identifying Bottlenecks 8. Improving Performance – Part One 9. Improving Performance – Part Two, NumPy and Parallelization 10. Simple GUI Applications « less
Learn how to use the power of Xcode to turn your next great app idea into a reality
ABOUT THIS BOOK * Learn the theory and tools behind app development using Swift 3 and Xcode 8 * Build a fully featured iOS app, including a companion app for the Apple Watch * Optimize, debug, and ultimately release your app on Test Flight and the App Store WHO THIS BOOK IS FOR This book is intended more » for programmers looking to get a jump-start into the world of iOS development. Whether you're a young student who has only spent a few months with Java, or a seasoned developer who has spent their career developing for a different platform, all that is expected is a basic understanding of a programming language such as C++, C#, or Java. WHAT YOU WILL LEARN * Understand the most important features of the Xcode IDE * Write Swift 3 code for application data models and view controllers * Prepare visual layouts for an iOS application using storyboards, size classes, and auto-layout * Integrate many common technologies into an app, such as multi-touch gestures, CoreData, and notifications * Build companion applications for the Apple Watch with watchOS 3 * Debug applications using Xcode's suite of debugging tools, and prevent bugs with unit testing * Optimize an application using Xcode 8's profiling tools and asset catalogs * Distribute a beta application through TestFlight, and a finished application through the App Store IN DETAIL Over the last few years, we've seen a breakthrough in mobile computing and the birth of world-changing mobile apps. With a reputation as one of the most user-centric and developer-friendly platforms, iOS is the best place to launch your next great app idea. As the official tool to create iOS applications, Xcode is chock full of features aimed at making a developer's job easier, faster, and more fun. This book will take you from complete novice to a published app developer, and covers every step in between. You'll learn the basics of iOS application development by taking a guided tour through the Xcode software and Swift programming language, before putting that knowledge to use by building your first app called “Snippets.” Over the course of the book, you will continue to explore the many facets of iOS development in Xcode by adding new features to your app, integrating gestures and sensors, and even creating an Apple Watch companion app. You'll also learn how to use the debugging tools, write unit tests, and optimize and distribute your app. By the time you make it to the end of this book, you will have successfully built and published your first iOS application. STYLE AND APPROACH This easy-to-follow guide presents topics in a hands-on lecture format where concepts are introduced and explained, then used in an example as reinforcement. The first third of the book covers the separate building blocks of development, while the second two thirds cover the development of an app from start to finish. « less
Write testable and maintainable code to develop highly-functional iOS apps
Key Features Learn test-driven principles to help you build apps with fewer bugs and better designs Become more efficient while working with Swift to move on to your next project faster! Implement all of the principles of test-driven development (TDD) in to your daily programming workflow Book Description more » Test-driven development (TDD) is a proven way to find software bugs early. Writing tests before your code improves the structure and maintainability of your apps. In combination with the improved syntax of Swift 3, there is no excuse or writing bad code. This book will help you understand the process of TDD and how it impacts your apps written in Swift. Through a practical, real-world example app, you’ll start seeing how to implement TDD in context. You will begin with an overview of the TDD workflow and then deep dive into unit testing concepts and code cycles. You will also plan and structure your test driven iOS app, and write tests to drive the development of the view controllers and the helper classes. Next, you’ll learn how to write tests for network code, what CI is and how to set it up using Xcode Server. Finally, the book will guide you through the next steps to become a testing expert by discussing integration tests, Behavior Driven Development (BDD), open source testing frameworks and UI Tests introduced in Xcode 8. What you will learn - Implement TDD in Swift application development - Find bugs before you enter the code using the TDD approach - Use TDD to build models, view controllers, and views - Test network code with asynchronous tests and stubs - Write code that is a joy to read and to maintain - Develop functional tests to ensure the app works as planned - Employ continuous integration to make testing and deployment easier About the Author Dr. Dominik Hauser completed his Ph.D. from the University of Heidelberg in Physics. While working as a university professor, he started iOS development in his spare time. « less
The Pragmatic Programmers classic is back! Freshly updated for modern software development, Pragmatic Unit Testing in Java 8 With JUnit teaches you how to write and run easily maintained unit tests in JUnit with confidence. You'll learn mnemonics to help you know what tests to write, how to remember more » all the boundary conditions, and what the qualities of a good test are. You'll see how unit tests can pay off by allowing you to keep your system code clean, and you'll learn how to handle the stuff that seems too tough to test. Pragmatic Unit Testing in Java 8 With JUnit steps you through all the important unit testing topics. If you've never written a unit test, you'll see screen shots from Eclipse, IntelliJ IDEA, and NetBeans that will help you get past the hard part--getting set up and started. Once past the basics, you'll learn why you want to write unit tests and how to effectively use JUnit. But the meaty part of the book is its collected unit testing wisdom from people who've been there, done that on production systems for at least 15 years: veteran author and developer Jeff Langr, building on the wisdom of Pragmatic Programmers Andy Hunt and Dave Thomas. « less
Behaviour-Driven Development for Testers and Developers
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 bestselling more » Cucumber Book has been updated to match. The Cucumber for Java Book has 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 Book is an authoritative guide that will give you and your team all the knowledge you need to start using Cucumber with confidence. « less
A practical guide to get you up and running with unit testing using Mockito
ABOUT THIS BOOK * Explore Mockito features and learn stubbing, mocking and spying dependencies using the Mockito framework * Mock external dependencies for legacy and greenfield projects and create an automated JUnit safety net for building reliable, maintainable and testable software * A focused more » guide filled with examples and supporting illustrations on testing your software using Mockito WHO THIS BOOK IS FOR This book is ideal for developers who have some experience in Java application development as well as some basic knowledge of test doubles and JUnit testing. This book also introduces you to the fundamentals of JUnit testing, test doubles, refactoring legacy code, and writing JUnit tests for GWT and web services. WHAT YOU WILL LEARN * Explore test doubles and work with dummy, spy, fake, stub, and mock objects * Uncover the Mockito architecture and build a custom mocking framework * Mock, stub, and spy external code dependencies using Mockito * Practice Behavior-driven Development (BDD) with Mockito * Make legacy code testable by mocking and spying dependencies * Mock GWT and web service dependencies using Mockito * Discover argument captors, inline stubbing, and resetting mock objects IN DETAIL Whether you are new to JUnit testing and mocking or a seasoned Mockito expert, this book will provide you with the skills you need to successfully build and maintain meaningful JUnit test cases and effectively mock external dependencies. At the beginning, this book deals with dummy and fake objects and then moves on to exploring stubs followed by an example on spying. Then, it will show you how to make legacy code testable, mock external dependencies using Mockito, and write testable code for greenfield projects. You will also gain an insight on the concepts of Service-oriented Architecture (SOA) as well as understand how to unit test RESTful web services with Mockito. By sequentially working through the steps in each chapter, you will quickly learn the features of Mockito. Mockito Essentials will ensure your success with these concepts, tools, and frameworks. « less
Learn different testing techniques and features of Visual Studio 2012 with detailed explanations and real-time samples
Overview * Using Test Manager and managing test cases and test scenarios * Exploratory testing using Visual Studio 2012 * Learn unit testing features and coded user interface testing * Advancement in web performance testing and recording of user scenarios In Detail Testing is one of the main more » phases in the software development lifecycle. Managing the test scenarios, test cases, defects, and linking each one of these is bit of a challenge without using any tools. For frequently changing businesses, it is essential to address testing requirements by matching the pace of the business. This can only be achieved through automation of the possible testing scenarios to reduce the turnaround time of testing. Software Testing Using Visual Studio 2012 is a practical, hands-on guide that provides a number of clear, step-by-step exercises, which will help you to take advantage of the new features and real power of Visual Studio 2012. Software Testing Using Visual Studio 2012 starts with the basics of testing types and managing the tests using Test Explorer and a few other tools. Practical examples are added to help you understand the usage of various tools and features in a better way. Software Testing Using Visual Studio 2012 is written from a developer point of view and helps you take advantage of the unit testing features and customize the tests by generating the code and fine-tuning it as per your needs. The Test Manager is a standalone tool which is part of the Visual Studio tools family and takes care of test management. Software Testing Using Visual Studio 201 covers the usage of the test plan, test suite, manual testing, and exploratory testing using Test Manger and managing these aspects using these tools. Software Testing Using Visual Studio 2012 also covers the recording of user actions and creating automated tests out of it. This book covers generating and adding parameters to the recording and replacing it at runtime, adding validation and extraction rules to the tests, running the tests using command line commands, looking at the details of test results, and configuring the running the load test out of web performance or unit tests. This book helps you to understand the complete testing features and how to make use of automation features as well. It will appeal to both developers and testers. What you will learn from this book * Discover different testing types as part of Visual Studio 2012 * Use the test plan, test suite, manual testing ,and exploratory testing * Record user interface actions and generating code out of it to customize the test * Get to grips with unit testing features and data-driven unit tests to automate the tests for multiple scenarios * Add extraction rules, validation rules, and custom rules to the recorded requests and add parameters to the requests * Create and configure load tests with the help of a web performance test or unit test * Analyze the detailed view of test results * Execute the existing tests at the command line using the MSTest command line utility * Report on the test results and publish the test results Approach We will be setting up a sample test scenario, then we'll walk through the features available to deploy tests. « less
Learn how to apply Test-Driven Development and the Mockito framework in real life projects, using realistic, hands-on examples
Overview * Start writing clean, high quality code to apply Design Patterns and principles * Add new features to your project by applying Test-first development- JUnit 4.0 and Mockito framework * Make legacy code testable and clean up technical debts In Detail The usual life cycle of code involves more » adding code, breaking an existing functionality, fixing that and breaking a new area! This fragility can be fixed using automated tests and Test Driven Development. TDD’s test first approach expedites the development process and unit tests act as safety nets for code refactoring and help in maintaining and extending the code. This makes TDD highly beneficial for new projects. This practical, hands-on guide provides you with a number of clear, step-by-step exercises that will help you to take advantage of the real power that is behind Test Driven Development and the Mockito framework. By using this book, you will gain the knowledge that you need to use the Mockito framework in your project. This book explains the concept of Test Driven Development (TDD), including mocking and refactoring, as well as breaking down the mystery and confusion that surrounds the test first approach of TDD. It will take you through a number of clear, practical examples that will help you to take advantage of TDD with the Mockito framework, quickly and painlessly. You will learn how to write unit tests, refactor code and remove code smells. We will also take a look at mock objects and learn to use Mockito framework to stub, mock, verify and spy objects for testability. You will also learn to write clean, maintainable, and extensible code using design principles and patterns. If you want to take advantage of using Test Driven Development and learn about mocking frameworks, then this is the book for you. You will learn everything you need to know to apply Test Driven Development in a real life project, as well as how to refactor legacy code and write quality code using design patterns. What you will learn from this book * Create your first unit test and discover the power of unit testing * Familiarize yourself with Test-first Development and the refactoring process * Add new features to your project applying Test Driven Development * Create readable, maintainable, and extensible software using design principles and patterns * Start stubbing, mocking, spying, and verifying objects using Mockito APIs * Apply inside-out and outside-in TDD styles * Expedite the development process using Eclipse and keyboard shortcuts * Apply JUnit 4.0 and advanced Mockito features – argument captor, callbacks, and answers Approach This book is a hands-on guide, full of practical examples to illustrate the concepts of Test Driven Development. Who this book is written for If you are a developer who wants to develop software following Test Driven Development using Mockito and leveraging various Mockito features, this book is ideal for you. You don’t need prior knowledge of TDD, Mockito, or JUnit. It is ideal for developers, who have some experience in Java application development as well as a basic knowledge of unit testing, but it covers the basic fundamentals of TDD and JUnit testing to get you acquainted with these concepts before delving into them. « less
with examples in C#
You know you should be unit testing, so why aren't you doing it? If you're new to unit testing, if you find unit testing tedious, or if you're just not getting enough payoff for the effort you put into it, keep reading. The Art of Unit Testing, Second Edition guides you step by step from writing your more » first simple unit tests to building complete test sets that are maintainable, readable, and trustworthy. You'll move quickly to more complicated subjects like mocks and stubs, while learning to use isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, refactor code applications, and learn how to test "untestable" code. Along the way, you'll learn about integration testing and techniques for testing with databases. « less