Joshua Yates

Joshua Yates

1625544027

DRY TDD with AutoFixture - Enrico Campidoglio

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

Buddha Community

DRY TDD with AutoFixture - Enrico Campidoglio
Joshua Yates

Joshua Yates

1625544027

DRY TDD with AutoFixture - Enrico Campidoglio

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

Ahebwe  Oscar

Ahebwe Oscar

1624074540

DRY Django forms with Python 3.6

django-crispy-forms

The best way to have Django DRY forms. Build programmatic reusable layouts out of components, having full control of the rendered HTML without writing HTML in templates. All this without breaking the standard way of doing things in Django, so it plays nice with any other form application.

django-crispy-forms supports Django 2.2, 3.1 and 3.2 with Python 3.6+.

View Documentation View Github

The application mainly provides:

  • A filter named |crispy that will render elegant div based forms. Think of it as the built-in methods: as_tableas_ul and as_p. You cannot tune up the output, but it is easy to start using it.
  • A tag named {% crispy %} that will render a form based on your configuration and specific layout setup. This gives you amazing power without much hassle, helping you save tons of time.

Django-crispy-forms supports several frontend frameworks, such as Twitter Bootstrap (versions 2, 3, and 4), Uni-form and Foundation. You can also easily adapt your custom company’s one, creating your own, see the docs for more information. You can easily switch among them using CRISPY_TEMPLATE_PACK setting variable.

#form #django #dry django forms with python 3.6 #dry django forms with python 3.6 #dry django

How Effective Teams Use Git - Enrico Campidoglio

Don’t forget to check out our links below!
https://ndcoslo.com/
It’s never been a better time to learn Git. With all those resources available to you—books, tutorials, courses, even podcasts—getting started is easier than ever. Questions? Stack Overflow is ready to help. That’s all great, but once you get past the basics, where do you go to take your knowledge to the next level? How do you learn to get the most out of Git?

The truth is that there is no easy answer; it’d be like asking how to get the most out of Lego! What you can do is observe how others use Git, learn from their experience and apply it to your own. So that’s what I’ve done.

In this session, I’ll share with you what I’ve learned from working with people who’s really good at using Git to be more productive. I’ll show you the things you can do to make Git more pleasant to work with and that allow you to improve how you collaborate with the rest of your team.

Success starts with good habits—by seeing how effective teams use Git in their daily work, I hope you’ll be inspired to pick up a new one.

#git #effective teams #campidoglio

Eva  Murphy

Eva Murphy

1625714820

Comments from scratch for our Video review app using TDD | Laravel TDD 24

Commenting feature is a very important one to allow user engagement in any application. Today, in our application we are going to look at how we can implement a basic commenting feature.

We will first look at how we create the models, migrations and factories. Then, we will write basic tests for the commenting system and make the APIs ready.

And once that is done, we will look at how we can set up the front end to consume the APIs that we have made and get the functionality ready.

Github urls:
https://github.com/amitavroy/video-reviewsAPI: https://github.com/amitavdevzone/video-review-api

App link:
https://video-reviews.vercel.app

You can find me on:
Twitter: https://twitter.com/amitavroy7
Discord: https://discord.gg/Em4nuvQk

#laravel #tdd #video review app

Sam  Richards

Sam Richards

1627234980

Create A RubyGem From Scratch using TDD

Using TDD, we create a simple ‘modularize’ gem

https://github.com/gavinjoyce/modularize

#tdd #rubygem