Better User Experiences and More Robust Applications Pluralsight Course

My new Pluralsight course was just published which shows how to use the open source Polly library.

Polly is a great library by Michael Wolfenden for configuring the automatic retrying of operations if exceptions occur. Transient errors such as the network being slow/unavailable for a small amount of time can normally result in errors surfacing to the user and/or into log files that need looking at.

By using one of the exception handling strategies that Polly provides, these transient exceptions can automatically be retried, preventing user errors and/or log entries.

There are four strategies:

  • Retry Forever
  • Retry
  • Wait and Retry
  • Circuit Breaker

Polly is configured in a fluent way, for example to use the Wait and Retry strategy to retry 3 times waiting 2, 4, and 6 seconds between retries:

Policy.Handle<some exception>()
      .WaitAndRetry(new[]
          {
            TimeSpan.FromSeconds(2),
            TimeSpan.FromSeconds(4),
            TimeSpan.FromSeconds(6)
          })
      .Execute(some action);

Check out the Polly GitHub repo, the NuGet package or the “Better User Experiences and More Robust Applications with Polly” Pluralsight course.

You can start watching with a Pluralsight free trial.

SHARE:

New Pluralsight Course - Better .NET Unit Tests with AutoFixture

My new Pluralsight testing course was just released: Better .NET Unit Tests with AutoFixture: Get Started.

AutoFixture is an open source library that allows the simplification of automated .NET tests. It allows for the creation of “anonymous” test data. This is data that is required for the test to execute, but where the exact values are unimportant.

AutoFixture is not dependent upon any specific testing framework, so can be used with xUnit.net, NUnit, MSTest, etc. There are some additional extensions for specific testing frameworks such as xUnit.net that allow further reductions in unit test setup code.

For more info check out the GitHub site or the Pluralsight course.

If you like AutoFixture be sure to give open source thanks to Mark Seemann.

If you want to fill in the gaps in your C# knowledge be sure to check out my C# Tips and Traps training course from Pluralsight – get started with a free trial.

SHARE:

New Pluralsight Course - Implementing Feature Toggles in .NET with FeatureToggle

Feature toggles (also referred to as feature flags, flippers, feature switches, etc) are a technique to turn on or off features in applications. One way of categorising feature toggles is whether they are for the benefit of the development team (“release toggles”) or the business/stakeholders (“business toggles”). Release toggles are an alternative/compliment to feature branching and are short lived. Business toggles are long lived and represent application features that are enabled depending on business defined rules.

In my new Pluralsight course Implementing Feature Toggles in .NET with FeatureToggle I talk about the different types of toggles and some general things to consider when using toggles, followed by modules showing how to use the FeatureToggle open source library.

You can start watching with a Pluralsight free trial.

SHARE:

New Pluralsight Course - Introduction to .NET Testing with NUnit

If you are just dipping your toe in the water when it comes to testing .NET applications it can be a bit confusing. In addition to learning how and what to write test, you also have to learn a testing framework such as MSTest, xUnit.net, NUnit, etc.

My new beginner Pluralsight course helps you to get started with testing in .NET and how to use the NUnit testing framework.

Watch the course at the above link or get to it from my Pluralsight author page.

You can start watching with a Pluralsight free trial.

SHARE:

New Pluralsight Course - Automated ASP.NET MVC Testing: End to End

My new Pluralsight course Automated ASP.NET MVC Testing: End to End was just published.

The course looks at tools and techniques to be able to tests models, controller actions, Razor view rendering logic, and implement automated functional UI browser testing.

The course wraps up by showing how to design and implement a continuous integration build in TeamCity that runs the tests created during the course.

Check it out the full table of contents.

You can start watching with a Pluralsight free trial.

SHARE:

Beyond Simple Asserts with ApprovalTests

In a test, we are often testing (asserting) individual items such as an (int) age is correct or a string matches an expected value.

If we are practicing test-first development we’ll write our asserts first.

Approval tests allow us to go beyond simple asserts.

What if the thing we’re checking is not a simple value, for example that a pie chart image matches the input data? Or what if we want to use our human judgement to decide when something looks correct, something that is hard to codify in one or more basic asserts?

ApprovalTests for .NET can be install via NuGet. Once installed, it gives us a whole new world when it comes to checking the output of code.

For example, say we are developing a class to represent a stickman. We want to be able to tell an instance to raise left arm or raise right leg for example.

Example of Using Approval Tests

So lets start with a test:

[Fact]
[UseReporter(typeof(DiffReporter))]
public void ShouldHaveDefaultPosture()
{
    var sut = new StickMan();

    Approvals.Verify(sut);
}

And an empty StickMan:

public class StickMan
{        
}

Here we’re using xUnit.net (the [Fact] attribute) but you could be using NUnit for example.

The first thing to notice here is there is no traditional Assert method, instead we’re using Approval Tests to verify the state of the system under test (sut).

The other think to notice is the [UseReporter] attribute that tells Approval Tests to use a diff tool to display errors when a test fails.

If we run this test, we’ll get a diff tool opened:

More...

SHARE:

