Configure CodeScene for Pair Programming

If you use pair programming, CodeScene can adjust the knowledge maps by splitting the code contributions between the members of each pair. CodeScene can deduce the contributing pair from either 1) the commit message, or 2) the author field. The options can be combined.

Configure your pair programming options in the Social part of your project configuration as shown in Fig. 244.

Configure patterns for pair programming

Fig. 244 Configure patterns to extract author information that reflects pair programming.

CodeScene adjusts the knowledge maps by splitting the code contributions between the members of each pair.

The configuration is based on regular expressions with the following constraints:

  1. It must contain at least one match group.
  2. Each match group will map to exactly one author.
Examples on pair programming

Fig. 245 Pair and mob programming annotations in the commit message.

Similarly, CodeScene can also extract author information from the author field in Git. Use the second regular expression for that.

Configuration Examples

Most pair programming patterns contain some kind of delimiter in the commit message. The preceding examples used square brackets for the pair programming info, [ and ], and a pipe | to separate the authors, but CodeScene supports any delimiter like Pair: X,Y or (devs: X/Y).

The most common patterns are:

  • Always a pair: Specify a pattern such that you get two match groups. For example, to match the authors in [Author X|Author Y] you use a pattern like [([ws]+)|([ws]+)].
  • Sometimes a pair, sometimes an individual: CodeScene defaults to Git’s Author information field if it cannot match the configured pattern, so this scenario will work with the previous pattern.
  • All author info is in the commit message: In this case you need to make the second match group optional. For example, to match both the pair [Author X|Author Y] and the single developer [Author X] you specify [([ws]+)|?([ws]+)?].
  • Many authors (a mob): To match more than two authors, we recommend that you introduce even more optional match groups. For example, to match [Author X|Author Y|Author Z] you specify [([ws]+)|?([ws]+)?|?([ws]+)?].

Those more elaborate patterns may be a bit tricky, but it’s a one off configuration so once you have it up and running you won’t see it again.

For pair info that is specified in the author field, the following expression, ([ws]+)s+&s+([ws]+), would match an author field specified as Author: Developer A & Developer B.

Map Aliases for Authors in the Pairs

Finally, note that the preceding examples use aliases for each author instead of their full names. You can map those aliases to real author names using CodeScene’s UI for developer identity aliases.