Automating The Arrange Phase With AutoFixture

In a previous article, we refactored a unit test in two ways. The builder and fixture patterns encapsulated an object’s creation, which simplified the arrange phase of a unit test. These two patterns produced a lot of boiler-plate code. It would be nice to never have to create an arrange phase in the first place. AutoFixture tries to produce unit tests with no arrange phase. As the AutoFixture GitHub page describes:...

November 2, 2017 · 3 min · 479 words · Jack Histon

2 Simple Ways To Improve Your Unit Tests

Over the past 20 years, testing has become a cornerstone of software development. To turn software development into a true profession, we need to create robust, secure, safe, and efficient systems. The simplest tool in our toolbox starts us on this road: the unit test. Like an accountant, the unit test is a fantastic way for us to perform double-entry bookkeeping. The unit test double checks our work is correct, and makes sure we keep it from morphing into something we did not want....

October 3, 2017 · 4 min · 825 words · Jack Histon

How to Create Bogus Data in C#

Programmers are lazy. We love tools that automate our lives. Why not automate data? A time-consuming but necessary part of a programmers job is seeding data into a database. Demonstrations, load performance, styling, testing, all need a way to generate data. A rudimentary way of doing this is by hand. Spending days, sometimes weeks, inputting data into a system until it represents a realistic go-live scenario. Once you begin to realise doing it by hand is inefficient, you decide to create a seeding application that does it for you....

October 1, 2017 · 5 min · 862 words · Jack Histon

Making a Master Puppeteer

There are many ways to test a program. From starting miniscule with unit testing, to more grandiose UI testing. Puppeteer falls firmly in the latter category. Puppeteer advertises itself as a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol That is a lot of words. Puppeteer is a walking advertisement of the true potential the Chrome DevTools Protocol has to offer. It oozes ease at the seems, and will leave you with a sense of UI testing in it’s prime....

September 13, 2017 · 4 min · 709 words · Jack Histon