Author Archives: Joost

sinon vs rewire: when do I use which?

In node.js testing, there are 2 helper modules that I use often: sinon and rewire. Sinon allows you to monkey-patch functions, while rewire allows you to… monkey-patch functions. Both modules have other uses as well, but in this post I’m … Continue reading

Posted in JavaScript, node.js, software development, testing | Tagged , , , , , , , | 1 Comment

Automated software testing part 6: stubbing

Previous: part 5 You can also find the code below in the src/unit-test-4   dir of my blog code repository. In the previous post, we talked about spying. With a test spy, you can spy on method calls and see how … Continue reading

Posted in software development, testing | Tagged , , , , , , , , | Leave a comment

Automated software testing part 5: spying

Previous: part 4 – Next: part 6 You can also find the code below in the src/unit-test-3  dir of my blog code repository. Spying sounds really cool. I have to disappoint you. Unfortunately (or maybe not), spying in the world of unit … Continue reading

Posted in software development, testing | Tagged , , , , , , , | Leave a comment

Automated software testing part 4: combining similar tests

Previous: part 3 – Next: part 5 You can also find the code below in the src/unit-test-2   dir of my blog code repository. Today, you have been asked by your uncle to help him set up the new MegaBanana Slide in his Fun … Continue reading

Posted in software development, testing | Tagged , , , , , , , , | Leave a comment

Automated software testing part 3: writing tests, and refactoring

Previous: part 2 – Next: part 4 In this post, we will look at the process of writing unit tests for existing code. In the process, we will be refactoring the code to make the tests easier and clearer – and … Continue reading

Posted in software development, testing | Leave a comment

Automated software testing part 2: testing strategy, or what to test

Previous: part 1 – Next: part 3 If you have done or read anything about unit testing, I’m sure you’ve encountered the standard example of a function that multiplies two numbers and returns the result. This function is pretty easy to test. Once … Continue reading

Posted in software development, testing | Tagged , , , , , | Leave a comment

Automated software testing part 1: why should you test?

Next: part 2 This is the first post in a series about automated testing of software. A long time ago, before I started my professional software development career, I had no experience with unit testing, or any type of automated … Continue reading

Posted in testing | Leave a comment

Evaluating decisions afterwards, or results-oriented thinking in real life

In your life, you have to make a lot of decisions. Most of the time, there are uncertain factors in your decisions, because they have to do with the future. For example: Shall I buy insurance for my new, expensive bicycle? At what … Continue reading

Posted in life | Tagged , , , , , , , , , | Leave a comment

Expiring temporary information

Imagine you are a developer, working on a backend system with reservations. A new requirement comes up: if a reservation is not paid within 24 hours, it needs to be expired. Your reservation table already has a field creationDate . So … Continue reading

Posted in design, software development | Tagged , , , , | Leave a comment

Paybox integration using node.js – with example HTML

This post will help you get Paybox integration to work using node.js. You can find a full working example in the src/paybox-integration dir of my blog code repository. Paybox is a French payment provider. Getting their integration to work can be quite a … Continue reading

Posted in JavaScript, node.js, software development | 1 Comment