Brief introduction of Software Engineering
Basic concept
Computer software engineering is a kind of solving engineering. It applies the principles of computer science, mathematics and management science, draws lessons from the principles and methods of traditional engineering, and creates software to improve the quality and reduce the cost. Among them, computer science and mathematics are used to construct models and algorithms, engineering science is used to formulate norms, design paradigms, evaluate costs and determine trade-offs, and management science is used in planning, resources, quality, cost and other management. From the perspective of discipline, software engineering is an engineering discipline that guides the development and maintenance of computer software.
The proposal of software engineering is to solve the software crisis in the 1960s. At that time, there were many problems in large-scale software development, such as high price, difficult to control, difficult to estimate software development workload, low software quality, high project failure rate and so on, which brought great impact to the software industry. The research of software engineering puts forward a series of theories, principles, methods and tools in an attempt to solve the software crisis.
Like other projects, software engineering has its goals, activities, and principles, and its framework can be summarized as shown in figure 16-1.
Figure 16-1: software engineering framework [王立福]
The goal of software engineering can be summarized as “producing products with correctness, availability, and cost”. Its activities include requirements, design, implementation, validation, and support activities around engineering design, support, and management. there are four basic principles:
By selecting the appropriate development model, the variability of requirements can be recognized and controlled to ensure that the software products meet the needs of users.
In order to adopt appropriate design methods, it is usually necessary to consider the characteristics of modularization, abstraction and information concealment, localization, consistency and adaptability of the software.
Provide high-quality engineering support. In software engineering, the support of software tools and environment to software process is very important.
Pay attention to the management of development process and software engineering, which directly affect the effective use of available resources, the production of software products that meet the goals, and improve the production capacity of software organizations. Only when the software process is managed effectively can effective software engineering be realized.
Software engineering activities
Software engineering activities include requirements, design, implementation, validation and support, which correspond to different stages of software development activities. Generally speaking, software development goes through the process from analysis and design to implementation confirmation. To work according to the corresponding specifications in each stage and get the results of this stage is the key to ensure the success of the whole development activity.
Demand analysis
The requirement analysis stage is in the early stage of software development, and its basic activity is to accurately define the goal of the future system and determine what must be done to meet the needs of users. Requirements analysis is divided into two stages, namely requirements acquisition and requirements specification, the former is to describe user requirements clearly in natural language, and the purpose of requirements specification is to eliminate the ambiguity and inconsistency of requirements.
In the software life cycle, the later an error is found, the higher the cost of repairing the error. Therefore, high-quality requirements engineering is the premise that the software project can be completed correctly and efficiently. For system analysts, there are three difficulties in establishing requirements:
With regard to the understanding of the problem space, system developers are usually computer professionals, so it is difficult to deeply understand the problem space to be solved by various business systems.
Communication between people, for system analysts, mainly includes communication with users and colleagues. Because of the ambiguity of natural language, it will cause obstacles to the accurate description of requirements.
With the continuous change of demand, there are many reasons for the demand change, including technology, user side, market and so on. As analysts, we must adopt some strategies to adapt to the change.
Object-oriented analysis method is considered to be a better technology to solve the above difficulties, but complete and accurate description of the problem space is always a challenge for analysts.
System design
Generally speaking, the main task of the requirements analysis phase is to determine what the system “does”, while the design phase is to solve the “how to do” problem. Usually [1]_ The design stage is divided into overall design and detailed design, the overall design determines the overall structural framework of the system; the detailed design should specifically describe how to implement the system, which can usually be coded according to the results of the detailed design. The detailed design includes: detailed algorithm; data representation and data structure; the relationship between the implemented function and the usage data. In the process of detailed design, some tools are used to describe the data and algorithms, including flow chart, PAD (Problem Analysis Diagram), box diagram (Nmurs diagram), pseudo code and so on.
Realization stage
In the software implementation stage, the results of the design should be transformed into programs written by programming languages. In the implementation phase, it is necessary to determine the programming language, and its influencing factors include: the developer’s familiarity with the language, the portability of the language, the efficiency of the compiler, the support of the compiler tools, and so on. At present, C++ language is widely used to construct system software, while Java is more widely used to write network programs.
No matter which programming language is used, it is required to write high-quality source code, which usually includes correctness, readability, portability, program efficiency and other indicators. Considering the maintenance and evolution of the system, improving the readability of the source program is an important goal in the implementation stage, including adding comments, standardizing the writing format, and determining the principle of identifier nomenclature. adopt structured programming (no or reduce the use of Goto statements) and so on.
Confirm activity
Although the confirmation activity runs through the software development activity, the software testing after the completion of the system is the main confirmation activity. Software testing refers to the process of finding software errors according to specific procedures. Generally speaking, the technology of software testing can be divided into two categories, namely, white-box testing technology and black-box testing technology, the former is based on the program logic structure, and the latter is based on the description of software behavior. According to the steps of testing, testing activities can be divided into unit testing, integration testing, confirmation testing and system testing, in which confirming testing is to verify whether the function and performance of the software are consistent with user requirements. System testing is mainly the combination of testing software with hardware, other supporting software, data, etc., in the actual operation, the degree of matching with user needs.
Software maintenance
When the software development is completed and delivered to the user, it enters the operation / maintenance stage, and the software still needs to be modified in the operation / maintenance phase, which is called software maintenance. Software maintenance activities can be divided into the following categories: #. The purpose of corrective maintenance is to correct software errors, performance defects and eliminate misuse in implementation.
Adaptive maintenance, with the development of computers, the external environment or data environment of the software changes. In order to adapt to this change, the modification of the software is called adaptive maintenance.
In the process of use, users often put forward new functional and performance requirements for the software. in order to meet these requirements, the software needs to be modified or redeveloped, which is called perfect maintenance.
The purpose of preventive maintenance is to improve the maintainability and reliability of the software, and to lay a good foundation for further software maintenance. Preventive maintenance is generally carried out by the developer on his own initiative.
Structured method and object-oriented method
In the process of system analysis and design, some systematic methods have been gradually formed to better describe the problem domain and design the system. at present, the two methods often used are structured method and object-oriented method.
Structured analysis and design
The structured method is based on the idea of modularization and uses the technology of “top-down, gradual refinement” to divide the system. Decomposition and abstraction are its two basic means.
Structured analysis regards the software as a data conversion device, which accepts various inputs and produces output through transformation. Data flow Graph (DFD,Data-Flow Diagram) is a tool for describing data transformation and is a common representation method for structured analysis. The data flow diagram consists of five parts, namely, processing, data flow, data storage, data source and data pool, in which the data flow represents the flow of data and data, and processing is the unit of data processing (figure 16-2). In addition to the data flow diagram, data dictionaries and instructions are required to describe the data flow and processing respectively.
The overall design of the structured system is mainly to determine the module structure diagram to describe the relationship between functional modules. Some main representations are: hierarchy diagram, HIPO (hierarchy + input / processing / output) diagram, structure diagram and so on. Structured design defines some principles and methods that can “map” data flow diagrams into module structure diagrams.
Object-oriented analysis and design
According to the object-oriented methodology, the objective world is composed of many various classes, each object has its own internal state and motion law, and the functions and relations between objects constitute a variety of different systems. What the object-oriented methodology pursues is to make the problem-solving space consistent with the problem spatial structure of the objective world. Because object-oriented technology is superior to other methods in understanding problem space, controlling the change of requirements, bridging the gap from analysis and design to coding, and supporting software reuse, it is the mainstream method of software development at present.
At present, many different object-oriented analysis and design methods have been proposed, such as Cord-Yourdon method, Booch method, OMT method, Jacobson use case-driven method and so on. These methods are different in emphasis, symbolic representation and implementation strategy, but their basic concepts are the same, such as object, class, attribute, service, message, inheritance, encapsulation and so on.
In recent years, the integration of Booch method, OMT method and use case’s UML (Unified modeling language, Unified Modeling language) has gradually become the main object-oriented method. Figure 16-3 shows an example of expressing geometry in UML.
Development process model
Software development model is the structural framework of all processes, activities and tasks of software development. The software development model can clearly and intuitively express the software development process, clearly define the main activities and tasks to be completed, and can be used as the basis of software project work.
With the practice of software engineering, a series of development models have been put forward, as follows:
Waterfall model
In the waterfall model, the activities are defined as several stages of work connected in a fixed order, shaped like a waterfall (figure 16-4). The waterfall model is characterized by: each stage accepts the results of the previous stage as input; the output of its work is transferred to the next stage; each stage of work must be reviewed and confirmed before continuing with the next phase of work. The waterfall model supports structured software development well, but it lacks flexibility to clarify imprecise requirements through software development activities.
Figure 16-4: waterfall model
Evolution model
The evolution model is mainly aimed at the software development which can not fully define the requirements in advance. Users can first give the core requirements, when the developers implement the core requirements, users put forward feedback to support the final design and implementation of the system.
Spiral model
The spiral model is a model established by risk analysis on the basis of waterfall model and evolution model. In the process of each evolution of the spiral model, it goes through the following four aspects of activities:
Make a plan-determine the software goals, select the implementation plan, and clarify the constraints of project development.
Risk analysis-analyze the selected options and consider how to identify and eliminate risks.
Implementation of engineering-implementation of software development.
Customer evaluation-evaluate the development work and make corrective suggestions.
Each evolution has developed a more perfect new software version, forming a circle of the spiral model. With the help of prototype, the spiral model can obtain user requirements and carry out risk analysis of software development, which is a quite practical method for the development of large-scale software.
Fountain model
The fountain model embodies the iterative and seamless characteristics inherent in the software development process (figure 16-5). The fountain model shows that software characterization activities need to be repeated many times. For example, before coding, analyze and design again, and add relevant functions to enable the system to evolve. At the same time, the model also shows that there is no obvious gap between activities, for example, there is no clear boundary between analysis and design.
In object-oriented technology, due to the introduction of object concept, the expression of analysis, design and implementation is coherent and consistent, so the fountain model is mainly used to support the object-oriented development process.
Figure 16-5: fountain model
At present, with the development of object-oriented technology and the maturity of UML modeling language, Unified Software Development process (USDP,Unified Software Development Process) is proposed to guide software development. It is a use case-driven, architecture-centric, incremental iterative development process model, which is suitable for software development using object-oriented technology.