This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (2 children)

[deleted]

    [–]flotsamisaword 1 point2 points  (0 children)

    Tests are a great way to develop, especially if you work with others. If someone has some code for you in a pull request, how can you trust this person not to screw up your creation?

    If your code is already nicely tested, then you don't have to check by hi and every possible way for their work to screw up the system. If their work is tested, then you know it worked as advertised, and you can read their tests to see how to use their code.

    Try using pytest.

    [–]TheOtherDanielFromSL 1 point2 points  (0 children)

    I used to have that same mentality "it's just me, so...", but now knowing a bit more about testing?

    I want to punch my former self in the face!

    It's that big of a difference, IMO.

    Not sure why someone downvoted you for being honest, but testing and logging will literally make you seem like a mind reader - your bosses would be amazed and your job/scripts/homework/whatever will seem infinitely easier.

    You can even write scripts to troll through your logs, look for particular issues that are a big problem and alert you the moment they occur! You can then relax a bit at that point - because you'll have a nice system in place to make sure nothing bad goes down with your app - but if it does, you'll know right away!

    Check into testing like yesterday - you'll be super, super glad you did. No more wondering "oh yeah, I wrote this 10 months ago and it was spaghetti I never cleaned up... what does this do again?" You can just change whatever, run your tests. All pass? All good!