Visual regression testing is the last part I write about the NDC Oslo 2020 workshop Front End Web Fundamentals hosted by Amy Kapernick (@amys_kapers). This kind of testing is a nice extension to my testing toolbox and can help you to get an alarm when you unintentionally change your user interface.
We use Selenium and Firefox to verify our BDD specifications. That combination worked well until the last update to Firefox 75. Instead of our application on the developer machine, Firefox only showed us the "Your connection is not secure error" overlay. We depend on fast feedback cycles and needed a solution quickly.
One of the most important concepts of object-oriented design is encapsulation. You try to hide all the internal things of a class from the other developers and only offer them a subset of functionality to use. You can achieve this by setting an appropriate access modifier for your methods and classes:
public: The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private: The type or member can be accessed only by code in the same class or struct.
protected: The type or member can be accessed only by code in the same class, or in a class that is derived from that class.
internal: The type or member can be accessed by any code in the same assembly, but not from another assembly.
protected internal: The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. (as in protected OR internal)
private protected: The type or member can be accessed only within its declaring assembly, by code in the same class or in a type that is derived from that class. (as in private OR protected)
Behavior-driven development (short BDD) is all about examples. They are used to explain what should happen when certain events occur and what exactly the meaning of a certain requirement is. So far all is simple and straight-forward. The challenges come with writing those examples. There are different ways to express the same ideas and not every style works with every audience.
The SSMS Tools Pack created by Mladen Prajdić is a great extension for the SQL Server Management Studio. In this post I will explain how you can use it to create test data from a small subset of your production database.
Suddenly, NUnit stopped working. We were in the middle of our refactoring, moved code around and ended up with all our tests being ignored. We rebuild the solution – no errors detected. We run our application – no problems at all. We even rebooted the machine. Everything worked except our tests:
Exploratory testing is a great way to find bugs of any sorts. However, after an hour of testing all possible edge cases you don’t know what you tried and what not. Rapid Reporter is a great helper to keep track of your activities.
I am currently learning the xUnit.net framework as part of a new project I work on. For the last years I used NUnit for my unit and integration tests. Conceptually those two libraries aren't that different. However, the naming of attributes and what is possible in sharing setup & clean-up code makes it worth to take a deeper look.
I am currently learning the ins and outs of the FakeItEasy mocking framework. I know my way around Moq, a simple and easy to use framework for the same purpose. This cheat sheet has examples for the most common use cases and explains the differences to Moq.
Using a local build server with Visual Studio Team Services (VSTS) is not that complicated. The build agent and a community edition of Visual Studio is all you need to get started. However, there is a little catch with this setup: You don’t get test coverage for your unit tests.