How to determine the quality of the code

How to determine the quality of the code

The quality of products or services is now one of the primary requirements that any company must meet. In such a competitive market it is not enough just to produce and distribute mass products or services, the amount of sales depends on the acceptance by the customer, and this is in turn completely depends on the proposed quality.
But when we talk about software development, the concept of “quality” becomes a bit complex, this is because it cannot be compared to the quality of a traditional product since it has its own measurements and unique ways of determining its value.

While quality is the ability of a product or service to meet the needs of a user when it comes to software development the concept should be analyzed from a qualitative point of view.

Software Quality:
At this point, there are at least two types of quality that can be evaluated: the design quality which refers to the distinctive features that designers specify for an item, and the quality of concordance, which focuses on how the specifications are performed during manufacturing. The quality of concordance will be high when the implementation is guided by the design and this results in a system that offers the best performance.

The quality of software refers to those characteristics that are characteristic of said program and that are seeking to control and ensure. Although unlike traditional products, the software does not degrade over time but does need to be updated. A product such as software may present errors or incidents, so it remains in constant development.

Software Certification:
It is worth clarifying that a software is never certified, what receives a quality certificate are the procedures used for its development. Each of these procedures must be correct and follow standardization parameters such as ISO 9000, CMMI, Moprosoft, among others.

What is the ISO 9000 standard?
The ISO 9000 standard is one of the most recognized in the medium, it gives an account of a system that guarantees quality from a generic perspective, so it can be applied to any company regardless of the services or products it offers.

ISO 9000 has a certifier or auditor that evaluates internal processes to determine whether it complies fully with the regulations or not. If the results are positive, the certification that must be renewed from time to time is delivered through annual interviews where it is guaranteed that the quality match is maintained in accordance with this standard.

Software measurement:
The measurement is used to assign numbers to real attributes, it can also be done by means of symbols, for this, it only requires a measurement model that includes an existing set of standards. When it comes to software development, a measure represents a quantitative indicator that can be derived from the extent, size, capacity, quantity, or size of some attribute of the software or its production process.

The measurement is nothing more than the result of the collection of one or more data. Based on this, the software metric relates these individual measures and manages to develop metrics that result in various indicators.
Indicator means a metric or a combination of them that provide information about the procedures for software development. The indicators provide data that allows software engineers to adjust the process or product so that it improves its quality.

It is clearly necessary to measure and control the complexity in software development, in order to have the ease of developing measurements of different internal attributes of the software. However, before generating and using certain software metrics it is important to ensure that they are capable of assisting in the evaluation of analysis and design models. They must also provide an indication of the complexity of the source code and procedural designs, and, finally, they should make the design of tests easier with better results.

Types of measures:

  • Number of errors during a certain time.
  • Incidents in the coding or design of a system, which causes the software to fail or not work properly.
  • Size of a computer product (lines of code).
  • Melting point metric (IBM): combines features it offers.
  • Cost and effort analysis: COCOMO (Constructive Cost Model).

Software measurement utility:

  • ISO 9126 Standard: is responsible for measuring the quality of software by decomposing attributes or qualities, so as not to have margins of error or interpretation.
  • Functionality quality.
  • Quality of responsiveness to external errors.
  • Security grade attribute. It is not possible for quality to exist without a high degree of safety. It is the end-user who will indicate which attributes are the most important with regard to security.

What types of tests are performed to improve the quality of software?

Unit tests
The developers are almost exclusively responsible for unit tests, their importance is that without them, bugs or errors multiply without control. That is why this type of test is considered the main barrier against bugs in a system, in addition, they are also the basis of the Hyperlink Test. Among its advantages are its ability to expedite the process of changing parts of the code and reporting bugs more quickly, which greatly helps new developers who have just joined a project.

Some people argue that perfect design or good planning can fix many more errors and bugs than unit tests, however, this is not entirely true. Even if a software has the most advanced design, it cannot be guaranteed that it works without problems without the help of these tests or much more advanced tests.

Integration test
In order to verify that the system is really working, it is necessary to use integration test. This type of test is responsible for joining the parts of the system and determining if they fit without incident. Together with the functional tests, they form the basis for behavior driven development. One of its main features is that they do not take into account fundamental elements such as the database, network requests or accesses, therefore they are not sufficient by themselves to check if the software behaves correctly.

The advantages of the integration tests are that they make the system reliable, being able to rely even on the parts protected by other tests because they will have the expected behavior when called by other elements. In addition, these tests serve as protection for developer teams so that the code of other elements does not cause unpleasant surprises.

The Gherkin language used in this type of tests allows to obtain a more complete documentation on how the system works, in this way it is possible to find more quickly and easily what is covered by the tests and what is not.

Functional tests
The functional tests go beyond the integration tests and consist of checking the system as a user would. A good example of this is the automation of graphic interfaces. It should be noted that they are the slowest type of tests and the ones that require the most maintenance.

However, they can offer valuable benefits such as protecting against failed interfaces and reducing processes when performing manual tests. They are used above all to configure and execute them in all environments where the software is distributed.
Its importance is that without this test, developers would have to test all interfaces manually, which is not too efficient.

