Maintainability is the most important value of any developing software product. Maintainability is measured in the working time needed by a new contractor to study a product before it starts making significant changes to it. The more time spent on this, the lower the maintainability. In some projects, this time tends to infinity, which means absolutely unsuitable for any support or modification of the product. We believe that there are 7 fatal errors that lead to the creation of such unsupported products. Here they are.
Unfortunately, all modern programming languages ​​have too much flexibility. They allow too much and prohibit too little.
For example, Java is not opposed to putting an entire application in a single “class” using 5000 different methods. Technically, the application compiles and runs, but this is a well-known antipattern called the Divine Object .
Thus, the anti -pattern is a technically permissible development method, generally known and erroneous. In every language a lot of such antipatterns; their presence in the product is similar to the presence of a tumor in a living organism. As soon as it begins to grow, it is already impossible to stop it. Ultimately, the whole organism perishes. The whole software product becomes non-repairable and must be rewritten.
As soon as you have allowed one anti-pattern, they immediately become more and more, and this “tumor” only grows.
This statement is especially true for
Always try to treat your project with enough skepticism and do not relax if it “just works.” The sooner you diagnose a problem, the easier it is to cure it.
When working with any software product, you should at any time be able to explain what has been changed, who did it and why. Moreover, the time required to get answers to these questions should be measured in seconds. For most projects this is not the case. Here are some practical recommendations:
Always use tickets. No matter how small the project or the team that serves it - even if you work on it in splendid isolation, always use tickets for any problem that arises. Explain in two words the essence of the problem, fix your assumptions. Use the
Link to tickets in commits . There is no need to teach that every commit should be accompanied by a message. Commits without messages is quite a nasty thing; nevertheless, just a message is not enough. Each message must begin with the ticket number you are working on. Many
Do not delete anything. Some
Before delivery to the end user, each software product must be packaged. If it is a Java library, it must be enclosed in a .jar file and unpacked in
The ideal solution is to automate this procedure so that it is possible to execute it from the command line with one command:
Many projects are far from that. The processes of their release are always
There can be only one tip: automate the process.
Static analysis - this is what “combines” the code. By making him look better, we ensure his best work. However, this happens only when the whole team must follow the rules dictated by the static code analyzer.
Be sure to use a code analyzer. In most projects where a code analyzer is used, developers simply make a beautiful report based on it and continue to write code further - just as they did before. Such a “volunteer” approach to static analysis does not do credit to a software project. Moreover, it simply creates the illusion of good quality.
Static analysis should be a mandatory step in the product development pipeline, and its rules should not be ignored.
Test coverage is the degree to which the software passed the integration test. The more coverage, the more code was executed during testing. Obviously, high coverage is a good thing.
However, many developers do not know what their coverage is: they simply do not measure this indicator. It is possible that they conduct
Of course, high coverage is not a guarantee of high quality. But unknown coverage is a clear indicator of problems with the functional reliability of the product. When a project falls into the hands of a new developer, he or she should be able to make
Under the continuous here means development without time frames and releases. No matter what type of software you create, you should often make releases and change it. A project without a clear release history is simply unsupported software confusion. All this is because the ability to support a product is if, for example, we are able to understand you by reading your code.
Looking through the source code and the history of its releases, everyone should be able to determine the intentions of its developer, say, a year ago, what is happening now, future prospects
Some
Each software segment has its own interface through which it is supposed to use it. If it is a
Like all the above, this fact refers to the ability to support the product. Any new programmer begins to study the project from its interfaces, and everyone must understand why an interface is needed and how to use it.
We are talking about documenting for the user, not for the developer. In general, we are against the documentation inside the software: working software is much better than clear documentation for it. But this does not apply to "external" documentation, which is supposed to be used by users.
End-user interactions with software must be documented. If your program is a library, then its end users are developers who do not develop the product, but simply use it as a “black box”.
All of these criteria are used for open source projects.
Source: https://habr.com/ru/post/283366/
All Articles