DEV Community

Cover image for Tips to write automated tests with High-quality

Tips to write automated tests with High-quality

Alicia Marianne on March 22, 2024

Automated tests is something very common in our days, but only write automated tests isn't enough if you want to stand out in the job market, durin...
Collapse
 
cherryramatis profile image
Cherry Ramatis

Really nice topic around good written tests, I'm always trying to think about this specially now that i'm working with legacy codebases and big refactors.

On the topic of mocks for test quality, what are your opinions ? at what point the test uses too much mock and stop being useful or good?

Collapse
 
m4rri4nne profile image
Alicia Marianne

I like mock data when you are validating only the design or when you need to test only the front-end part, like the flows and things like this. You can use them for component tests, they'll be more fast than doing all the integration. But you can adjust for your scenario.

Collapse
 
theplebdev profile image
Tristan Elliott

If possible, please provide code examples of high vs low quality of tests. Thank you.

Collapse
 
m4rri4nne profile image
Alicia Marianne

Hi I'm preparing a pratical tutorial implementing this concepts.