Featured resource
2026 Tech Forecast
2026 Tech Forecast

Stay ahead of what’s next in tech with predictions from 1,500+ business leaders, insiders, and Pluralsight Authors.

Get these insights
  • Course

Creating Maintainable Contexts for Automated Testing

Learn how to create effective and maintainable test contexts that help guide other team members rather than acting as a barrier. Keep your contexts focused on the relevant details through the use of the Object Mother and Object Builder patterns.

Intermediate
1h 26m
(119)

Created by Mel Grubb

Last Updated Feb 05, 2020

Course Thumbnail
  • Course

Creating Maintainable Contexts for Automated Testing

Learn how to create effective and maintainable test contexts that help guide other team members rather than acting as a barrier. Keep your contexts focused on the relevant details through the use of the Object Mother and Object Builder patterns.

Intermediate
1h 26m
(119)

Created by Mel Grubb

Last Updated Feb 05, 2020

Get started today

Access this course and other top-rated tech content with one of our business plans.

Try this course for free

Access this course and other top-rated tech content with one of our individual plans.

This course is included in the libraries shown below:

  • Core Tech
What you'll learn

In this course, you'll see a demonstration of a typical hand-built test context, and the factors that make it brittle and hard to maintain. By using software principles we're all familiar with, and some patterns we may not have seen before, we can create contexts that remain focused on the information most important to understanding what the tests are trying to tell your team. We'll start with general principles, and then move into the Object Mother pattern, a common approach to extracting test context creation tasks. From there, we'll move into the Object Builder pattern, a more modern and expressive evolution of the Object Mother. Finally, you'll see how to use Roslyn-based C# scripts to generate the tedious parts of the Object Builder pattern, so that you can get back to the interesting stuff. When you’re finished with this course, you will have an appreciation for what makes for a good test context, and the skills to apply this knowledge to your current and future projects.

Creating Maintainable Contexts for Automated Testing
Intermediate
1h 26m
(119)
Table of contents

About the author
Mel Grubb - Pluralsight course - Creating Maintainable Contexts for Automated Testing
Mel Grubb
7 courses 4.7 author rating 414 ratings

Mel Grubb is a professional software developer and hobbyist from Columbus, Ohio. He spends his days as a consultant in the .Net space, and his nights tinkering with machines around his house.

Get started with Pluralsight