Software Quality Overview
Among those who provide the same functions, products and services, the competitiveness comes from the diversification of function and the differentiation of service quality, whether individual, enterprise or country.
The service here refers to the function, the degree of realization and processing capacity of the product, and the level of technical support provided by the research/customer service (7x24, responsive, convenient communication, quick resolution, warm hints, effective guides, etc.).
In a sense, everything is served. Functions and products are only forms, service is the essence. The service responds to a demand and thus has the value of being. Individuals, enterprises to provide a certain type of society, a certain degree of service, and to obtain a corresponding return.
Programmers provide services that use available resources and their knowledge, skills, experience, time, energy, resources, and the ability to solve problems and maintain them at the right acceptable development cost, in a specific work environment and enterprise culture, by structuring and organizing real-world problems into the correct logical flow.
- This level of competence encompasses both the ability to serve itself and the capacity to create services through this capacity. The capabilities of the service include: proficiency in the specific language, technology, platform, architecture and other technical depth, combination of technology, products, operations, services, business comprehensive cognitive breadth, with diversified skills (development, writing, foreign language, communication, organization, negotiation, etc.); ability accomplishment, patience, concentration, meticulous, courage, humor, etc. With non-technical expertise, such as sports, music, literature, art, design and so on. The services created by this capability usually refer to software, products, or services.
Every time you solve the top three issues that users care about, don't waste time, energy, and resources on things that matter.
- The first is the function and service, function and service is the core, is the value of existence;
- Next is the design, the design makes the function and the service more outstanding has the attraction, the better use quality;
- Then there is the cost and the spread. Ensure excellent functionality and design based on reduced resource time and labor costs, while good communication and use make marginal costs lower.
How to ensure that the functions and services developed by the server to achieve the desired quality?
- Identify the qualities that need to be achieved, know what to do and how to do it;
- To quantify and measure service quality as much as possible, so as to achieve transparency of service quality;
- More inclined to the emotional factors of service quality, the use of emotional methods to deal with. is not within the scope of this article.
Basic Quality Attributes Correctness:
Whether the software correctly implements the specified functions to meet the diversified needs of customers.
- Draw the business flowchart, subsystem interaction diagram, follow the intent navigation programming method, through decomposition, implementation and connection of a number of closely connected logical units to achieve.
- In the internal implementation, whether the data record is correctly and completely constructed, accessed or destroyed, and does not produce dirty data and invalid data "internal quality".
- The entire process loop of the function implementation needs to be established, with all the details known to Genjiu, and the related services provided by the interactive External system.
- Quantification: Whether the business data is reasonably accessed, and if multiple subsystems are involved, the consistency of the data needs to be ensured.
- Related recommendations:
- Communicate, accurately understand requirements, scenarios and business flow;
- Carefully select the Toolbox, library and framework used for development;
- Common subtasks use recognized mainstream development libraries and carefully test them;
- Complete understanding of the API, including its functions, principles, applications and limitations;
- Specify the use contract and special handling when writing the class/method/function;
- Each class/method/function works in concert with each other.
Performance cost
The software realizes the ability to respond to functions and services and request processing with the specified time and resources available. A measurement or estimate of the error range is required.
- Constructs a single request to measure run time and response time, and constructs a large number of concurrent requests to measure throughput.
- Refer to SLA (Service level Agreement). The efficiency of the execution of the program should be best achieved at an acceptable development cost.
- That said, there is a trade-off between "the time and resource cost of developing a feature" and "the quality that the service is ultimately delivering."
- In general, the higher the quality of services required by the time and resource costs, the endless pursuit of greater efficiency, regardless of cost and service objectives is undesirable.
- The ideal situation is: through the right amount of improvement, technological innovation, management improvement, etc., can make less time and resource costs to achieve higher service quality.
- Quantification: Runtime, required storage resources (number of database records, KV number, cache, file), response time, throughput/concurrency capability (QPS, TPS, UPS).
- Related recommendations:
- The large data volume result set uses multithreading technology to obtain subsets and summarizes;
- Multi-io tasks are handled asynchronously;
- Time-consuming tasks for decomposition/concurrency/asynchronous processing;
- Avoid unnecessary duplication of creation/calculation overhead;
- Delay creation and reuse of large objects that consume memory;
- Time consuming/frequent read operation to make proper use of cache;
- Short-time operation control in 0.5-1s, long-term operation using "asynchronous + Message notification" mode;
- Measure the time, optimize the degree of the hotspot area;
- Measure and improve response time and throughput to achieve a good balance;
- Use better hardware to improve performance;
- Reduce boot load components, load and cache on demand;
- Use asynchronous mode to load and display incrementally;
- Loading and execution separation;
Robustness
The ability of software to respond to errors. The ability to degrade in an unintended environment can capture all error conditions (non-conforming, unintended input, dirty data, etc.) and abnormal situations and give appropriate return information in the expected environment.
- For front-end interactions, you need a friendly, easy-to-understand hint, and for background services, you need a canonical error code and error message.
- The improvement of software robustness requires a lot of error detection, which can lead to the reduction of maintainability. It is best to extract error detection from the main business process and establish a reusable detection library function.
- It is recommended that you establish the correct and complete business master process and then make a thorough elaboration of each link in the main process to find out the various error scenarios and deal with them.
- Quantification: The number of error scenario test cases, and the number of coverage scenarios.
- Related recommendations:
- Error codes and error messages are separated from the code using a configuration file;
- Different types of parameter detection use different parameter validators (usually regular expressions);
- Use the globally uniform error detection function to centralize the detection of errors in one place.
- Subdivide the various anomalies that occur in the application and carry out different processing;
- In the system bottom processing can handle the exception, unable to handle the use of abnormal translation to the top layer;
- Uniformly handle various application anomalies and return friendly hints at the top level of the system;
- Hints and exception messages are placed in the configuration file, separated from the code.
- Error handling Global Framework.
Error detection function registrar: different parameters correspond to different detection functions
Map<paramName, ErrorDetectFunc> errorDetectFuncMap; ErrorMsg ErrorDetectFunc(paramName, paramValue);
Globally uniform error detection function:
def detectError(Map<paramName, paramValue> params) : Map<paramName, errormsg> allErrorMsg = new Map<String, ErrorMsg>(); for (paramName, paramValue) in params: ErrorDetectFunc func = errorDetectFuncMap.get(paramName); ErrorMsg errormsg = func(paramName, paramValue); allErrorMsg.put(paramName, errormsg); return allErrorMsg;
Globally uniform error handling functions:
def ShouldResponse processError(Map<paramName, errormsg> allErrorMsg):
Ease of traceability
The program runs the appropriate amount of log information, easy to track the execution status of the program, quickly troubleshoot the error "Internal quality".
- Identify the critical path and critical state of the business process and record its run-time status for ease of analysis.
- Appropriate and critical INFO logs and Error logs are required for well-formed specifications. Personally, the DEBUG log can eliminate the need by improving the quality of the code.
- Quantification: How long it takes to troubleshoot and locate each problem.
Ease of testing
Mainly unit testing, automated functional testing and performance testing. Unit and functional tests ensure correctness, performance testing guarantees efficiency "internal quality".
- Unit testing requires that a short method, class with a single responsibility be written as much as possible during the development process, and the smaller the code object, the greater the role of unit testing plays.
- Functional testing requires the design of effective test cases, test plans, and test executions for specific usage scenarios.
- Performance testing requires that the time and resources required for business processing be measured, giving the best, worst, and average values. At a minimum, the elapsed time should be measured.
- Quantification: Test coverage of business methods, line of code, branch coverage, test case collection, performance test report.
Security
Avoid leaking important, sensitive, private information, protect business and data from unauthorized access, unauthorized access, and track system access logs.
- Common methods include sensitive information identification and masking, access authorization mechanism, access log Audit, code Vulnerability preparedness.
- Related recommendations:
- User role and permission rating;
- Read-only and operation permissions are separated;
- Confidential data Encryption Protection/rights control/operation restrictions/identity authentication;
- Permission application to join the approval process system;
- Logging of request logs and user operations;
- Request a connection for encryption;
- Avoid displaying the request URL;
- Prevents injection attacks and identifies illegal request patterns.
Extensibility Quality Attributes Scalability
- Modular design of the whole architecture, component service, minimized public service interface;
- Changes are always considered in the design;
- Use configuration parameters to avoid hard coding;
- Write code that is self-contained, self-encapsulated, and does not modify the external state, minimizing dependencies;
- Use design pattern to optimize code expression structure, enhance software "flexibility";
- Document order and dependency relationship, regular collation, update dependencies;
- expression and execution separation, using domain language/rule expression logic, precompiled rules, dynamic generation, configuration, and loading of rules.
Reusability
It is required that the functions, methods, classes, libraries, modules, components, frameworks, etc. in the software can be used multiple times in the same project or in different projects or different products, so as to replace the update "internal quality".
- The minimum requirement is to reuse the same project as much as possible and avoid repeating the code snippet.
- It is best to have no more than 60 rows per business method.
- There is a reasonable abstraction for each knowledge point, business point, and fact.
- Quantification: The number of repeating code snippets, functions, methods, classes, libraries, modules, components, and the number of times the framework is reused.
Maintainability
Requiring software to be easily understood and easily modified to meet new requirements, the system should typically have a modular, high cohesion, loosely coupled feature "internal quality".
Easy to understand
- Support for reusability is required, and the code is required to be as semantic and detail-independent as possible, self-explanatory, and appropriately annotated, using idioms.
- The separation of semantic and detail "refers to the expression intention of high-level code, low-layer code rendering details;" Self-explanatory power "means that code can be words too literally by proper variables and functions;
"Appropriate notes" need to indicate code intent and design ideas as an effective guide to understanding the code; "Idioms" is a common pattern of code that facilitates quick browsing and comprehension.
It is easy to modify the collection of code needed to quickly locate a functional service, requiring the code to have a good organization and implementation structure, avoid making the same or similar changes to multiple places, and avoid making drastic changes to the original overall design.
Please refer to the book "Agile Software Development: principles, patterns and practices" as much as possible to meet the five design principles (SRP, OCP, LSP, DIP, ISP), to achieve the "close to modification, open to expansion" realm. That is, the development of new requirements, as far as possible only to increase the code, without the need to modify the original code.
Quantification: Understanding the length of time a feature requires, modifying or extending a line of code to which a feature needs to be modified.
Global Quality attributes Stability
The program runs consistently and consistently for a long time to deliver the right, consistent service.
- Request the program to use and release resources rationally, monitor the running state of the program and find out the abnormal situation in time.
- For high concurrency scenarios, it is necessary to use appropriate techniques for triage, to process or reject requests in a timely manner, and to avoid service crashes due to excessive resource consumption.
- Quantification: The duration of a program's continuous availability, high concurrency capability.
- Related recommendations:
- Ensure the operating environment of the software is normal and stable, including hardware, operating system and dependent system;
- Software can effectively cope with environmental fluctuations (such as network outages) without termination;
- The influence of the external system service call is localized, which does not affect the whole operation;
- The System Component Service module affects the localization, does not affect the whole operation;
- Avoid memory leaks, dead loops, deadlocks and other problems that can cause a program to crash;
- Bulk resource release issues to be examined carefully, whether the memory leaks due to errors or exceptions;
- Operation failure can be rolled back;
Reliability
Services are recoverable and replaceable in severe error situations, avoiding single points of failure, guaranteeing availability, and ensuring the correctness and completeness of user data.
- It mainly includes service redundancy, fault tolerance, backup, monitoring, self-detection and recovery mechanism.
- Quantification: Whether the service is available when an error occurs, or if it can be recovered from the error.
- Related recommendations:
- Load balancing avoids single point of failure;
- Emergency response of primary and standby disaster;
- High load/performance testing;
- Add system monitoring to show the health of system metrics/services/resources within a specified time interval.
Ease of Use
Ease of use is a measure of how easily users are using the product. A front-end area that is typically used to describe the user experience. However, the service side also has the concept of usability.
- Service-side usability, in-depth embodiment in the interface, library methods are easy to learn and use, whether easy to misuse, misuse, the superficial level is reflected in the code layout is pleasing and readable, code style is consistent and beautiful.
- Related recommendations:
- The accuracy and richness of knowledge and information, in line with or exceeding expectations;
- The guiding design, correctness and comfort of the operation;
- Appearance and design of the practical aesthetics, pleasing;
- Use animations or add interesting content to weaken the effect of waiting time;
- Use the change effect to prompt the user that the request has been sent and is being processed.
Elastic Scaling
Services can improve service capacity (throughput) by simply deploying on more machines, reducing costs by reducing machine deployment.
- Support is required from the architecture design. Request processing is as stateless as possible.
- Quantification: The ratio of concurrent request processing volume to machine count.
- Horizontal scaling: Increase the number of logical unit resources and make them work as a whole, such as clustering, distributed, load balancing;
- Vertical scaling: Add resources in the same logical unit to increase capacity, such as increasing CPU, memory, and disk space.
Portability
The software is able to operate consistently and correctly in a variety of operating environments and platforms with little or no modification required.
- Reduce the use of non-standard behavior by using portable languages and platforms, and by complying with standard interfaces and behaviors as much as possible when implementing features and services;
- Provide interfaces at the bottom to unify the differences between different platforms, and use a unified interface at the top to avoid processing platform details.
- Portability is best taken into consideration at the beginning of the system's construction, such as the initial adoption of PHP and subsequent porting to Ruby, Python or the Java platform.
- Quantification: The lines of code needed to migrate from one language to another or from one platform to another.
- Related recommendations:
- Use abstractions to mask differences between different platforms;
- Use the cross-platform SDK;
- As far as possible to comply with portable standards;
- Use standard notation whenever possible;
- Responsive design.
Operational dimension
After the service is released, manage the difficulty and speed of running large-scale services, troubleshooting/troubleshooting, and handling user feedback.
- What are the issues that may arise after a service is released? How to troubleshoot? How big is the scale of the service? What is the degree of concurrency?
- In service development, it is necessary to avoid the generation of low-level problems, reduce the workload caused by low-level errors;
- For difficult problems, you need to provide critical log information/operational documents for easy troubleshooting;
- For large-scale service operations, the usual approach is to monitor, alarm, and visualize.
- Quantification: Refer to the quantitative standard of operation and maintenance.
Customizable/Hot Upgrade
Whether it is easy to tailor the customer's specific needs, whether the service upgrade can not affect the user's normal use as far as possible.
- Modular application and system services components;
- Each standalone component has an identity that identifies whether it can be displayed/loaded;
- The configuration file specifies the modules and components that can be displayed/loaded when starting or initializing;
- Use a timed job or a time-bound caching mechanism to load the configuration file;
- Use the Observer mode to detect changes in configuration and reload the configuration into the app;
- When detecting configuration changes, external commands can be sent to the application system to trigger its reload configuration;
- Provide interface to modify configuration file parameters and update the application and configuration files in real time (there may be security risks);
- Use global singleton managers to dynamically display/hide and dynamically load/unload modules based on changes in configuration files;
- Use the policy mode to flexibly replace and toggle modules with the same functionality, using abstractions to extract their public usage interfaces.
Interoperability
How easily the software interacts with other systems. Mainly including communication mode, version compatibility.
Reference articles
- Guaranteeing Web services with SLAs
- Software Quality Model
- Elaborate software quality indicators
- Tactics of implementing quality attributes of software architecture
- Reusability: Special Topics
- Scalability Best Practices: experience from ebay
- The usability of software design
Service quality of service-side software