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
-
Or having a lot of tests for a product... But:
It's a chaotic mix of unit, functional and acceptance tests
Every test is written in a different style, using different ways to mock/fake things.
Most stuff is tested either dozens of times, or is just testing whether 1 is still equal to 1.
...and it takes a lunch and two cups of coffer to wait for the testing suite to complete. -
@skiilaa Depends on the language.
PHP? https://phpunit.de
Java? https://junit.org
Python? https://pytest.org
JS? http://unitjs.com
Just some examples... there are many ways to write tests.
Unit tests are the most common, they test a "unit" of code (a single function), usually very thoroughly.
Functional tests act more like a user: Click through an app, make automated requests, and test whether data is being stored in the database. They can be "heavy", because they hit a lot of systems and need to simulate a lot of things.
Acceptance tests check whether your product is looking acceptable according to the specifications. It might check if all functionality is implemented, whether buttons are visible, etc.
If you write your unit tests *first*, and then write function to make those tests not fail anymore... that's called test driven development, or TDD. If you write acceptance tests according to user stories and specs, you're getting closer to behavior driven development, or BDD. -
$this->assertEquals('sarcastic', $comments->getPreviousFromUser('skiilaa')->getType());
$this->assertEquals('oblivious', $comments->getPreviousFromUser('bittersweet')->getType());
Ah, that's better. ;) -
Defi4NT14938y@bittersweet your answer was actually very helpful to me since I never wrote any tests (dev is a hobby for now) and I never really looked at the process so thanks mate
Make sense now -
@Gianlu Ah, yeah it's http. Have to try hard now not to make mean jokes about Java devs...
Related Rants
Not writing tests.
Yes we exist.
undefined
wk47