Exciting times! Build in Melbourne is now open for registrations! Head over to ow.ly/FiE250vvbRF to register your interest. We will be open till Aug 20th at 5pm so get in quick!

The Borg really are pros when it comes to mesh networking.

Had an amazing time at , including speaking at my second ever conference (only counting XConf once).

If writing tests at a layer is hard, consider refactoring or changing your design.

Three key things to take away

Multi Layered
Outside In
Behaviour Driven Development (BDD)

Highest layer can be "flows" - test the flows through the system. With duplicates that lead to same flow, you don't need to test entire flow. So it's almost like a unit acceptance test ("mechanics")

There was no change to app behaviour, only to implementation, which meant there was no need to change the acceptance test. A loosely coupled design.

Swapped out html input field for a react one. But it's not wired up. So let's write some react tests to prove that.

Time to add front-end JS to the app. Time for React! But how does it fit into the layered testing? Test parts of your view (components) in isolation.

So we only need to write more tests at the model level, and can loop over the invalid characters.

All passed, but now there's more scenarios of invalid characters. But there's no need to write more tests at the acceptance level. It doesn't matter which invalid character causes the error, the behaviour at that level is identical.

Now going to implement a unit test at the model to check the validation. Then write code to make it pass.

Oops, found a bug. Go back to the behaviour diagram we made before we wrote our tests. Work out what's missing. Need username validation. Let's write an acceptance test for an invalid username.

Show more
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!