Python Testing Cookbook, 2nd Edition

0
(0)

Python Testing Cookbook, 2nd Edition
 

  • Author:Bhaskar N. DasGreg L. Turnquist
  • Length: 396 pages
  • Edition: 2nd Revised edition
  • Publisher: Packt Publishing
  • Publication Date: 2018-06-29
  • ISBN-10: 1787122522
  • ISBN-13: 9781787122529
  • Sales Rank: #2389813 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Python Testing Cookbook.: Easy solutions to test your Python projects using test-driven development and Selenium, 2nd Edition

    Fix everyday testing problems in Python with the help of this solution-based guide

    Key Features

    • Use powerful tools such as doctest and unittest to make testing convenient
    • Apply automation testing to an existing legacy system that isn’t test oriented
    • A practical guide to ease testing in Python using real-world examples

    Book Description

    Automated testing is the best way to increase efficiency while reducing the defects of software testing. It helps find bugs in code easily and at an early stage so that they can be tackled efficiently. This book delves into essential testing concepts used in Python to help you build robust and maintainable code.

    Python Testing Cookbook begins with a brief introduction to Python’s unit testing framework to help you write automated test cases. You will learn how to write suitable test sets for your software and run automated test suites with Nose. You will then work with the unittest.mock library, which allows you to replace the parts of your system that are being tested with mock objects and make assertions about how they have been used. You will also see how to apply Test-driven Development (TDD) and Behavior-driven Development (BDD) and how to eliminate issues caused by TDD. The book explains how to integrate automated tests using Continuous Integration and perform smoke/load testing. It also covers best practices and will help you solve persistent testing issues in Python. The book concludes by helping you understand how doctest works and how Selenium can be used to test code efficiently.

    What you will learn

    • Run test cases from the command line with increased verbosity
    • Write a Nose extension to pick tests based on regular expressions
    • Create testable documentation using doctest
    • Use Selenium to test the Web User Interface
    • Write a testable story with Voidspace Mock and Nose
    • Configure TeamCity to run Python tests on commit
    • Update project-level scripts to provide coverage reports

    Who This Book Is For

    If you’re a Python developer who wants to take testing to the next level and would like to expand your testing skills, this book is for you. It is assumed that you have some Python programming knowledge.

    Table of Contents

    Chapter 1. USING UNITTEST TO DEVELOP BASIC TESTS
    Chapter 2. RUNNING AUTOMATED TEST SUITES WITH NOSE
    Chapter 3. CREATING TESTABLE DOCUMENTATION WITH DOCTEST
    Chapter 4. TESTING CUSTOMER STORIES WITH BEHAVIOR DRIVEN DEVELOPMENT
    Chapter 5. HIGH LEVEL CUSTOMER SCENARIOS WITH ACCEPTANCE TESTING
    Chapter 6. INTEGRATING AUTOMATED TESTS WITH CONTINUOUS INTEGRATION
    Chapter 7. MEASURING YOUR SUCCESS WITH TEST COVERAGE
    Chapter 8. SMOKE/LOAD TESTING―TESTING MAJOR PARTS
    Chapter 9. GOOD TEST HABITS FOR NEW AND LEGACY SYSTEMS
    Chapter 10. Web UI testing using Selenium

    中文:

    书名:Python Testing Cookbook, 2nd Edition

    Python Testing Cookbook:使用测试驱动开发和Selify测试您的Python项目的简单解决方案,第二版

    在这个基于解决方案的指南的帮助下,解决日常的测试问题

    Key Features

    • 使用doctest和unittest等功能强大的工具,让测试更加便捷
    • 将自动化测试应用于不面向测试的现有遗留系统
    • 使用真实示例简化在Python中进行测试的实用指南

    Book Description

    自动化测试是提高效率、减少软件测试缺陷的最佳途径。它有助于在早期轻松地发现代码中的错误,以便能够有效地解决这些错误。这本书深入探讨了在Python中使用的基本测试概念,以帮助您构建健壮且可维护的代码。

    《Python Testing Cookbook》首先简要介绍了Python的单元测试框架,以帮助您编写自动化测试用例。您将学习如何为您的软件编写合适的测试集,并使用Nose运行自动化测试套件。然后,您将使用unitest.mock库,该库允许您用模拟对象替换正在测试的系统部分,并断言它们是如何使用的。您还将了解如何应用测试驱动开发(TDD)和行为驱动开发(BDD),以及如何消除由TDD引起的问题。这本书解释了如何使用持续集成集成自动化测试并执行冒烟/负载测试。它还介绍了最佳实践,并将帮助您解决在Python中的持久性测试问题。该书最后帮助您了解doctest的工作原理,以及如何使用Selify来高效地测试代码。

    你将学到什么

    • 从命令行运行测试用例,并增加详细程度
    • Write a Nose extension to pick tests based on regular expressions
    • 使用doctest创建可测试的文档
    • 使用Selify测试Web用户界面
    • 使用Voidspace模拟和鼻子编写可测试的故事
    • 将TeamCity配置为在提交时运行Python测试
    • 更新项目级脚本以提供覆盖率报告

    这本书是为谁写的

    如果您是一名想要将测试提升到一个新水平并想扩展测试技能的Python开发人员,这本书是为您准备的。假设您具有一定的Python编程知识。

    Table of Contents

    Chapter 1. USING UNITTEST TO DEVELOP BASIC TESTS
    第2章.使用NOSE运行自动化测试套件
    第3章.使用DOCTEST创建可测试文档
    第4章:用行为驱动的开发测试客户情景
    第5章.带有验收测试的高级客户场景
    第6章:将自动化测试与持续集成相结合
    第7章.用测试覆盖率衡量您的成功
    第8章烟雾/负载测试–测试主要部件
    第9章:新系统和遗留系统的良好测试习惯
    第10章.使用Selify进行Web用户界面测试

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

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

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

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册