DEV Community

Discussion on: Why do great developers love writing tests?

Collapse
 
anabella profile image
anabella • Edited

Hey Jon! I know in Software engineering we usually accept a lot of things as "revealed truth" and maybe never question them as long as they serve our purpose. I have found testing things thorough automation to be a revealed truth because it helped me work in what I feel is a better way.

And so, I'm curious about some aspects of your workflow, if you don't mind:

  • First of all, what sort of technology do you work with (I mean languages, fwks, etc)?
  • Do you work in a team/s? Or have you?
  • How do you make sure everything works after new features or refactors (big and small)?
  • Do you use/need continuous deployment or integration? If so, how do you ensure that newly deployed/merged code is not breaking any of the old things?
  • do any of these things, if not done by tests, take up a considerable amount of Time?

Just in case: I'm not trying to find a way to prove I'm right, I'm just curious about your context and workflow.

Collapse
 
jonrandy profile image
Jon Randy 🎖️

Technologies I work with:

  • Through most of my web development experience (I've built desktop apps for windows too - Visual Basic back in the day) I have worked with PHP, JS, HTML CSS. In recent years I have also worked with node.js and Ruby. Current projects I am involved with utilise PHP, Ruby, and JS.

Working in teams:

  • I have worked solo and as part of teams large and small. Everything from building my own frameworks from scratch and using them for freelance work; to planning and architecting a large project, hiring my own team, running the project as a lead developer; and working in teams responsible for smaller parts of very large websites. In recent years I have been in larger companies, and have responsibility for a number of smaller projects which I work on mostly solo.

How to make sure everything works?

  • Continuously (manually) testing my work whilst in development, being sure to test all areas that the changed code affects. I'm usually fairly confident that a refactored function will work before I run it (I kind of run code in my head - others do this too, surely?) and usually I find the main reason it doesn't is simply typos. Admittedly the languages I work with allow for very quick changes and re-tests (i.e. no compilation)

Using CI:

  • Yes, at the last few jobs I have had we use CI. Everything is tested again (manually) in a staging environment before going live (a number of people test at this point, and only when all are happy is it pushed to production). I should point out that this is only the projects I have been involved with. Other projects within the organisations have had automated testing, but not all

Testing taking a considerable amount of time:

  • During my development, I would say no, but again as I pointed out - I work with technologies that lend themselves well to a fast change/test process. As for others testing at the staging environment - they are essentially just checking from an end user point of view making sure all functionality is working. I couldn't speak for them as to whether testing slows them down.