Automated Testing (IT)QA Automation Team Lead

How does the versioning of automated tests work and how to properly integrate test changes with changes to the main project code?

Pass interviews with Hintsage AI assistant

Answer.

Proper versioning and integration of automated tests are critical to ensure that checks correspond to the current state of the project.

History of the issue

Initially, automated tests were often maintained separately from the main project, leading to incompatibilities and support issues. The evolution of multiple branches, frequent software and test releases created the need for a unified version control system.

Problem

Without versioning and coordinated integration, the following issues arise:

  • Running outdated tests on modified software
  • "Breaking" tests upon the release of new functionality that does not consider changes in tests
  • Failures in CI/CD

Solution

Modern approach:

  • Tests are stored in a common version control system (most often git)
  • Binding the test branch to the software development branch: in the feature branch, tests and code go together
  • Automated checks/builds are carried out on pull requests
  • Review and agreement on changes in tests and code
# General approach: git checkout -b feature/new_login # Feature and tests are developed and tested together # After review, they are merged together into the main branch

Key features:

  • Consistency of code and test changes (no desynchronization)
  • Convenient rollback and version comparison (through git history)
  • Possibility of teamwork and code review of automated tests

Tricky questions.

Can tests be stored in a separate repository (from the project code)?

Yes, but it becomes harder to maintain the relevance of the tests, manual synchronization is required, and there is a risk of "forgetting" to update something during a release or bug fix.

Should tests immediately cover all new functionality when creating a PR?

Ideally - yes, practically it often happens that they cover MVP/main scenarios in the first PR, and complex cases are handled as separate tasks. The main thing is that critical functionality is covered immediately.

Can only test changes be rolled back without rolling back code?

If tests and code are together in one branch - yes, revisions can be rolled back. But it is better to avoid "rolling back" tests without code: this worsens the quality of verification.

Common mistakes and anti-patterns

  • Storing tests not in git, but on file systems
  • Maintaining tests in a separate repository without a clear link to the project
  • Merging tests from outside (post factum), rather than simultaneously with the code

Example from life

Negative case

Project with a separate repository for automated tests. After the release, developers "forgot" to update the tests - tests failed, outdated checks passed, bugs were caught in production.

Pros:

  • Developers could work independently of QA

Cons:

  • Time loss on synchronization, presence of "outdated" tests

Positive case

Tests and project code are maintained in one git branch: with every new pull request, automated tests are invariably updated for the added code. All changes undergo code review and automated checks.

Pros:

  • Quick feedback on the quality of tests
  • Complete consistency of changes

Cons:

  • Requires honest discipline in teamwork and reviews