All Exams Test series for 1 year @ ₹349 only
Question

In the context of Software Configuration Management (SCM), what kind of files should be committed to your source control repository?

A. Code files

B. Documentation files

C. Output files

D. Automatically generated files that are required for your system to be used

Choose the correct answer from the options given below:

The correct answer is

A and B only

Understanding File Commitment in Software Configuration Management (SCM)

Software Configuration Management (SCM) is a crucial process in software development. It involves tracking and controlling changes in the software, which includes managing various files associated with a project. A key part of SCM is using a source control repository, like Git or SVN, to store and manage these files. Deciding which files to commit to the repository is very important for maintaining a clean, efficient, and useful history of the project.

The goal of a source control repository is to store the necessary components that allow you to build or reproduce the software at any given point in its development history. This usually means storing the source files and related assets that are manually created and edited as part of the development process.

Analyzing File Types for Source Control Commits

Let's consider the types of files mentioned in the options and determine their suitability for being committed to a source control repository in SCM:

  • A. Code files: These are the primary source files written by developers (e.g., .java, .py, .c++, .html, .css files). These files are the core of the software and are essential for building the application. Changes to code files are tracked meticulously in SCM. Therefore, code files should always be committed to the source control repository.
  • B. Documentation files: Files containing documentation related to the project (e.g., design documents, user manuals, API documentation source files, README files). Documentation is often developed alongside the code and is necessary for understanding, using, or maintaining the software. Versioning documentation ensures that the documentation stays consistent with the code it describes. Therefore, documentation files should generally be committed to the source control repository.
  • C. Output files: These are files generated as a result of building or running the software (e.g., compiled binaries like .exe or .class files, log files, temporary files, generated reports). These files are derived from the source code and can typically be regenerated by building the project. Committing output files is discouraged because they make the repository large, can cause merge conflicts, and the repository should ideally only contain the inputs needed to produce the outputs. Therefore, output files should typically NOT be committed.
  • D. Automatically generated files that are required for your system to be used: This category often overlaps with output files or temporary files. Examples include compiled code, build artifacts, dependency caches, or configuration files generated by a build process. If a file is *always* automatically generated from committed source code or configuration *without* manual intervention or unique content, it generally should not be committed. The source or configuration that *produces* these files should be committed. Committing such files leads to the same issues as committing output files (size, conflicts, redundancy). Therefore, automatically generated files that can be regenerated from source should typically NOT be committed.

Conclusion on Files for Source Control

Based on the analysis, the files that are fundamental manual creations and necessary inputs for building/understanding the system, and whose changes need to be tracked for collaborative development and history, are typically code files and documentation files.

Output files and automatically generated files that can be derived from the committed source should usually be excluded from the repository. Tools like `.gitignore` (for Git) are used specifically for this purpose to prevent these files from being accidentally committed.

Therefore, the types of files that should generally be committed to your source control repository are Code files (A) and Documentation files (B).

Revision Table: SCM File Types

File Type Should Commit? Reason
Code Files (A) Yes Source code is the core asset; manually created.
Documentation Files (B) Yes Provides context and understanding; manually created.
Output Files (C) No Generated from source; can be rebuilt.
Automatically Generated Files (D) No Typically derived from source; can be regenerated.

Additional Information on SCM Practices

Software Configuration Management is about more than just version control. It includes aspects like build management, release management, and change management. Deciding what goes into the repository is a key decision that impacts the efficiency and integrity of the entire SCM process. Excluding generated files keeps the repository focused on the source materials, making cloning, branching, merging, and history tracking faster and clearer.

Using a file called `.gitignore` (in Git) or similar mechanisms in other SCM systems is standard practice. This file lists patterns of files and directories that the SCM system should ignore, preventing them from being tracked and committed. Common entries in a `.gitignore` file include build directories, dependency directories, log files, temporary files, and editor-specific configuration files.

Was this answer helpful?

Important Questions from Software Maintenance

  1. Software products need perfective maintenance for which of the following reasons?

  2. Which of the following statement(s) is/are true regarding PERT chart in software project management?

    I. PERT charts consists of a network of boxes and arrows.

    II. In PERT chart, the boxes represent activities and the arrow represents task dependencies.

  3. Software reliability is described with respect to

    (A) Execution Time

    (B) Calendar Time

    (C) Clock Time

    Choose the correct answer from the options given below:

  4. Modules X and Y operate on the same input and output, then the cohesion is

  5. Size and complexity are a part of

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App