Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Writing Maintainable Unit Tests
Rating: 4.2 out of 5(182 ratings)
872 students

Writing Maintainable Unit Tests

Master the art of loosely coupled unit tests
Created byJan Van Ryswyck
Last updated 2/2020
English
English [Auto],

What you'll learn

  • How to apply the test pyramid
  • Learn about state and behaviour verification
  • Understand and apply the DRY, SRP and DAMP principles
  • How to organise unit tests
  • Build loosely coupled unit tests
  • Provide intentful assertions and observations

Course content

6 sections41 lectures3h 11m total length
  • Introduction6:13

    Explore the different types of tests and how automated tests improve code quality, maintainability, cycle time, and delivery speed.

  • Taxonomy of Tests1:00

    Explore the taxonomy of tests—unit, integration, api, database, acceptance, ui, performance, regression, and feature tests—and learn to identify applicable types for your use cases.

  • Solitary Versus Sociable Tests3:24

    Differentiate solitary tests as fast unit tests that verify a single class in isolation, and sociable tests as slower integration tests that validate interactions across modules using configuration files.

  • The Test Pyramid10:14

    Understand the test pyramid and why most tests should be solitary unit tests, with a small number of integration and system tests to avoid cascading failures.

  • State Versus Behaviour Verification5:56

    Explore state verification and behavior verification in unit tests with concrete examples like a resume manager and a register user handler, contrasting the Detroit and London schools of TDD.

  • Test-Driven Development4:13

    Learn the basics of test-driven development, red green refactor, and inside-out versus outside-in approaches, with small unit tests and sociable tests that verify wiring and interactions.

  • Summary0:32

    Compare solitary and sociable tests, apply the test pyramid for a healthy mix, and focus on unit testing, validating state and behavior through inside-out and outside-in TDD.

Requirements

  • A decent understanding of an object-oriented programming language, preferrably C# or Java.
  • At the very least some first experiences writing unit tests for production code.
  • Basic or intermediate knowledge of xUnit test frameworks (e.g. NUnit, JUnit, xUnit, ...).
  • Basic or intermediate knowledge of mocking frameworks in general.

Description

Are unit tests causing you pain? Are they constantly failing whenever you make changes to your production code? Do you spend a lot of time fixing them when they break? Are they difficult to set up and run? Do you have a hard time maintaining or structuring your unit test code? Are they causing you headaches from time to time? Are you on the brink of giving up on writing unit tests altogether or have you already done so?

Or do you just want to step up your game and want to learn more about how to write readable and maintainable unit tests?

This course is for experienced software developers who want to improve upon their existing skills in writing unit tests. By the end of this course, students will have gained the knowledge to build loosely coupled, highly maintainable and robust unit tests that are trustworthy and improve the overall code quality of your software applications. The content of this course is based on 15+ years of experience with Test-Driven Development. This knowledge is essential for becoming a senior-level software developer or a technical lead.

Although the examples that are used throughout this course are written in C#, the principles and guidance discussed here are broadly applicable to other platforms and programming environments as well (Java, Python, JavaScript, ... etc.). So students will be able to universally apply this knowledge throughout the rest of their careers as software developers.


Who this course is for:

  • This course is for software developers who want to improve upon their existing skills for writing readable and maintainable unit tests.