Crafting Test-Driven Software with Python: Write test suites that scale with your applications needs and complexity, using Python and PyTest

0
(0)

Crafting Test-Driven Software with Python: Write test suites that scale with your applications needs and complexity, using Python and PyTest
 

  • Author:Alessandro Molina
  • Length: 303 pages
  • Edition: 1
  • Publisher: Packt Publishing – ebooks Account
  • Publication Date: 2021-03-09
  • ISBN-10: 183864265X
  • ISBN-13: 9781838642655
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Get to grips with essential concepts and step-by-step explanations to apply TDD practices to your Python projects while keeping your test suite under control

    Key Features

    • Build robust Python applications using TDD and BDD methodologies
    • Test Python web applications using WebTest and web frameworks
    • Leverage PyTest to implement stringent testing mechanisms to ensure fault-tolerant applications

    Book Description

    Test-driven development (TDD) is a set of best practices that helps developers to build more scalable software, and is used to increase the robustness of software by using automatic tests. This book shows you how to apply TDD practices efficiently in Python projects.

    You’ll begin by learning about built-in unit tests and Mocks before covering rich frameworks like PyTest and web-based libraries such as WebTest and Robot, and understand how Python allows you to embrace all modern testing practices with ease. Moving on, you’ll find out how to design tests and balance them with new feature development and discover how to create a complete test suite with PyTest. The book helps you adopt a hands-on approach to implementing TDD and associated methodologies that will have you up and running and make you more productive in no time. With the help of step-by-step explanations of essential concepts and practical examples, you’ll explore automatic tests and TDD best practices and get to grips with the methodologies and tools available in Python for creating effective and robust applications.

    By the end of this Python book, you will be able to write reliable test suites in Python to ensure the long-term resilience of your application while learning about the range of libraries offered by Python for testing and development.

    What you will learn

    • Find out how tests can make your life easier as a developer and discover related best practices
    • Explore and learn PyTest, the most widespread testing framework for Python
    • Get to grips with the most common PyTest plugins, including coverage, flaky, xdist, and picked
    • Write functional tests for WSGI web applications with WebTest
    • Run end-to-end tests for web applications using the Robot framework
    • Understand what test-driven development means and why it is important
    • Discover how to use the range of tools available in Python
    • Build reliable and robust applications

    Who This Book Is For

    This book is for Python developers looking to get started with test-driven development and developers who want to learn about the testing tools available in Python. Developers who want to create web applications with Python and plan to implement TDD methodology with PyTest will find this book useful. Basic knowledge of Python programming is required.

    Table of Contents

    1. Getting Started with Software Testing
    2. Test Doubles with a Chat Application
    3. Test Driven Development while creating a TODO list
    4. Scaling the Test Suite
    5. Introduction to PyTest
    6. Dynamic and Parametric Tests and Fixtures
    7. Fitness Function with a contact book application
    8. PyTest Essential Plugins
    9. Managing test environments with Tox
    10. Testing Documentation and Property Based Testing
    11. Testing for the Web: WSGI vs HTTP
    12. End to end testing with Robot framework

    中文:

    书名:Crafting Test-Driven Software with Python: Write test suites that scale with your applications needs and complexity, using Python and PyTest

    掌握基本概念和分步解释,将TDD实践应用于您的Python项目,同时保持对测试套件的控制

    主要特点

    • 使用TDD和BDD方法构建健壮的Python应用程序
    • 使用WebTest和Web框架测试Python Web应用程序
    • 利用PyTest实现严格的测试机制以确保容错应用程序

    图书描述

    测试驱动开发(TDD)是一组帮助开发人员构建更具伸缩性的软件的最佳实践,并用于通过使用自动测试来增加软件的健壮性。本书向您展示了如何在Python项目中有效地应用TDD实践。

    您将从学习内置单元测试和模拟开始,然后介绍丰富的框架(如PyTest)和基于Web的库(如WebTest和Robot),并了解Python如何让您轻松采用所有现代测试实践。接下来,您将了解如何设计测试并平衡它们与新功能开发的关系,并了解如何使用PyTest创建完整的测试套件。这本书帮助您采用实际操作的方法来实现TDD和相关的方法,这将使您立即启动并运行,并使您的工作效率更高。在基本概念和实际示例的逐步解释的帮助下,您将探索自动测试和TDD最佳实践,并掌握可用于创建有效且健壮的应用程序的方法和工具。

    到本书结束时,您将能够用Python编写可靠的测试套件,以确保应用程序的长期弹性,同时了解由Python提供的一系列用于测试和开发的库。

    你将学到什么

    • 了解测试如何使您作为开发人员的工作更轻松,并发现相关的最佳实践
    • 探索和学习最广泛使用的Python测试框架–PyTest
    • 熟悉最常见的PyTest插件,包括Coverage、Faky、xdist和Pick
    • 使用WebTest为WSGI Web应用程序编写功能测试
    • Run end-to-end tests for web applications using the Robot framework
    • 理解测试驱动开发的含义以及为什么它很重要
    • 了解如何使用Python中提供的一系列工具
    • 构建可靠、健壮的应用程序

    这本书是为谁写的

    本书面向希望开始测试驱动开发的Python开发人员,以及希望了解Python中可用的测试工具的开发人员。想要用Python创建Web应用程序并计划用PyTest实现TDD方法的开发人员会发现这本书很有用。需要具备基本的Python编程知识。

    目录表

    1. 软件测试入门
    2. Test Doubles with a Chat Application
    3. 创建待办事项列表时的测试驱动开发
    4. 扩展测试套件
    5. PYTEST简介
    6. 动态和参数测试和夹具
    7. 带有通讯录应用程序的健身功能
    8. PyTest基本插件
    9. 使用Tox管理测试环境
    10. Testing Documentation and Property Based Testing
    11. Web测试:WSGI与HTTP
    12. 使用Robot框架进行端到端测试
  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册