gittestinggit-flow

Git branching strategy integated with testing/QA process


Our development team has been using the GitFlow branching strategy and it has been great !

Recently we recruited a couple testers to improve our software quality. The idea is that every feature should be tested/QA by a tester.

In the past, developers work on features on separate feature branches and merge them back to the develop branch when done. The developer will test his work himself on that feature branch. Now with testers, we start asking this Question

On which branch should the tester test new features ?

Obviously, there are two options:

Testing On Develop Branch

Initially, we believed this is the sure way to go because:

The biggest problems with this is:

Testing On Feature Branch

So we thought again and decided we should test features on the feature branches. Before we test, we merge the changes from the develop branch to the feature branch ( catch up with the develop branch ). This is good:

However, there are some drawbacks


Above is our story. With limited resource, I would like to avoid testing everything everywhere. We are still looking for a better way to cope with this. I would love to hear how other teams handle this kind of situations.


Solution

  • The way we do it is the following:

    We test on the feature branches after we merge the latest develop branch code on them. The main reason is that we do not want to "pollute" the develop branch code before a feature is accepted. In case a feature would not be accepted after testing but we would like to release other features already merged on develop that would be hell. Develop is a branch from which a release is made and thus should better be in a releasable state. The long version is that we test in many phases. More analytically:

    1. Developer creates a feature branch for every new feature.
    2. The feature branch is (automatically) deployed on our TEST environment with every commit for the developer to test.
    3. When the developer is done with the implementation and the feature is ready to be tested they reabse the develop branch on the feature branch and deploy the feature branch that contains all the latest develop changes on TEST.
    4. The tester tests on TEST. When they are done they "accept" the story and merge the feature branch on develop. Since the developer had previously rebased the develop branch on the feature one we don't expect too many conflicts. However, if that's the case the developer can help. This is a tricky step, I think the best way to avoid it is to keep features as small/specific as possible. Different features have to be eventually merged, one way or another. Of course the size of the team plays a role on this step's complexity.
    5. The develop branch is also (automatically) deployed on TEST. We have a policy that even though the features branch builds can fail the develop branch should never fail.
    6. Once we have reached a feature freeze we create a release from develop. This is automatically deployed on STAGING. Extensive end to end tests take place on there before the production deployment. (ok maybe I exaggerate a bit they are not very extensive but I think they should be). Ideally beta testers/colleagues i.e. real users should test there.

    What do you think of this approach?