21.01.2022 Views

Sommerville-Software-Engineering-10ed

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

25.1 ■ Version management 739

Definitive project

repository

1

Alice’s public

repository

3

3

Bob’s public

repository

4

Charlie’s private

repository

2

Alice’s private

repository

2

Bob’s private

repository

Figure 25.7 Opensource

development

Charlie

Alice

Bob

own private repository for testing (3). Once he is satisfied that the changes are

acceptable, he then updates the definitive project repository (4).

A consequence of the independent development of the same component is that

codelines may branch. Rather than a linear sequence of versions that reflect changes

to the component over time, there may be several independent sequences, as shown

in Figure 25.8. This is normal in system development, where different developers

work independently on different versions of the source code and change it in different

ways. It is generally recommended when working on a system that a new branch

should be created so that changes do not accidentally break a working system.

At some stage, it may be necessary to merge codeline branches to create a new version

of a component that includes all changes that have been made. This is also shown in

Figure 25.8, where component versions 2.1.2 and 2.3 are merged to create version 2.4. If

the changes made involve completely different parts of the code, the component versions

may be merged automatically by the version control system by combining the code

changes. This is the normal mode of operation when new features have been added. These

code changes are merged into the master copy of the system. However, the changes made

by different developers sometimes overlap. The changes may be incompatible and interfere

with each other. In this case, a developer has to check for clashes and make changes

to the components to resolve the incompatibilities between the different versions.

When version control systems were first developed, storage management was one

of their most important functions. Disk space was expensive, and it was important to

Codeline 2

V2.0

Codeline 2.1

<branch>

V2.1.1 V2.1.2

<merge>

V2.1 V2.4

<branch>

V2.2 V2.3

Figure 25.8 Branching

and merging

V1.0 V1.1 V1.2

Codeline 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!