DRY TDD with AutoFixture - Enrico Campidoglio

DRY TDD with AutoFixture - Enrico Campidoglio

DRY TDD with AutoFixture - I'll show you how to write DRY tests by leveraging an open source library called AutoFixture. AutoFixture lets you set up your test scenarios by runtime-generating data that meets your requirements. By not repeating the same boilerplate setup code everywhere, your tests will have minimal coupling to your production code. They will be your safety net while also giving you the freedom to refactor your production code as you see fit.

If you've ever sat down to do TDD, you know the feeling. What should the first test be? Which objects should you create and with what values? Once you pass that initial hurdle, it gets easier. You Red-Green-Refactor your way through the implementation and you see progress. You don't even notice that, soon enough, your tests start to look a lot alike. It's that setup code, which seems to be repeated everywhere with only some minor tweaks.

Sure, you might think that duplication is OK to have in your tests. After all, it's not like you ship them, right? But consider this: every line of test code represents coupling to your production code; the more tests you write, the harder it gets to refactor that code later. So, what do you do? You stop writing tests? Well, no: you keep your tests DRY. In this session, I'll show you how to write DRY tests by leveraging an open source library called AutoFixture. AutoFixture lets you set up your test scenarios by runtime-generating data that meets your requirements. By not repeating the same boilerplate setup code everywhere, your tests will have minimal coupling to your production code. They will be your safety net while also giving you the freedom to refactor your production code as you see fit.

Don't think that's possible? Join me in this session and see for yourself.

testing

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Software Testing 101: Regression Tests, Unit Tests, Integration Tests

How do scientists demonstrate that a drug or vaccine is effective? Putting it to the test. It's your only choice. And, if you're reasonable, you'd never use medications that haven't been thoroughly tested. So, why don't you test software as thoroughly as you should?

Testing Microservices Applications

The shift towards microservices and modular applications makes testing more important and more challenging at the same time. Learn more here.

How to Do API Testing?

API endpoint when you send the get request to that URL it returns the JSON response. In this article, I am going to use postman assertions for all the examples since it is the most popular tool. But this article is not intended only for the postman tool.

Top 10 Automation Testing Tools: 2020 Edition

The demand for delivering quality software faster — or “Quality at Speed” — requires organizations to search for solutions in Agile, continuous integration (CI), and DevOps methodologies. Test automation is an essential part of these aspects.

Where To Learn Test Programming — July 2020 Edition

What do you do when you have lots of free time on your hands? Why not learn test programming strategies and approaches?