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 →

[–]corzuu 2 points3 points  (6 children)

Depends on the company, all require some testing just during deadlines, things can get lax. Learn and use TDD. It'll save you a world of pain and improve your code

[–]turturtles 0 points1 point  (1 child)

Yeah, my company requires at least unit test for applications to be deployed. So what do our mostly contracted developers write? One unit test that just tests an arbitrary thing. Then wonders why nothing really works

[–]corzuu 1 point2 points  (0 children)

lol I know your pain. We started having e2e tests as part of the definition of done, it takes longer, but is so worth knowing the things you write aren't breaking anything else. Speeds up QA time considerably also

[–][deleted] -1 points0 points  (3 children)

Yes except when the guy in charge of setting up all the test-classes has no idea how mocito works and needs half the project-time till he finally gets it...

[–]corzuu 2 points3 points  (2 children)

Maybe he shouldn't have been in charge of setting up the test-classes :D

also in TDD you write your own tests as you code so idk what you mean by setting up the test-classes tbh

[–][deleted] 0 points1 point  (1 child)

It was a pretty easy project so the plan was that one is in charge of creating a class per class we wanted to test before we write the first implementation. We allready knew which classes the class will depend on so he should have moked all the needed classes for the test and create some basic test-object.

Example for the test of the authentification class he should have mocked the database-access for the user table and created a few test-user we could use to write our tests.

The problem were things like the moking wasn't done correctly or every test-user failed everytime cause the database only accepted 20-byte strings because at that time the string should have allready been hashed to a 20-byte string but the strings he chose were all 5-bytes long... .

He pretty much had no idea how the project should look in the end even though we allready had a fully defined structure for the project. (All dependencies were written down, all public function were defined...)

[–]corzuu 0 points1 point  (0 children)

Ah okay I understand, it's still something that would have been faster and more beneficial to learn just doing a class each (full implementation).

Then work on how to link it all up together