Hi folks.

I have a large (#Drupal) codebase with only the tests that came with core and the contributed modules.

Lots of custom code going on.

Any resources on how/where to start adding all sorts of #tests to start getting a grip on #QualityControl?

Specifically looking for strategies to start adding tests to existing projects that are up-and-running and have many moving parts.

Thanks!

@jpoesen for visual things, try something like diffy. Minimal setup to get started and can be very useful in identifying issues that functional tests won't see.

I'd go top down, either regular browser tests if the separate modules can be tested in isolation or if not, either drupal test traits, behat or a similar framework to run against your regular site. Can be hard to automate in CI as you need a full database.

I'd only add unit tests for specific complex parts where mocking is useful

@berdir @jpoesen A huge improvement can be static code tests as well. It helps a lot to identify code issues. So running PHPCS and PHPStan (with e.g. level 6) helps you identify a lot of issue regarding compatibility with other packages.

@jurgenhaas @berdir Thanks!

At the moment I'm looking into running tests against a staging version of the live site as a whole, so it looks like a combination of VRT and Drupal Test Traits to get me started.

Thanks for the insights.