There’s absolutely no point doing unit tests if they aren’t done correctly. https://www.expedia.com/’s Senior Software Engineer https://www.linkedin.com/in/lorenzodellarciprete/ recently wrote a helpful https://medium.com/expedia-group-tech/4-ways-to-make-unit-tests-more-effective-3615cc6ba4ec that points out common unit test mistakes that cause some to be ineffective.

Dell’Arciprete offered three tips to make unit testing more effective: testing for exceptions, working with unit test mocks, and using test data rather than production data.

Don’t use production data in unit testing, rather provide regular and edge case parameters for tests either manually or via a data provider (@DataProvider).

While there isn’t a wide delta between useful tests and sorta-useful tests, unit tests are nonetheless incredibly powerful when executed correctly.

Related Articles