#Testing

Automating The Arrange Phase With AutoFixture

Published at November 2, 2017 ·  3 min read

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:...


2 Simple Ways To Improve Your Unit Tests

Published at October 3, 2017 ·  6 min read

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....


How to Create Bogus Data in C#

Published at October 1, 2017 ·  6 min read

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....


Making a Master Puppeteer

Published at September 13, 2017 ·  4 min read

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....