How to engineer reliable software

Yet another article about TDD.

Ten artykuł jest również dostępny w języku polskim na LinkedIn.

This article is made from the lightning talk that I have presented to my work colleagues.

Image for post
Image for post
Test Driven Development
How to engineer reliable software.

How many vulnerabilities can three lines of code introduce

Image for post
Image for post
Random code in the IDE :)

You have started working on a new project. And from time to time when you are reading the code in the repository you have this (hard to define) feeling. Feeling that something is wrong. So you are going deeper into the code and start playing with it.

Let’s have a look at the following piece of code that I have discovered. It was like this:

router.get('/image/:url', (req, res) => {
request
.get(req.params.url)
.pipe(res);
});

This code had one job: download image(hosted on another website) and sent it to the user on our domain (myDomain.com).

For example, when you would go to the URL:
https://myDomain.com/image/https://another.domain/thepicture.jpg
The users would see thepicture.jpg hosted on another.domain as hosted on your myDomain.com

About

Mateusz Niezgoda

Software engineer #nodeJS #AWS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store