Learn more about our Software Development methodologies here.

Good practices for Automated Testing

Good practices for Automated Testing

Automated testing has gained increasing popularity in software development companies, as well as in the projects in which they are included, regardless of the industry of the company receiving the service or its nature. As we explained in a previous blog post, the rise of Test Automation is based on a large amount of resources saved by the Testing & QA departments, either in the reduction of labor, as well as in the liberation of time and effort of the Testers, who can reduce the operability to devote themselves to tasks of greater added value, such as testing new or uncovered functionalities in automation.

However, like any discipline, the Automation of Tests implies a series of good practices that must be followed closely, thus achieving that the promise of optimization of resources is fulfilled. Among those good practices found:

Correct assignment of automation processes by degrees
The great part of the testing process in any project is based on the unit tests, then there would be the component test, later the integration and ending with API, assigning less effort in the user interface, which would be the most operational part of the management

By automating the most operational sections of the project, we ignore the most qualified and functional aspects of the project, thus providing the highest value to the user.

Mike Cohn’s pyramid explanation:

Unit Tests
They are used to check the correct functioning of a reduced portion of code, for example, a method. They are the starting point for detecting failures if a test fails at this point, it is likely that the tests of subsequent levels will also fail (integration, API, functional etc.)

API tests, integration of components, services
These tests verify that communication and data exchange between the different modules of the application or with other applications. They serve to detect faults in the way in which the different modules of the application act and integrate with each other.

Graphical interface tests
They require high development time and are slow in execution and with many dependencies with other components. The graphical interface is where changes occur most frequently, so these tests are also usually the most unstable, requiring periodic updating. Yes, it is necessary to automate the GUI tests of the critical functionalities, but it is better to do it after having automated the lower levels of the application.

Determine which GUI tests are fundamental to the project
Not everything can and should not be automated, we must define the test cases that are candidates for taking into account things like validations, usability, accessibility, etc.

What to automate? Critical tests, which do not require human intervention, that give results that can be unequivocally verified, and whose complexity to automate does not exceed the value it can provide.
The issue of selecting the interface tests to automate is a broad topic in itself, so we must focus on those critical areas for the application, which are already closed and that will not change constantly.

Involve the entire team in the testing process
The entire team must be incorporated into the test automation strategy. If testing and development are not in tune, automation will fail. Testing needs the development collaboration to follow certain practices in the development of the application to favor the automation of the tests.

Additionally, the inclusion of various professionals with knowledge in the core of the client’s business will allow to find details and points of improvement in the development, taking into account that this will be used by thousands of end users, who will demonstrate their dissatisfaction with an inefficient application.

Allocate resources with the necessary skills to perform automation
Automation done correctly requires more than simply recording and reproducing UI tests with a tool. Automation must be able to be integrated at the development process level so that it can give real benefits.
A good practice is to have separate roles for the functional tester and who automates tests, combining these two tasks to save resources is the most common option, but it ends up having the opposite effect since these roles that require different skills.

For a couple of years, some companies, such as Microsoft, started incorporating the “Software Development Engineer in Test” or SDET profile whose tasks range from developing and maintaining automated test scripts (not only user interface but also security, loading, performance, etc.) until implementing and maintaining the necessary infrastructure to integrate and run these tests as an integral part of the development process.
This profile is not responsible for functional tests, test plans or test cases at any time, these tasks remain in the hands of manual testers.

Maintain a manual testing team
The objective of test automation is not to eliminate manual testing, nor to supplant testers. What is automated are validations that manual testers have previously detected during regression or smoke testing.
It is incorrect to think that automated tests will find bugs that manual testers have omitted. Remember that these are scripts that simply run steps and verify results, but the script will not verify anything for which it has not been programmed.

Develop a clear and solid testing strategy
Determine the scope of Test Automation: All aspects should be considered when analyzing feasibility. It is also essential to perform a feasibility analysis in the manual test case package that allows automation engineers to design the test scripts.

Select the correct automate test
Tests rely heavily on automation tools. That’s why finding the right test tool automation is a critical phase for a life cycle test automation. When looking for an automation tool, you should consider the budget, the technologies used in the project, the familiarity of your team’s tool with the resources on board, intuition, flexibility and more.

Plan + Design + Testing Strategy
The following is the phase of the automation test life cycle methodology that defines how to address and achieve the objective of test automation. The selection of a test automation framework is the first and most important in the Test Strategy phase of the Automation test life cycle.

Good documentation makes it easy to execute
Once you install the test environment, it is time to run the test script. Then, this phase of the automation test life cycle is dedicated to the execution of all test scripts.

Reporting and analysis of test results
After performing all types of tests, the test team analyzed to identify which functionality or particular component experiences a relative number of problem reports.

Conclusion
There are many variables that determine the quality of automation, for which those responsible for carrying out the development and / or quality tests need to allocate more resources to ensure the quality of development.

We invite you to visit our Testing & QA page to learn more about our methodology and quality of service.