When users open a website on the Internet, they see a ready product.
But to have a possibility to see the product or use it, it’s needed not only to develop software code but also, build a project and raise it on the application’s server side (and to test it).
Further, we’ll analyze a software build process that can be done either manually or with the help of special applications called build automation tools.
How a build automation tool works
All build automation tools work in the same way.
Common functions are:
- Software code compilation (testing for common syntax errors);
- Directory creation/deletion;
- File structuring.
Of course, there are better programs that help automatically retrieve dependencies in a library or perform automated testing.
But how can a build automation tool understand what a user wants from it?
Only by using linking.
Developers describe in it what a build automation tool must do.
To make it clear, let’s analyze how a build automation tool works using the Ant tool as an example.
This tool is widely used for linking Java projects.
So the Ant linking file is a typical XML document.
Its structure consists of 4 main parts:
All linking files contain a project and one target, at least.
A certain task is located inside the target — what exactly needs to be done by a system if this target is called.
How building should be launched
It primarily depends on the selected build automation tool.
But it’s usually an automation tool’s name and a target’s name launched by a user.
For Ant, it will look like this:
There may be numerous targets:
ant name_of_target_1 name_of_target_2 name_of_name_3
A specific feature of Ant is that a user has the possibility to call a target in any way:
But we need to understand that not only 2-3 testers can work with test cases but also entry-level QA engineers can do this, therefore, a target name should be clear.
So we recommend using common names:
- Clean — project clearing; deleting data that are left after compilation. This helps to make a project look in the same way as in a repository;
- Compile — compiling source software code;
- Test — starting test execution;
- Install — installing packages in a local repository.
Popular build automation tools
For Java — Ant, Gradle, Maven.
.Net — Nant.
Ruby — Rake.
Microsoft Visual Studio — MSBuild.
Instead of conclusion
When a developer writes source code — they simply develop a set of files with certain text.
To transform these files into a working application, it’s needed to take some actions:
- Compile a project;
- Unite classes into the JAR file or another library;
- Install a set of dependencies;
- Launch a certain class or several classes at once.
And only afterwards, a ready software is created.Of course, a set and an order of actions depend on a certain project task.
Actions can be done manually but it’s easier to do this with the help of ready solutions (for example, when you need to urgently provide pen testing services) — namely, by using a build automation tool.
And only in this case, everything will work properly — by running 1 command only.