New Pluralsight Course - Improve Your Application User Experience with Humanizer

My new Pluralsight course Making .NET Data Types More Human With Humanizer was recently released.

With Humanizer our application user experience can be improved. For example we’ve all seen (and probably written) applications that just add “(s)” to a list of things: “1 order(s)” rather that adding the “s” only when there is more than 1 order.

Another use case is the Humanization of DateTimes. For example in a logging application we’d probably want the log entry date and time right down to the millisecond. In a Twitter app for example, that level of detail is not essential to the user experience; in this instance Humanizer can give us a string such as “2 hours ago” which is a lot easier on the eye.

Check out the GitHub site, give a shout out to the creator Mehdi Khalili on Twitter, or watch the Pluralsight course here.

You can start watching with a Pluralsight free trial.

SHARE:

Building the Right Thing with TestStack

My newest Pluralsight course was just released today: Building the Right Thing in .NET with TestStack.

TestStack is a suite of tools to help the team build better software.

The super-friendly members of TestStack are:

  • Jake Ginnivan
  • Krzysztof Koźmic
  • Mehdi Khalili
  • Michael Whelan
  • Robert Moore

TestStack consists of the following tools:

  • BDDfy: turn tests into business readable, living documentation
  • Seleno: automated UI web testing with strongly-typed page object models
  • FluentMVCTesting: unit test ASP.NET MVC controllers using fluent syntax
  • White: automated UI testing for Win32 based rich client applications
  • ConventionTests: write tests to check coding conventions are being adhered to

To get started learning the TestStack tools check out the Pluralsight course, the documentation site, or learn how to contribute to the TestStack project.

SHARE:

10 Pluralsight Courses–A Milestone

I just had my 10th Pluralsight course released; Building .NET Console Applications in C# teaches how to create well-designed, fully-featured .NET Console applications.

When I hit 7 courses I wrote Three Things I’ve Learned Being a Pluralsight Course Author and those learnings still stand but there’s three other things that I think I also appreciate more now.

1 Continuous Improvement

As the saying goes: practice really does make perfect; though aiming for “perfection” is probably not a path to happiness. To paraphrase Mother Teresa: don’t try to do great things in this life, just do small things with great love.

We did not weave the web of life, we are merely strands in it

Continuous improvement doesn’t just apply to code, it applies to ourselves as a whole. A the name of this site implies, if we don’t take good care of our health (mental, physical, spiritual) then our code will be affected adversely. We know this from our own experience, we can bang our head against a problem and stay late for hours only to leave work without success, feeling tired and unproductive. The next morning we start work and solve the problem in 10 minutes. We are not machines, we shouldn’t think of ourselves as such. We are not Human Resources, we’re just Human.

I’ve learnt loads by being a Pluralsight author, maybe one day I’ll make it to 20 courses, there’s one thing for sure: my 20th course will be better than my 1st. We should all look for and feel a sense of progress, if we aren’t then maybe it’s time to revaluate our circumstances.

The goal of getting better and making progress is, I think, a better goal than becoming perfect.

2 Gratitude

No matter how cool the things we do for work are, it’s easy for the common to become unconsciously ignored.

Having my 10th course published is probably a good time to reflect with gratitude.

I’m grateful for:

  • Being part of the Pluralsight vision to democratize online tech training for people around the world, because
  • The work I do on course production helps people to get better at what they do
  • The opportunity to create, and have what I create viewed by thousands of people around the world
  • Being part of what really is a revolution in tech training, and Pluralsight really is leading the way for tech training
  • And finally, simply being able to teach.

3 Changing the World

We sometimes don’t think of the ripples we send out into the world by our actions. No thing exists purely because of a single cause. A complex web of things brought the thing into existence.

Continuous improvement doesn’t just apply to code, it applies to ourselves as a whole

Take for example the clothes you are wearing right now. You aren’t wearing them simply because you bought them: someone made them, someone made the machine that made them, someone harvested the cotton that made them, someone planted the cotton, someone drilled the oil to make the diesel that delivered that t-shirt to the store, and so on.

In the same way, the work we do sends ripples into the world. When we make software, we change people’s lives. When someone learns and uses something from one of my courses, their software gets better, and their lives and the lives of their users is improved. This is a pretty amazing thing to be part of.

“We did not weave the web of life, we are merely strands in it. Whatever we do to the web we do to ourselves” – Chief Seattle.

SHARE:

New Pluralsight Course: SpecFlow Tips and Tricks

My latest Pluralsight course was released today: SpecFlow Tips and Tricks is a short course to help those who are relatively new to SpecFlow and those who have been using it for a while and want to create more maintainable testing solutions.

The course focuses on 3 main areas:

  • Steps and Bindings
  • Hooks and Scoped Bindings
  • Step Parameters and Data Tables

This course is a loose follow-up to my previous Automated Acceptance Testing with SpecFlow and Gherkin course that covers the Gherkin DSL and other fundamental SpecFlow topics.

You can check out the course on the Pluralsight website or on my author page.

You can start watching with a Pluralsight free trial.

SHARE: