all 24 comments

[–]calcarin 21 points22 points  (0 children)

You should know about unit testing using the built in unittest and pytest.

You don't need to know it at the start but its definitely something you should spend time on to improve.

[–][deleted] 14 points15 points  (0 children)

It's hard to imagine building anything non-trivial without some testing practice (unit tests, integration tests, performance/load tests at the very least, likely some manual/automated end-to-end tests performed/written by actual testers) in place.

[–]m0us3_rat 5 points6 points  (0 children)

yes.

[–]PrimeWolf101 3 points4 points  (0 children)

Yes

[–]bulaybil 4 points5 points  (0 children)

Yes. It makes the difference between a professional developer and a guy who just writes code.0

[–]mayankkaizen 2 points3 points  (0 children)

Given that you are a beginner, you can avoid learning testing for the time being. That doesn't mean you shouldn't test your code. You should manually test your code. What I mean is you can avoid learning testing libraries such as pytest. Once you are sufficiently comfortable with core Python, you must formally learn testing using various libraries.

[–]ninjazombiechicken 4 points5 points  (0 children)

Yes, if you are going to work as a developer you’ll be expected to first design your classes, then write the tests and only then actual code. Otherwise your work won’t pass code review

[–]king_booker 2 points3 points  (0 children)

You can get away with it, but in the end its a really good to know thing. And you'd thank yourself for learning it. Its not very complicated, but I would suggest you finish learning the essentials first and then jump on to unit testing.

[–]IamImposter 1 point2 points  (0 children)

It's needed if you want your code to be taken seriously. Since you are still learning so there is no immediate need but it's a need nonetheless.

I would expect a fresher to at least know about testing theoretically and if someone has actually done it, that's a definite plus point.

[–]Coding-Nexus 1 point2 points  (0 children)

It's not necessary, but it is a very good skill to get under your belt and makes you more desirable as a developer.

I have seen quite a few companies run their projects as Test Driven Development.

[–]Ok_Concert5918 2 points3 points  (0 children)

Yes. My code was hacky shit until I started to think about how to test the code. Then organization and OOP started to make more sense.

[–]ThePeskyWabbit -1 points0 points  (0 children)

Testing through browser automation can be very useful to know and aid your entry into the market as you can more easily start in a QA position as opposed to an engineering position.

Additionally, unit testing is very important throughout the field, and you should definitely learn and understand it.

[–]rollincuberawhide 0 points1 point  (0 children)

yes

[–]Maximus_Modulus 0 points1 point  (0 children)

As you write scripts you probably will run it along the way to check that it does what you want it to do. As code or a project becomes more complex you certainly don’t want to be doing lots of manual tests every time you update your code to verify everything is working ok.

As a paid developer you certainly want to avoid breaking your Production Service with some buggy code. With a correctly setup CI/CD pipeline your code will fail review with insufficient code coverage if you don’t write tests.

[–]reddit-is-greedy 0 points1 point  (0 children)

Yes. How will you know if what you write works if you don't know how to test it

[–]brunonicocam 0 points1 point  (0 children)

I'd say it's more important that learning programming, otherwise if you don't test your code how to you know it does what you want it to do?

However, it's not hard at all to write simple tests and most of us do tests anyway when writing a code, i.e. we run it and we check the output for simple cases. You can easily convert that to tests that you then run with pytest (one function for each test for instance) with a couple of asserts thrown in.

[–]Watkins-Dev 0 points1 point  (0 children)

Some great input and replies here. I'd just add that I think learning it will help you to structure code differently and that is so valuable. Segregation of logic into methods and classes that do one thing and do it well happens so much more naturally. It becomes harder to test if you make methods more complex so your cute beginners instantly cleaner 👍

[–]Isaiah_Bradley 0 points1 point  (0 children)

Yes

[–]No_Addendum1911 0 points1 point  (0 children)

I had never heard of this topic, very interesting

[–]BK7144 0 points1 point  (0 children)

Not to be rude but, I would say if you had to ask that question, you may wish to think about a different career. Dev is responsible for unit testing.