My Account Log in

3 options

Test-driven python development : develop high-quality and maintainable Python applications using the principles of test-driven development / Siddharta Govindaraj.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Govindaraj, Siddharta, author.
Series:
Community experience distilled.
Community Experience Distilled
Language:
English
Subjects (All):
Python (Computer program language).
Web site development.
Application software--Development.
Application software.
Object-oriented programming (Computer science).
Physical Description:
1 online resource (264 p.)
Edition:
1st edition
Other Title:
Develop high-quality and maintainable Python applications using the principles of test-driven development
Place of Publication:
Birmingham, [England] : Packt Publishing, 2015.
Language Note:
English
System Details:
text file
Biography/History:
Govindaraj Siddharta: Siddharta Govindaraj first encountered Python in 2002, and it has remained his favorite programming language ever since. He was an early participant in BangPypers, India's first Python community, and a speaker at InPycon. He is the founder of Silver Stripe Software, an Indian product start-up that develops products based on Python. A vocal proponent of the language, Siddharta extols the virtues of Python to anyone who will listenand also to those who won't. His blog is at http: //www. siddharta. me.
Summary:
This book is intended for Python developers who want to use the principles of test-driven development (TDD) to create efficient and robust applications. In order to get the best out of this book, you should have development experience with Python.
Contents:
Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started with Test-driven Development; Prerequisites; Understanding test-driven development; TDD versus unit testing versus integration testing; Using TDD to build a stock alert application; Writing our first test; Analyzing the test output; Test errors versus test failures; Making the test pass; Reorganizing the test code; Running the tests after the reorganization; Summary; Chapter 2: Red-Green-Refactor - The TDD Cycle
Tests are executable requirementsArrange-Act-Assert; Documenting our tests; Testing for exceptions; Exploring assert methods; Specific asserts versus generic asserts; Setup and teardown; Brittle tests; Refactoring the design; Refactoring tests; Exploring the Rule classes; Exercise; Summary; Chapter 3: Code Smells and Refactoring; A dual crossover moving average; Implementing the dual crossover moving average; Identifying code smells; Refactoring; The Rename Variable and Rename Method refactorings; Commenting Styles; Replace Magic Literals with Constants; The Extract Method refactoring
Replace Calculation with Temporary VariableExtract Conditional to Method; The DRY principle; Single Responsibility Principle; Extract Class; Move Method to Class; The importance of tests; Exercise; Wrapping up; Summary; Chapter 4: Using Mock Objects to Test Interactions; Hand writing a simple mock; Using the Python mocking framework; Mocking objects; Mocking return values; Mocking side effects; How much mocking is too much?; Mocks versus stubs versus fakes versus spies; Patching methods; An important gotcha when patching; Tying it all together; Summary; Chapter 5: Working with Legacy Code
What is legacy code?Understanding the code; What are characterization tests?; Using the Python interactive shell to understand the code; Writing a characterization test; Using pdb to understand the code; Some common pdb commands; Walking through a pdb session; Techniques to break dependencies; The Rope refactoring library; Separate initialization from execution; Use default values for parameters; Extract the method and test; Inject dependencies; Inherit and test; Stubbing local methods; Extract the method and stub; The cycle continues; Time to refactor; Long-term refactoring; Summary
Chapter 6: Maintaining Your Test SuiteGoals of test maintenance; Organizing tests; Filesystem layout; Naming conventions; Test suite grouping; Making tests readable; Using docstrings; Using fixtures; Fixtures and patching; Using a custom test case class hierarchy; Writing tests closer to the domain; Writing helper methods; Writing better asserts; Using custom equality checkers; Using matchers; Summary; Chapter 7: Executable Documentation with doctest; Our first doctest; Running the doctest; Test failures; Testing for exceptions; Package-level doctests; Maintaining doctests
Running a suite of doctests
Notes:
Includes index.
Description based on online resource; title from PDF title page (ebrary, viewed May 15, 2015).
Description based on publisher supplied metadata and other sources.
OCLC:
910341793

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account