Fuzzers and how to run them.

I am fascinated by the concept of fuzzing. It fits well with my desire to test weird code paths by using more of computer’s time and less that of a programmer. What is fuzzing ? It’s a type of automated testing, especially good with finding edge cases in your code. It runs totally outside of your code and knows nothing about it - it just throws random data at it. [Read More]

Website refresh

Hello ! As you may have noticed - this website looks different now ! Why is that ? I’ve not only changed the visual theme but also a lot of underlying infrastructure. Let’s start with describing the old setup and see where we can improve. The site previously ran on Nikola, was built on Travis and then pushed to Netlify, which I later changed to Github Pages. While it worked it had some issues of its own; [Read More]
nikola  hugo  blog 

Generate Rust tests from data files

Sometimes you just have a bunch of example data laying around and you want to make sure your code works with all of them. Some of them are probably short and sweet and could live happily as doctests, which are amazing btw. But some of them are more awkward to present in such form, because, for example, of their size or number. Typically when you have an example of how the program should behave you write an example-based unit test. [Read More]
rust  tdd  testing 

Testing tricks in Rust

Use verbs as test module names Who said that the test module needs to be named test ? Experiment with different module names, pay attention to how the test runner displays the results. A structure that I like, an example: worker.rs: // some production code here mod should{#[test]fn consume_message_from_queue(){// mock queue, create worker with that queue injected // start worker // check if queue's 'get_message' was invoked }} Cargo prints worker::should::consume_message_from_queue when running this test, which reads nicely and exposes the requirement. [Read More]
rust  tdd  testing 

Rust - controlling side effects from the test.

Rust: controlling side effects from the test. Hello and welcome to the newest episode on testing in Rust. Imagine you want to write a timestamping repository of some sorts, that will associate the timestamp of when the storage operation was invoked with the stored value. How to write it in Rust ? And more importantly - how to test it ? I would like to share a solution I found and talk a bit about how it works. [Read More]
rust  testing  tdd 

Resources for starting your adventure with Rust

As I’ve been running several intro to Rust sessions throughout the last year, I’ve assembled a set of resources that help people ease into the language. Depending on your learning style you might like: Rustlings - This is a good set of starter exercises if you want to have a feeling for the language - have links to relevant book sections for each exercises so you can either start with the book or trying to figure it out yourself first. [Read More]
rust 

I’m running Rust pair programming sessions !

Why ? Rust has such a wonderful community and I want to give back as much as I can. I am not an expert in Rust but I am not a beginner either. In addition to that I love pair programming ! The result is always much better than I could produce myself. I am happy to both share the knowledge and learn. I would love to pair with you ! [Read More]
rust