|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/learn-by-example-junit/
课程评论:没有评论
**Coursera 课程总结:通过示例学习 JUnit (Learn by Example: JUnit)** 本课程旨在通过 25 个实际示例,全面介绍 JUnit 单元测试框架的核心功能。JUnit 的核心理念是帮助开发者从测试运行的机械操作中解脱出来,专注于应用程序的功能测试,而框架将负责运行、监控和展示结果。 **课程内容涵盖:** 1. **断言 (Assertions):** JUnit 测试的基础,用于验证代码的预期行为。 2. **匹配器 (Matchers):** 以更具可读性的方式编写复杂的测试,并可实现自定义匹配器。 3. **假设 (Assumptions):** 用于检查测试的前提条件和外部依赖。 4. **夹具 (Fixtures):** 用于测试的设置 (Setup) 和清理 (Cleanup)。 5. **运行器 (Runners):** 深入理解 JUnit 的内部工作机制,学习使用不同的运行器来运行具有不同条件和参数的多个测试类。 6. **Mockito:** 学习 Mock 对象概念,并使用 Mockito 框架对相互依赖的类进行测试。 通过本课程的学习,学员将能熟练运用 JUnit 的各项功能,编写高效、可维护的单元测试。
JUnit is one of a family of unit testing frameworks all built with the same philosophy. To abstract the programmer away from the mechanics of running tests. You concentrate on testing the functionality of the application, and the logistics of running, monitoring and displaying results is taken care of by the framework. In this course, we'll be writing simple tests using all the different features of JUnit tests. Using 25 solved examples, you'll get a complete overview of the JUnit framework and all the functionality within. What's covered? 1) Assertions: the fundamental component of any Junit test2) Matchers: Write complicated tests in a very readable way. Implement your own custom matchers3) Assumptions: Check for preconditions and external dependencies 4) Fixtures: Setup and Cleanup for your tests 5) Runners: Understand what goes on under the hood in JUnit. Use different runners to run multiple test classes with different conditions and parameters4) Mockito: Understand the concept of mock objects and use the Mockito framework to run tests on interdependent classes.