Build Process

Rumman Ansari   Software Engineer   2025-02-14 05:30:00   76  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen
What is a Build?

Build

Activities performed to generatetestinspect and deploy software.


Central Repository
  • All the assets required to build like library, DLLs, configuration files are centralized into the central repository.

To maintain the central repository effectively:

  • Use a consistent directory structure in the central repository, which enables you to retrieve only the required files.
    • Create folders for design, requirement, implementation, testing, and so on.
    • Fetch the required files from the implementation folder for integration build.

Build Scripts

As soon as a change is moved into version control, it is a recommended CI practice to build immediately.

  • Create build scripts (using tools like Maven, Ant)
  • Execute build scripts from an IDE or command line or CI tool
  • Build scripts should not be dependent on the IDE, which means it must be executable from the CI tool if used

Use CI tools to automate the trigger and execute the build scripts on detecting a change.


Build Types

Build is of 3 types, namely:

  • Private Build

  • Integration Build

  • Release Build


Private Build

Run by the developer before committing the code changes to the local version control or work branch.

The sequence of activities performed by a developer are listed as follows:

  • Check out the code from work branch.
  • Perform the required code changes.
  • Get the latest system changes (like database changes) from central repository.
  • Run build jobs that includes execution of unit test cases.
  • Commit changes to the work branch on a successful build.

Integration Build

Integrates changes committed on the work branch with the mainline.

  • Ideal to run integration build on a dedicated machine.

  • Code compilationunit testcomponent testsystem and performance test along with inspections are executed as part of this build.


Release Build
  • Deploys code to the production or end-user.

  • Includes extensive load and performance tests along with user acceptance tests.

  • Triggered by code changes on the mainline or release branch.


Build Mechanism
  • On-Demand: Build initiated manually.

  • Scheduled: Build triggered based on time.

  • Poll for Changes: Build runs after a change is detected by a CI tool.

  • Event-Driven: Build triggered by version control tool based on a change.


Build for any Environment

In order to enable software deployment to different environments, say, for testing purposes, the code must be deployed to various environments.

  • Build scripts should remain the same.

  • Configuration files (like .properties or .include ) helps in differentiating the environments.


Run Fast Builds

Rapid feedback is a key factor of CI.

If the build runs for a longer duration, it may delay the reporting and fixing of errors. So stage the builds (split builds logically).

Create separate build scripts to:

  • Fetch changes from version control and compile.
  • Run unit tests.
  • Run automated processes like integrating the database changes, component tests or system tests, and code inspection.

Do incremental builds (compile only the components changed) when compilation takes a longer duration. But, use it judiciously.


Integrate Database Changes

Any time a database is changed, such as:

  • New objects are created
  • Existing objects are altered
  • Objects are dropped or removed

build the components that are using the database.

As a recommended practice:

  • Incorporate database integration as part of the build
  • Use a local sandbox to test database changes
  • Share the artifacts, like scripts to create, modify, delete, schema, and so on, using a central repository.

MCQ Available

There are 25 MCQs available for this topic.

25 MCQTake Quiz

No Questions Data Available.
No Program Data.

Stay Ahead of the Curve! Check out these trending topics and sharpen your skills.