Testing can be a thorny issue for many coders who just want to write code and relegate unit testing and other techniques to specialists in that field. But with resources being stretched thin these days, coders often have to be test jockeys too. Luckily the Visual Studio Marketplace for VS 2019 has more than 130 free extensions to help.
In this article, "newest" refers not only to a tool's publish date but also the most recent update, as those can turn many time-honored extensions into basically new ones. I've also emphasized popularity (number of installs) and high reviewer ratings in curating this list of the top 10 free tools (in no particular order).
Unit Test Boilerplate Generator from RandomEngy is a free tool (45K installs) that's earned an average 4.8 rating (0-5 scale) from 28 developers who reviewed it. As it's name suggests, it can work up a unit test boilerplate for a C# class, complete with mocks for all dependencies. Along with two dependency injection modes and support for the VS testing framework, it supports NUnit and xUnit frameworks, while mock framework support covers:
- Moq + AutoMoq
- Rhino Mocks
Although one developer remarked a few months ago that he couldn't get it to work on VS 2019, another developer said it was working normally in v16.8.5. "A great time saver!" said one reviewer in February. "Will definitely try to create a PR for personal needs that others might find interesting. Kudos to the author and their fast response in the Q&A threads!" It was updated about a month ago.
Staying in the unit testing space, Fine Code Coverage from Fortune Ngwenya has been installed nearly 18K times, with a near-perfect 4.9 rating from 67 reviewers. It helps developers visualize unit test code coverage on .NET Core (now just .NET 5) and even the old .NET Framework. Specifically, visualization functionality enables coders to:
- Get highlights on the code being tested
- Get highlights on the code doing the testing
- See coverage view
- See summary view
- See risk hotspots view
The tool was last updated in late March, with the last code commit just a week ago, showing that the author is keeping it current.
Debugging, of course, is integral to testing, and here the Debug Attach Manager extension from Viktor Karpach fits the bill. It does one thing and it does it well: It helps you attach the Visual Studio debugger to web application pools, windows services and other processes. In fact, you can search for processes (such as IIS application pool-specific processes) and then attach to them while automatically saving selected processes between Visual Studio restarts. You can also attach to multiple processes at once, providing great functionality for web developers.
Debug Attach Manager is nearing 28K installs, with an average 4.3 rating from 26 reviewers. It works with VS editions going back to 2013, just in case there are still any of those being used.
It's described as "Cucumber for .NET," referencing the commercial Cucumber Behavior Driven Development (BDD) tool. BDD is associated with agile software development, which encourages collaboration among developers, quality assurance, and non-technical/business players to create, test and ship projects.
"SpecFlow bridges the communication gap between domain experts and developers by binding business readable behavior specifications and examples to the underlying implementation," the tool's site states. "Our mission is to provide a pragmatic and frictionless approach to Specification-By-Example for .NET projects." Specification by example (SBE) is defined by Wikipedia as "a collaborative approach to defining requirements and business-oriented functional tests for software products based on capturing and illustrating requirements using realistic examples instead of abstract statements." Thus SpecFlow helps .NET development teams define, manage and execute automated acceptance tests as business-readable specifications. Along with BDD, SpecFlow also supports another concept closely associated with SBE: Acceptance Test Driven Development (ATDD). It was updated last month, with the last commit occurring three weeks ago.
"I love working with complex regular expressions," said no developer ever. OK, I'm just influenced by personal experience -- I'm sure there are such people out there ... somewhere. Hey, if
+s]|s([^\.]|\.([^l]|l([^i]|i([^n]|n([^u]|u[^x]))))))))))))))) is your cup of tea, have at. Anyway, Regex Editor from Georgy Losenkov might help with stuff like that. It's another niche tool that does one thing: edit and test regular expressions.
Specifically it lets developers:
- Test all main methods of the Regex class: Match, Replace, Split
- Generate sample code (C# and Visual Basic) using your input
- Treat input as multiple samples (one sample per line)
- Provide coloring for patterns
- Provide coloring for replacement strings
- Provides coloring for input strings when testing Match method
- Highlights segments of the input string corresponding to selected node in the tree when testing Match method
It has been installed more than 8K times, earning our first perfect 5.0 rating from nine reviewers, last updated in December 2020.
Telerik Testing Framework comes from the well-known maker of many professional, for-pay .NET controls and tools, now under the Progress umbrella. But it's a free web testing framework designed to help you automate HTML5, AJAX, Silverlight (remember that?) and Windows Presentation Foundation (WPF) applications. Benefits listed by the company include a rich API, LINQ support, browser abstraction, and special wrappers for the company's RadControls. With built-in support for NUnit, MbUnit or XUnit unit testing tools, it was updated last month, though it's been around for many years. Only two developers have reviewed it (4.5) and its entry has been clicked 3,382 times.
Azure DevOps Test Connector from MadeUpExtensions works with the aforementioned SpecFlow, supporting the creation of Specflow Scenario Outline tests. It lets coders use attributes in order to link to Test Classes and SpecFlow Feature files with Azure DevOps Test Plans/Suites and Cases. The tool's GitHub repo says "This allows a Test Automation Engineer to quickly synchronize their latest work in Visual Studio with Azure DevOps, saving time by automatically creating and linking Test Plans, Test Suites (both static and requirements based) Test Cases and Specflow Test Steps." It earns another perfect 5.0 rating, though it has only three reviews. The last update came in February.
Run Coverlet Report from Chris Dexter is another utility to ease showing code coverage, this one aiming to duplicate Visual Studio Enterprise functionality for free (sorry, Microsoft).
Its description reads: "Run Coverlet Report builds upon the excellent Coverlet and Report Generator tools that allow you to collect code coverage results from unit tests. This extension will run the two tools and then display the report file within visual studio as well as use the Coverlet output to provide syntax highlighting." Coverlet, stewarded by the .NET Foundation, is an open source project providing a cross-platform code coverage framework for C#. Report Generator, according to its GitHub site, converts coverage reports generated by Visual Studio and many other tools into human-readable reports in different formats. Those two tools must be available to use this extension.
With more than 2K installs, this tool was last updated in late March. It garnered yet another 5.0 rating, this time from five reviewers.
Finally, we return to where we started, with unit testing. Test Adapter for Catch2 from Johnny Hendriks is for the C++ crowd, specifically providing a test adapter for working with the Catch2 unit test framework. "Within Visual Studio, the Test Explorer is a convenient way to run and debug unit tests," says Hendriks, adding that his tool adds support for Catch2.
Catch2 v3 is currently in the works, its GitHub site states. Along with Catch2 being a unit testing framework for C++, it also provides basic micro-benchmarking features, along with simple BDD macros.
The extension works with VS 2019 and VS 2017, having been installed 6K times and earning a 4.6 rating from five reviewers. It was last updated in March.