DEV Community

Discussion on: Why Testing Your Code Is Important

Collapse
 
jwp profile image
John Peters • Edited

I had taken a contract to modernize a large retail app. It was a monolithic mess, poorly documented, and little to no tests.

The first thing found was I inadvertently introduced a number of bugs. Missed all the deadlines and fell out of favor with the product owners.

So I began focusing on writing tests only. After 2 sprints I had gained huge internals knowledge from the tests and was able to deliver top quality work. I left Still not in good favor of product owner but couldn't care less because the ultimate refactoring and new functionality left them with a superior product.

The real issue was in how they allowed this to happen before I was hired, but no one wanted to acknowledge that part.

Collapse
 
simeg profile image
Simon Egersand 🎈

This is a very good point I didn't mention in my post. Writing tests is a good way to learn a new codebase, especially if it's lacking tests. There's really no downsides to writing tests if you do it the right way.