|
所在平台: Coursera |
课程主页: https://www.coursera.org/learn/test-and-behavior-driven-development-tdd-bdd
课程评论:没有评论
课程总结:测试驱动开发入门(TDD) 本课程旨在介绍测试驱动开发(TDD)的基本概念和实践,帮助开发者构建可靠的软件。课程内容包括自动化测试的重要性、测试的基本知识、测试用例以及传统发布周期中的不同测试层级。 课程分为几个模块: 1. **测试简介**:本模块介绍软件测试的重要性,通过阿波罗11号月球模块的开发案例来阐述未进行测试时可能出现的问题,讲解测试的四个层级及其在发布周期中的作用,并探索测试驱动开发(TDD)与行为驱动开发(BDD)的基本概念及其必要性。 2. **测试驱动开发(TDD)**:这一模块详细阐述TDD的基本步骤及其红绿重构(Red/Green/Refactor)工作流,强调TDD在DevOps及自动化测试中的重要性。还介绍了流行的TDD工具,以及如何使用Python的内置测试运行器Unittest和功能更强大的Nose进行测试,包括使用断言和测试夹具建立测试的初始状态。 3. **测试驱动开发的高级方法**:本模块探讨提升测试覆盖率的方法,使用测试覆盖率报告的意义,以及为何在达到完全测试覆盖后仍需测试。学习如何使用虚假数据进行测试,利用工厂生成数据,以及模拟(mocking)技术的使用场景和方法。 4. **行为驱动开发(BDD)**:本模块介绍BDD的优势及其典型工作流程,学习Gherkin语法以编写BDD规范,并探讨常用的BDD工具。通过Behave工具,学习如何从用户视角测试应用行为,包括环境搭建、测试执行控制、和如何加载测试数据。 5. **使用Behave进行行为驱动开发**:学习如何生成Python步骤,并掌握实施这些步骤的工作流程,包括上下文变量的使用和变量替换的好处。同时,学生将练习行为驱动开发的过程。 6. **期末项目与考试**:在最终项目中,学生将创建一个电子商务应用的产品目录后端微服务,分为两部分:第一部分应用TDD原则创建一个REST API;第二部分编写BDD场景以测试提供的管理用户界面。最终,学生还需参加一次期末考试以检测所学知识。 通过本课程,学生将掌握测试驱动开发的核心技能,提升软件开发的质量与效率。
Name:Introduction to Testing
Description:This module provides an overview of software testing. You will learn about the importance of testing through an example: the development of the Apollo 11 Lunar Module’s guidance system. You will discover the numerous problems that occur when developers do not test their code. Then you will explore the four levels of testing and find out when each appears in the traditional release cycle. You will learn what test driven and behavior driven development are and why both are essential for effective testing. You will discover the purpose of test cases and witness their value through a demonstration.
Name:Test Driven Development
Description:This module provides an overview of Test-Driven Development (TDD). You will learn what TDD is and discover the three basic steps in the TDD and Red/Green/Refactor workflow. You will see why TDD is essential for DevOps and all automated testing. You will also discover popular testing tools for TDD and closely examine the features of several tools for Python. This module also covers essential methods for performing TDD. You will explore ways to run TDD tests such as, Python’s built-in test runner, Unittest, and the more feature-rich module, Nose. You will learn about assertions and how to use them to test code. You will discover why you must include happy and sad paths in your test module. You will also discover the test fixtures and how to use them to establish an appropriate initial state for each test.
Name:Advanced Methods for Test Driven Development
Description:This module covers advanced methods for TDD. You will learn about test coverage: why it’s important, how to increase it by using test coverage reports, and why you should keep testing even at full test coverage. You will discover the value of testing against fake data and how to use factories to generate this data. You will also explore mocking, a process for mimicking the behavior of real objects, and you will find out the testing situations for which mocking is useful. You will learn how to use two common methods for mocking: patching a function call and mocking entire objects.
Name:Behavior Driven Development
Description:This module provides an overview of behavior driven development (BDD). You will explore BDD, including its benefits for higher-level automated testing and its typical workflow. You will discover the basics of Gherkin syntax, a standard syntax for writing BDD specifications. You will learn about popular BDD tools and how to select the best one for your project. This module also covers essential methods for performing BDD with Behave. You will examine how Behave uses the code in feature and steps files to test an application’s behavior from a user’s perspective. You will discover how to build a Behave environment and control test execution at various levels. Then you will explore in detail how to write feature and steps files. In addition, you will learn how to load test data from tables, automate web page interactions with Selenium, and write Python functions for testing application behaviors.
Name:Running Behave for Behavior Driven Development
Description:This module provides an overview of how to use Behave to generate Python steps. Once you know how to generate the steps, you will learn the workflow for implementing them. The next lesson will explain the context variable and how to pass information between Python steps. In addition, you will discuss the benefits of variable substitution for working with Behave and its application in Python steps. Finally, you will practice behavior driven development.
Name:Final Project and Final Exam
Description:In this final module, you will work on a Final project. You will apply many of the technologies and concepts you've learned in the course and will create a microservice for a product catalog backend to an eCommerce application. The UI of the eCommerce application will be used by administrators to maintain the product catalog. This Final Project is divided into two parts. In the first part of this project, you will use good Test Driven Development practices to create a REST API that allows users to Create, Read, Update, Delete, and List products by various attributes. In the second part of this project, you will write Behavior Driven Development scenarios to test that the administrative user interface that has been provided for you behaves as expected. Finally, you will also attempt a final exam to test the concepts learned.
Successful developers need to not only build the right software but build it right. To know your software works correctly, you need to test each unit of code. One of the best methods for this unit-level testing is test-driven development. This course provides a detailed overview of test-driven development (TDD). First, you’ll learn what automated testing is and why it is essential for building robust applications resilient to failure. You’ll explore the basics of testing, including test cases, testing levels, and the traditional release cycle. You’ll learn about TDD and its complement, behavior-driven development (BDD): TDD tests individual units of code while BDD tests how these units work together. Then you’ll examine TDD in detail. You’ll explore TDD’s benefits, concepts, and popular tools, and you’ll hone your new testing skills through hands-on labs. You’ll create TDD test cases by writing test assertions and building test fixtures, and you’ll run these test cases by using the Nose testing package. You’ll then practice more advanced TDD methods such as increasing code coverage, generating and using fake data, and testing mock objects.