Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
dmoen2193yI like the laravel way of writing test methods: "it_doesnt_allow_a_user_to_sign_up_twice()"
Then there is no need for a comment and if the sentence gets to long when writing integration tests, the test should be a unit test and not integration... -
dmoen2193yAlso when it comes to tests: make them readable and forget about all oop rules like single responsibility etc etc.
Tests are all about readability and making sure something works as expected. If you have to copy 10 lines of code for each method in your test then do it if it makes them easier to read. -
Voxera115733yParameterized tests can be a good idea but if not used carefully can be harder to understand.
Making more explicit tests for all edge cases is often more clear but especially if you want a lot of test cases it can be a time saver, especially to begin with.
And later you break out more specifics. -
KDSBest7753y@dmoen then a change request comes in and you fix 100x the copied lines is awful. No need fir OOP, but if you use it 10 times. It deserves a function/method.
parameterized unit tests are often unfucking readable in my opininon
rant