Processes and stages of the software life cycle. Software life cycle. Stages and stages. Scope of the Waterfall Model

Life cycle software(Software) - a period of time that begins from the moment a decision is made on the need to create a software product and ends at the time of its complete withdrawal from service. This cycle is the process of building and developing software.

Stages life cycle :

2. Design

3. Implementation

4. Assembly, testing, testing

5. Implementation (release)

6. Escort

There are 2 cases of software production: 1) Software is made for a specific customer. In this case, you need applied task turn into a programmer. You need to understand how the environment that needs to be automated (business process analysis) functions. As a result, a documentation-specification of the requirement appears, where exactly which tasks should be indicated. resolved and under what conditions. This work is performed by a systems analyst (business process analyst).

2) The software is developed for the market. It is necessary to carry out marketing research and find what product is not on the market. This is associated with great risk. The goal is to develop a requirements specification.

Design

Purpose - Definition general structure(architecture) software. The result is a software specification. The system programmer does this job.

Implementation

Writing program code. Implementation includes development, testing, and documentation.

Assembly, testing, testing

Assembling everything that has been done by different programmers. Testing of the entire software package. Debugging - finding and eliminating the causes of errors. Test - refinement technical characteristics... As a result, the program is guaranteed to work.

Implementation (release)

Implementation - when they work for one customer. It includes setting up the program at the customer's place, training the customer, consulting, eliminating errors and obvious shortcomings. The software should be alienated - the user can work with the software without the participation of the author.

Release - when the software is developed for the market. It starts with the beta testing phase. Corresponding version - beta version. Alpha testing is testing by people from the same organization who have not participated in the development of the programs. Beta testing - making several copies of the software and sending it to potential customers. The goal is to double-check the software development.

If a fundamentally new software is released to the market, then several beta tests are possible. After beta testing - release of the commercial version.

Escort

Elimination of errors noticed during operation. Making minor improvements. Accumulation of proposals for the development of the next version.

Life Cycle Models

1. Waterfall ("waterfall", cascade model)

2. Prototyping

First, it is not the software product itself that is developed, but its prototype, which contains the solution to the main problems facing the developers. After the successful completion of the prototype development, the present software product is developed according to the same principles. The prototype allows you to better understand the requirements for the developed program. By using the prototype, the customer can also formulate their requirements more precisely. The developer has the opportunity to present the preliminary results of his work to the customer using a prototype.

3. Iterative model

The task is divided into subtasks and the order of their implementation is determined, so that each subsequent subtask expands the capabilities of the software. Success essentially depends on how well tasks are divided into subtasks and how the priority is chosen. Advantages: 1) the possibility of active participation of the customer in the development, he has the opportunity to clarify his requirements during the development; 2) the ability to test newly developed parts together with previously developed ones, this will reduce the cost of complex debugging; 3) during development, you can start implementation in parts.

Software life cycle

The life cycle of software is a period of time that begins from the moment a decision is made on the need to create a software product and ends at the moment of its complete withdrawal from service. (IEEE Std 610.12 standard)

The need to determine the stages of the software life cycle (LC) is due to the desire of developers to improve the quality of software through optimal development management and the use of a variety of quality control mechanisms at every stage, from the setting of the problem to the author's support of the software. The most general representation of the software life cycle is a model in the form of basic stages - processes, which include:

System analysis and justification of software requirements;

Preliminary (sketch) and detailed (technical) software design;

Development of software components, their integration and software debugging as a whole;

Testing, trial operation and software replication;

Regular software operation, maintenance support and analysis of results;

Software maintenance, its modification and improvement, creation of new versions.

This model is generally accepted and corresponds to both domestic regulatory documents in the field of software development and foreign. From the point of view of ensuring technological safety, it is advisable to consider in more detail the features of the presentation of the stages of life cycle in foreign models, since it is foreign software that is the most likely carrier of software defects of a sabotage type.

Software lifecycle standards

GOST 34.601-90

ISO / IEC 12207: 1995 (Russian analogue - GOST R ISO / IEC 12207-99)

The graphic presentation of life cycle models allows you to visually highlight their features and some properties of processes.

Initially, a cascading life cycle model was created, in which major stages began one after another using the results previous works... It provides for the sequential execution of all stages of the project in a strictly fixed order. The transition to the next stage means the complete completion of the work at the previous stage. Requirements identified at the stage of requirements formation are strictly documented in the form terms of reference and are recorded for the entire duration of the project development. Each stage ends with the release of a complete set of documentation sufficient for development to be continued by another development team. The inaccuracy of any requirement or its incorrect interpretation, as a result, leads to the fact that you have to "roll back" to the early phase of the project and the required revision not only knocks the project team off the schedule, but often leads to a qualitative increase in costs and, possibly, to the termination of the project in the form in which it was originally conceived. The main misconception of the authors of the waterfall model is the assumption that the project goes through the entire process once, the designed architecture is good and easy to use, the implementation design is reasonable, and implementation errors are easily eliminated as testing progresses. This model assumes that all errors will be concentrated in the implementation, and therefore they are eliminated evenly during the testing of components and the system. In this way, waterfall model for large projects is not very realistic and can be effectively used only for creating small systems.

The most specific is the spiral life cycle model. In this model, attention is focused on the iterative process of the initial design stages. At these stages, concepts, requirements specifications, preliminary and detailed design are sequentially created. At each stage, the content of the work is specified and the appearance of the software being created is concentrated, the quality of the results obtained is assessed and the work of the next iteration is planned. At each iteration, the following are evaluated:

The risk of exceeding the terms and cost of the project;

The need to perform one more iteration;

The degree of completeness and accuracy of understanding the requirements for the system;

Feasibility of terminating the project.

Standardization of software lifecycle is carried out in three directions. The first direction is organized and promoted by the International Organization for Standardization (ISO - International Standard Organization) and the International Electro-technical Commission (IEC - International Electro-technical Commission). At this level, the standardization of the most general technological processes that are important for international cooperation is carried out. The second direction is being actively developed in the USA by the Institute of Electrotechnical and Electronics Engineers (IEEE) jointly with the American National Standards Institute (ANSI). The ISO / IEC and ANSI / IEEE standards are mostly advisory in nature. The third area is being stimulated by the US Department of Defense (DOD). DOD standards are binding on firms commissioned by the US Department of Defense.

For software design complex system, especially real-time systems, it is advisable to use a system-wide model of life cycle, based on the combination of all known works within the framework of the considered basic processes. This model is intended for use in planning, scheduling, managing various software projects.

It is advisable to divide the set of stages of this model of life cycle into two parts, significantly differing in the characteristics of the processes, technical and economic characteristics and factors influencing them.

In the first part of the life cycle, system analysis, design, development, testing and software testing is carried out. The range of works, their labor intensity, duration and other characteristics at these stages significantly depend on the object and the development environment. The study of such dependencies for various classes of software makes it possible to predict the composition and main characteristics of work schedules for new versions of software.

The second part of the life cycle, reflecting support for the operation and maintenance of software, is relatively weakly related to the characteristics of the object and the development environment. The range of work at these stages is more stable, and their labor intensity and duration can vary significantly, and depend on the massive use of software. High quality assurance for any model of life cycle software systems possible only when using the regulated technological process at each of these stages. Such a process is supported by development automation tools, which are advisable to choose from the available ones or create, taking into account the development object and an adequate list of works.

It should start by definingSoftware life cycle(Software Life Cycle Model) is a period of time that starts from the moment of making a decision to create a software product and ends at the moment of its complete retirement. This cycle is the process of building and developing software.

Software Life Cycle Models

The life cycle can be represented in the form of models. Currently, the most common are:cascading, incremental (step-by-step model with intermediate control ) and spirallife cycle models.

Cascade model

Cascade model(eng. waterfall model) Is a model of the software development process, the life cycle of which looks like a flow that sequentially passes through the phases of requirements analysis and design. implementation, testing, integration and support.

The development process is implemented using an ordered sequence of independent steps. The model assumes that each subsequent step begins after the complete completion of the previous step. At all steps of the model, auxiliary and organizational processes and work are performed, including project management, assessment and quality management, verification and validation, configuration management, and documentation development. As a result of the completion of the steps, intermediate products are formed that cannot be changed in subsequent steps.

The life cycle is traditionally divided into the following mainstages:

  1. Requirements analysis,
  2. Design,
  3. Coding (programming),
  4. Testing and debugging,
  5. Operation and maintenance.

Advantages of the model:

  • stability of requirements throughout the entire development life cycle;
  • at each stage, a complete set of project documentation is formed that meets the criteria for completeness and consistency;
  • certainty and comprehensibility of the steps of the model and the ease of its application;
  • the stages of work carried out in a logical sequence allow you to plan the timing of completion of all work and the corresponding resources (monetary, material and human).

Disadvantages of the model:

  • the complexity of the clear formulation of requirements and the impossibility of their dynamic change during the entire life cycle;
  • low flexibility in project management;
  • sequence linear structure the development process, as a result, returning to previous steps to solve emerging problems leads to increased costs and disruption to the work schedule;
  • unsuitability of the intermediate product for use;
  • impossibility of flexible modeling of unique systems;
  • late detection of assembly problems due to the simultaneous integration of all results at the end of development;
  • insufficient user participation in the creation of the system - at the very beginning (when developing requirements) and at the end (during acceptance tests);
  • users cannot be sure of the quality of the product being developed until the end of the entire development process. They do not have the opportunity to assess the quality, because you cannot see the finished product of development;
  • there is no way for the user to gradually get used to the system. The learning process takes place at the end of the life cycle, when the software has already been put into operation;
  • each phase is a prerequisite for the implementation of subsequent actions, which makes this method a risky choice for systems that have no analogues, because it defies flexible modeling.

It is difficult to implement the Waterfall Life Cycle Model due to the complexity of software development without returning to the previous steps and changing their results to eliminate emerging problems.

Scope of the Waterfall Model

The limitation of the scope of the waterfall model is determined by its disadvantages. Its use is most effective in the following cases:

  1. when developing projects with clear, unchangeablelife cycle requirements, clear implementation and technical methodology;
  2. when developing a project focused on building a system or product of the same type as previously developed by developers;
  3. when developing a project related to creation and release new version an existing product or system;
  4. when developing a project related to the transfer of an existing product or system to a new platform;
  5. when performing large projects involving several large development teams.

Incremental model

(stepwise model with intermediate control)

Incremental model(eng. increment- increase, increment) implies the development of software with a linear sequence of stages, but in several increments (versions), i.e. with the planned improvement of the product for the entire time until the Software Development Life Cycle comes to an end.


Software development is carried out in iterations with feedback loops between stages. Inter-stage adjustments make it possible to take into account the really existing mutual influence of development results at various stages, the life time of each stage is stretched over the entire development period.

At the beginning of work on a project, all the basic requirements for the system are determined, subdivided into more and less important. After that, the system is developed according to the principle of increments, so that the developer can use the data obtained in the course of software development. Each increment should add some functionality to the system. The release starts with the highest priority components. When the parts of the system are defined, they take the first part and begin to detail it using the most appropriate process. At the same time, it is possible to clarify the requirements for other parts that were frozen in the current set of requirements of this work. If necessary, you can return later to this part. If the part is ready, it is delivered to the client, who can use it in work. This will allow the customer to clarify the requirements for the following components. Then they develop the next part of the system. The key steps in this process are to simply implement a subset of the program requirements and refine the model in a series of successive releases until the software is fully implemented.

The life cycle of this model is typical for the development of complex and complex systems for which there is a clear vision (both from the customer's side and from the developer's side) of what the final result should be. Version development is carried out for various reasons:

  • the customer does not have the opportunity to immediately finance the entire expensive project;
  • the developer lacks the necessary resources to implement a complex project in a short time;
  • requirements for phased implementation and product development by end users. The introduction of the entire system at once can cause rejection among its users and only "slow down" the process of transition to new technologies. Figuratively speaking, they can simply “not digest a large piece, so it must be crushed and given in parts”.

Dignity and limitationsthis model (strategy) is the same as that of the waterfall (classical life cycle model). But unlike the classical strategy, the customer can see the results earlier. Already based on the results of the development and implementation of the first version, he may slightly change the requirements for the development, abandon it or offer the development of a more perfect product with the conclusion of a new contract.

Advantages:

  • the costs that are incurred due to changing user requirements are reduced, reanalysis and the collection of documentation are significantly reduced compared to the waterfall model;
  • it is easier to get feedback from the client on the work done - clients can voice their comments on the finished parts and can see what has already been done. Because the first parts of the system are the prototype of the system as a whole.
  • the customer has the ability to quickly acquire and master the software - customers can get real benefits from the system earlier than would be possible with the waterfall model.

Disadvantages of the model:

  • managers must continually measure the progress of the process. in the case of rapid development, you should not create documents for every minimal version change;
  • the structure of the system tends to deteriorate when new components are added - constant changes violate the structure of the system. It takes additional time and money to refactor to avoid this. Poor structure makes the software difficult and costly to change. An interrupted software life cycle leads to even greater losses.

The scheme does not allow for prompt consideration of emerging changes and clarification of software requirements. Coordination of development results with users is carried out only at points planned after the completion of each stage of work, and General requirements to the software are fixed in the form of technical specifications for the entire time of its creation. Thus, users often receive a PP that does not meet their real needs.

Spiral model

Spiral model:Life cycle - at each turn of the spiral, the next version of the product is created, the requirements of the project are clarified, its quality is determined, and the work of the next turn is planned. Special attention is given to the initial stages of development - analysis and design, where the feasibility of certain technical solutions verified and validated through prototyping.


This model is a software development process that combines both design and step-by-step prototyping in order to combine the advantages of a bottom-up and a top-down concept, emphasizing initial stages life cycle: analysis and design.Distinctive feature this model is a special focus on risks affecting the organization of the life cycle.

At the analysis and design stages, the feasibility of technical solutions and the degree of customer satisfaction are verified through prototyping. Each turn of the spiral corresponds to the creation of a workable fragment or version of the system. This allows you to clarify the requirements, goals and characteristics of the project, to determine the quality of development, to plan the work of the next round of the spiral. Thus, the details of the project are deepened and consistently specified, and as a result, a reasonable option is selected that meets the actual requirements of the customer and is brought to implementation.

Life cycle at each turn of the spiral - different models of the software development process can be applied. Ultimately, the end product is a finished product. The model combines the capabilities of the prototyping model andwaterfall model... Development by iterations reflects the objectively existing spiral cycle of system creation. Incomplete completion of work at each stage allows you to move on to the next stage, without waiting for the complete completion of work at the current one. The main task is to show the system users a workable product as soon as possible, thereby activating the process of specifying and supplementing the requirements.

Advantages of the model:

  • allows you to quickly show the users of the system a workable product, thereby activating the process of clarifying and supplementing the requirements;
  • allows changing requirements for software development, which is typical for most developments, including standard ones;
  • the model provides for the possibility of flexible design, since it embodies the advantages of the waterfall model, and at the same time, iterations are allowed through all phases of the same model;
  • allows you to get a more reliable and stable system. As software evolves, bugs and weaknesses are discovered and fixed at each iteration;
  • this model allows users to actively participate in planning, risk analysis, development, and assessment activities;
  • the risks of the customer are reduced. The customer can complete the development of an unpromising project with minimal financial losses for himself;
  • feedback from users to developers is done with high frequency and early in the model to ensure the desired product High Quality.

Disadvantages of the model:

  • if the project is of low risk or small in size, the model can be expensive. Risk assessment after each spiral is costly;
  • The life cycle of a model has a complicated structure, so it can be difficult for developers, managers and customers to use it;
  • the spiral can continue indefinitely, since each customer's response to the created version can generate a new cycle, which delays the completion of the project;
  • a large number of intermediate cycles can lead to the need for additional documentation processing;
  • the use of the model can be costly and even prohibitively affordable. time. spent on planning, redefining goals, performing risk analysis and prototyping may be excessive;
  • it may be difficult to define goals and milestones indicating a willingness to continue the development process in the next and

The main problem of the spiral cycle is determining when to move to the next stage. To solve it, time limits are introduced for each of the stages.life cycle and the transition proceeds as planned, even if not all of the planned work has been completed.Planningproduced on the basis of statistical data obtained in previous projects and personal experience developers.

Spiral Model Applications

The use of the spiral model is advisable in the following cases:

  • when developing projects using new technologies;
  • when developing new series products or systems;
  • when developing projects with expected significant changes or additions to requirements;
  • to carry out long-term projects;
  • when developing projects that require demonstration of quality and versions of a system or product after a short period of time;
  • when developing projects. for which it is necessary to calculate the costs associated with the assessment and resolution of risks.

Annotation.

Introduction.

1. Software life cycle

Introduction.

Riley Programming Process Steps

Introduction.

1.1.1. Formulation of the problem.

1.1.2. Solution design.

1.1.3. Algorithm coding.

1.1.4. Maintenance of the program.

1.1.5. Software documentation.

Conclusion to clause 1.1

1.2. Definition of ZHCPO according to Lehman.

Introduction.

1.2.1 System definition.

1.2.2. Implementation.

1.2.3. Service.

Conclusion to clause 1.2.

1.3. Phases and work of ZHCPO according to Boehm

1.3.1. Waterfall model.

1.3.2. Economic justification cascade model.

1.3.3. Improvement of the waterfall model.

1.3.4. Determination of the phases of the life cycle.

1.3.5. Basic work on the project.

Literature.


Introduction

Industrial application computers and the growing demand for software have set urgent tasks to significantly increase software development productivity, the development of industrial methods for planning and designing programs, the transfer of organizational and technical, technical, economic and socio-psychological techniques, patterns and methods from the sphere material production into the scope of computers. A complex approach to the processes of development, operation and maintenance of software has put forward a number of pressing problems, the solution of which will eliminate "bottlenecks" in the design of programs, reduce the time of completion of work, improve the selection and adaptation of existing programs, and perhaps determine the fate of systems with embedded computers.

In the practice of developing large software projects, there is often no uniform approach to the assessment of labor costs, timing of work and material costs, which hinders the increase in software development productivity, and ultimately - efficient management life cycle of software. Since a program of any type becomes a product (except, perhaps, educational, model programs), the approach to its production should be in many respects similar to the approach to the production of industrial products, and the issues of designing programs become extremely important. This idea is at the heart of B.W. Boehm's "Software Engineering", which we used in writing this term paper... In this book, software design refers to the process of creating a software product design.


1 Software life cycle

INTRODUCTION

ZHCPO is continuous process, which starts from the moment a decision is made on the need to create software and ends at the moment of its complete withdrawal from service.

There are several approaches to defining the phases and activities of the software life cycle (LCP), steps of the programming process, waterfall and spiral models. But they all contain common fundamental components: problem statement, solution design, implementation, maintenance.

The most famous and complete, perhaps, is the structure of the life-cycle center according to Boehm, which includes eight phases. She will be presented in the future in more detail.

One of the possible options is the description of the upper level according to Lehman, which includes three main phases and presents a description of the life-cycle program in the very general case.

And, for a change, - we present the steps of the programming process presented by D. Riley in the book "Using the Module-2 language". This idea, in my opinion, is very simple and familiar, and we will start with it.

1.1 Steps in the Riley Programming Process

The programming process includes four steps (fig. 1):

problem statement, i.e. getting an adequate idea of ​​what task the program should perform;

designing a solution to an already posed problem (in general, such a solution is less formal than the final program);

coding the program, i.e. translating the designed solution into a program that can be executed on the machine;

maintenance of the program, i.e. an ongoing process of troubleshooting the program and adding new features.

Rice. 1.Four steps of programming.

Programming starts from the moment when user, i.e. someone who needs a program to solve a problem presents the problem system analyst. The user and the systems analyst jointly define the problem statement. The latter is then transmitted algorithmist who is responsible for designing the solution. A solution (or algorithm) represents a sequence of operations, the execution of which leads to a solution to a problem. Since the algorithm is often unsuitable for execution on a machine, it must be translated into a machine program. This operation is performed by the encoder. The maintainer is responsible for subsequent changes to the program. A systems analyst, an algorithmist, an encoder, and an accompanying programmer are all programmers.

In the case of a large software project, the number of users, system analysts and algorithms can be significant. In addition, it may be necessary to return to the previous steps due to unforeseen circumstances. All of this adds to the argument for careful software design: the results of each step must be complete, accurate, and understandable.

1.1.1 Problem statement

One of the most important programming steps is problem statement. It serves as a contract between the user and the programmer (s). Like a legally badly written contract, bad targeting is useless. With a good formulation of the problem, both the user and the programmer clearly and unambiguously represent the task that needs to be performed, i.e. in this case, the interests of both the user and the programmer are taken into account. The user can plan to use software that has not yet been created, based on the knowledge that it can. A good formulation of the problem serves as the basis for the formation of its solution.

Formulation of the problem (program specification); essentially means an accurate, complete and understandable description of what happens when a particular program is executed. The user usually looks at the computer as if it were a black box: it doesn't matter to him how the computer works, but what matters is what the computer can do that interests the user. The focus is on human-machine interaction.

Characteristics of a Good Problem Statement:

Accuracy, i.e. elimination of any ambiguity. There should be no question as to what the output of the program will be for any given input.

Completeness, i.e. considering all options for a given input, including erroneous or unintended input, and determining the appropriate output.

Clarity, i.e. it should be clear to both the user and the systems analyst, since the statement of the problem is the only contract between them.

Demands for accuracy, completeness and clarity are often in conflict. So, many juristic documents difficult to understand because they are written in formal language, which allows you to very accurately formulate certain provisions, excluding any the most insignificant discrepancies. For example, some questions in exam tickets are sometimes phrased so precisely that the student spends more time understanding the question than answering it. Moreover, the student may not grasp the main meaning of the question at all due to the large number of details. The best formulation of the problem is the one that achieves a balance of all three requirements.

The standard form of the problem statement.

Consider the following problem statement: "Enter three numbers and output the numbers in order."

This formulation does not satisfy the above requirements: it is neither exact, nor complete, nor understandable. Indeed, should the numbers be entered one per line or all numbers on one line? Does the expression "in order" mean the ordering from highest to lowest, lowest to highest, or the same order in which they were introduced.

Obviously, such a formulation does not answer many questions. If we take into account the answers to all the questions, then the formulation of the problem will become wordy and difficult to understand. Therefore, D. Riley suggests using a standard form for setting the problem, which provides maximum accuracy, completeness, clarity and includes:

task name (schematic definition);

general description (brief statement of the problem);

errors (unusual input options are explicitly listed to show users and programmers what the machine will take in such situations);

example ( good example can convey the essence of the problem, and also illustrate various cases).

Example. Statement of the problem in standard form.

TITLE

Sorting three integers.

DESCRIPTION

Input and output three integers, sorted from lowest to highest.

Three integers are entered, one number per line. In this case, an integer is one or more consecutive decimal digits, which can be preceded by a plus sign "+" or a minus sign "-".

The three entered integers are displayed, with all three displayed on the same line. Separate adjacent numbers with a space. The numbers are displayed from lowest to highest, from left to right.

1) If less than three numbers are entered, the program waits for additional input.

Software life cycle. Stages and stages

The life cycle of an IS is a series of events that occur with the system in the process of its creation and use.

Stage- a part of the software development process, limited by a certain time frame and ending with the release of a specific product (models, software components, documentation), determined by the requirements set for this stage.

The life cycle is traditionally modeled as a number of successive stages (or stages, phases). Currently, there is no generally accepted breakdown of the life cycle software system into stages. Sometimes a stage is singled out as a separate item, sometimes it is included as an integral part of a larger stage. The actions taken at one stage or another may vary. There is no uniformity in the names of these stages.

Traditionally, the following main stages of the life cycle of software are distinguished:

Requirements analysis,

Design,

Coding (programming),

Testing and debugging,

Operation and maintenance.

Software life cycle. Cascade model

cascade model (70-80 years) ≈ assumes the transition to the next stage after the complete completion of the work on the previous stage,

The main achievement of the waterfall model is the completion of the stages. This makes it possible to plan costs and timelines. In addition, it is being formed project documentation with completeness and consistency.

The waterfall model is applicable to small software projects with clearly defined and unchangeable requirements. The real process can reveal failures at any stage, which leads to a rollback to one of the previous stages. The model of such software production is cascade-return

Software life cycle. Step-by-step model with intermediate control

step-by-step model with intermediate control (80-85 years) ≈ iterative model software development with feedback loops between stages. The advantage of this model is that inter-step adjustments are less labor-intensive than the waterfall model; however, the lifetime of each stage is extended over the entire development period,

The main stages of solving problems

The purpose of programming is to describe data processing processes (hereinafter referred to as simply processes).

Data (data) is a representation of facts and ideas in a formalized form suitable for transmission and processing in a certain process, and information (information) is the meaning that is given to data when they are presented.

Data processing is the execution of a systematic sequence of actions on data. The data are presented and stored on data carriers.

The collection of data carriers used in any kind of data processing is called the data medium.

A set of data contained at any moment in the information environment - the state of the information environment.

A process can be defined as a sequence of successive states of a certain information environment.

To describe a process means to determine the sequence of states of the information environment. In order for the required process to be generated automatically on any computer according to a given description, this description must be formalized.

Software quality criteria

A commercial product (product, service) must meet the requirements of the consumer.

Quality is an objective characteristic of a product (product, service), showing the degree of customer satisfaction

Quality characteristics:

› Operability- the system works and implements the required functions.

› Reliability- the system works without failures and failures.

› Recoverability.

› Efficiency- the system implements its functions in the best possible way.

› Economic efficiency minimum cost the final product with maximum profit.

Quality characteristics:

› Taking into account the human factor- ease of use, speed of learning to work with PP, ease of maintenance, making changes.

› Portability(portability) - portability of code to another platform or system.

› Functional completeness- Possibly the most complete implementation of external functions.

› Calculation accuracy

Algorithm properties.

Effectiveness means the possibility of obtaining a result after performing a finite number of operations.

Certainty consists in the coincidence of the results obtained regardless of the user and the technical means used.

Mass character consists in the possibility of applying the algorithm to a whole class of problems of the same type, differing in specific values ​​of the initial data.

Discreteness - the possibility of dividing the process of calculations prescribed by the algorithm into separate stages, the ability to select sections of the program with a certain structure.

Methods for describing algorithms

There are the following ways to describe (represent) algorithms:

1. verbal description;

2. description of the algorithm using mathematical formulas;

3. a graphical description of the algorithm in the form of a block diagram;

4. description of the algorithm using pseudocode;

5.Combined method of displaying the algorithm using verbal, graphic and other methods .

6. using Petri nets.

Verbal description algorithm is a description of the structure of the algorithm in natural language. For example, to devices household appliances as a rule, an instruction manual is attached, i.e. a verbal description of the algorithm according to which this device is to be used.

Graphic Description algorithm in the form of a flowchart Is a description of the structure of the algorithm using geometric shapes with communication lines.

A flowchart is a graphical representation of a method for solving a problem that uses special characters to represent operations.

The symbols that make up the block diagram of the algorithm are determined by GOST 19.701-90. This GOST corresponds to the international standard for the design of algorithms, therefore, the block diagrams of algorithms, drawn up in accordance with GOST 19.701-90, in different countries are understood unambiguously.

Pseudocode- description of the structure of the algorithm in a natural, but partially formalized language. The pseudocode uses some formal constructs and common mathematical notation. There are no strict syntax rules for writing pseudocode.

Consider simplest example... Let it be necessary to describe the algorithm for displaying the largest value of two numbers on the monitor screen.


Figure 1 - An example of the description of the algorithm in the form of a block diagram

Description of the same algorithm in pseudocode:

2. Entering numbers: Z, X

3. If Z> X then Conclusion Z

4. Otherwise, output X

Each of the listed methods of displaying algorithms has both advantages and disadvantages. For example, the verbal method is notable for its verbosity and lack of clarity, but it makes it possible to better describe individual operations. The graphical method is more descriptive, but it is often necessary to describe some operations in verbal form. Therefore, when developing complex algorithms, it is better to use a combined method.

Algorithm types

linear;

branching;

cyclical.

· Linear Algorithm- a set of commands (instructions) executed sequentially one after another.

· Forking algorithm- an algorithm containing at least one condition, as a result of checking which the computer provides a transition to one of two possible steps.

· Cyclic algorithm- an algorithm that provides for multiple repetition of the same action (the same operations) on new initial data. Most of the methods of computation and enumeration of options are reduced to cyclical algorithms. Program cycle - a sequence of commands (series, loop body) that can be executed multiple times (for new initial data) until a certain condition is satisfied.

C. Data types.

A data type is a description of the range of values ​​that a variable of the specified type can take. Each data type is characterized by:
1.the number of occupied bytes (size)
2. the range of values ​​that a variable of this type can take.

All data types can be divided into the following types:
1. simple (scalar) and complex (vector) types;
2. basic (system) and user (defined by the user).
In the C language, the base type system is formed by four data types:
1.character,
2.integer,
3.real single precision,
4. double precision real.

The structure of a C program.

1. Operators of the C ++ language

Operators control the process of program execution. The set of C ++ operators contains all the control constructs of structured programming.
The compound statement is delimited by curly braces. All other operators end with a semicolon.
Empty operator -;
An empty operator is a semicolon-only operator. It can appear anywhere in a program where the syntax requires a statement. Execution of an empty statement does not change the state of the program.
Compound operator - (...)
The action of a compound statement consists in sequential execution of the statements contained in it, except for those cases when any statement explicitly transfers control to another place in the program.
Exception Handling Operator

try (<операторы> }
catch (<объявление исключения>) { <операторы> }
catch (<объявление исключения>) { <операторы> }
...
catch (<объявление исключения>) { <операторы> }

Conditional operator

if (<выражение>) <оператор 1>

Switch operator

switch (<выражение>)
(case<константное выражение 1>: <операторы 1>
case<константное выражение 2>: <операторы 2>
...
case<константное выражение N>: <операторы N>
}
The switch operator is intended to select one of several alternative paths of program execution. The evaluation of the switch operator begins with the evaluation of the expression, after which control is transferred to the operator marked with a constant expression equal to the evaluated value of the expression. The exit from the switch operator is carried out by the break operator. If the value of the expression is not equal to any constant expression, then control is transferred to the operator marked with the default keyword, if any.
Loop operator with precondition

while (<выражение>) <оператор>

Loop operator with postcondition

do<оператор>while<выражение>;
In the C ++ language, this operator differs from the classical implementation of a loop with a postcondition in that if the expression is true, the loop continues, and not the loop exits.
Step Cycle Operator

for ([<начальное выражение>];
[<условное выражение>];
[<выражение приращения>])
<оператор>
The body of the for statement is executed until the conditional expression becomes false (equal to 0). An initial expression and an increment expression are commonly used to initialize and modify loop parameters and other values. The initial expression is evaluated once before the first test of the conditional expression, and the increment expression is evaluated after each statement execution. Any of the three loop header expressions, or even all three, can be omitted (remember to leave semicolons). If the conditional expression is omitted, then it is considered true, and the loop becomes infinite.
The stepwise loop operator in the C ++ language is a flexible and convenient construction, therefore the loop operator with the while precondition is used extremely rarely in the C ++ language, since in most cases it is more convenient to use the for statement.
Break operator

break;
The break statement interrupts the execution of the while, do, for, and switch statements. It can only be contained in the body of these statements. Control is transferred to the program operator following the interrupted one. If a break statement is written inside nested while, do, for, switch statements, then it terminates only the immediately enclosing statement.
Continuation operator

continue;
The continuation statement transfers control to the next iteration in the while, do, for loop statements. It can only be contained in the body of these statements. In the do and while statements, the next iteration begins by evaluating a conditional expression. In the for statement, the next iteration begins by evaluating the increment expression, and then evaluating the conditional expression.
Return operator

return [<выражение>];
The return statement ends execution of the function in which it is contained and returns control to the calling function. Control is passed to the point of the calling function

If (boolean expression)

operator;

If (boolean expression)

operator_1;

operator_2;

<логическое выражение> ? <выражение_1> : <выражение_2>;

If the value of the logical expression is true, then expression_1 is evaluated, otherwise expression_2 is evaluated.

switch (integer expression)

case value_1:

statement_sequence_1;

case value_2:

statement_sequence_2;

case value_n:

statement_sequence_n;

default:

statement_sequence_n + 1;

Branch default can not be described. It is executed if none of the higher-level expressions is satisfied.

Loop operator.

Turbo C has the following constructs that allow you to program loops: while, do while and for ... Their structure can be described as follows:

Loop with condition check at the top:

Selection operator

If the actions that need to be performed in the program depend on the value of some variable, you can use the select statement. At the same time, in C ++, only numeric variables can be used as variables in the select statement. V general view the selection statement looks like this:

switch (variable)
{
case value1:
actions1
break;

case value2:
action2
break;
...

default:
default actions
}

The break keyword must be added to the end of each branch. It stops the execution of the selection operation. If you do not write it, after performing actions from one branch of the selection, the execution of actions from the following branches will continue. However, sometimes this property of choice is useful, for example, if you need to perform the same actions for different values ​​of a variable.

switch (variable)
{
case value1:
case value2:
actions1
break;

case value3:
action2
break;
...
}

Example of using selection:

int n, x;
...
switch (n)
{
case 0:
break; // if n is 0, then we do not perform any action

case 1:
case 2:
case 3:
x = 3 * n; // if n is 1, 2 or 3, then we perform some actions
break;

case 4:
x = n; // if n is 4, then we perform other actions
break;

default:
x = 0; // for all other values ​​of n, perform the default actions
}

C. Loop: Loop with parameter

General form of entry

for (parameter initialization; check for termination condition; parameter correction) (

block of operations;

for is a parametric loop (loop with a fixed number of repetitions). To organize such a cycle, it is necessary to carry out three operations:

§ parameter initialization- assignment of the initial value to the cycle parameter;

§ checking the end condition- comparison of the parameter value with some boundary value;

§ parameter correction- changing the value of the parameter with each passage of the loop body.

These three operations are written in parentheses and separated by semicolons (;). Typically, the loop parameter is an integer variable.
The parameter is initialized only once — when the for loop starts executing. The termination condition is checked before each possible execution of the loop body. When the expression becomes false (equal to zero), the loop ends. Parameter correction is carried out at the end of each execution of the loop body. The parameter can either increase or decrease.

Example

#include
int main () (

for (num = 1; num< 5; num++)

printf ("num =% d \ n", num);

Si. Loop with precondition

General form of entry

while (expression) (

block of operations;
}

If the expression is true (non-zero), then the block of operations enclosed in curly braces is executed, then the expression is checked again. The sequence of actions, consisting of checking and executing a block of operations, is repeated until the expression becomes false (equal to zero). In this case, the loop is exited, and the operation after the loop operator is executed.

Example

int k = 5;
int i = 1;
int sum = 0;
while (i<=k) {

When constructing a while loop, it is necessary to include constructions in it that change the value of the tested expression so that in the end it becomes false (equal to zero). Otherwise, the loop will be executed endlessly (infinite loop), for example

block of operations;
}

while is a loop with a precondition, so it is quite possible that the body of the loop will not be executed even once if the condition being checked turns out to be false at the time of the first check.

Si. Loop with postcondition

Loop with postcondition do ... while

General form of entry

block of operations;

) while (expression);

Loop with postcondition

The do ... while loop is a loop with a postcondition, where the truth of the expression is checked after all the operations included in the block enclosed by curly braces have been executed. The body of the loop is executed until the expression becomes false, that is, the body of the loop with the postcondition is executed though once.

It is better to use a do ... while loop in cases where at least one iteration must be performed, or when the initialization of objects participating in the test of a condition occurs inside the body of the loop.

Example... Enter a number from 0 to 10

#include
#include
int main () (

system ("chcp 1251");

printf ("Enter a number between 0 and 10:");

scanf ("% d", & num);

) while ((num< 0) || (num > 10));

printf ("You entered the number% d", num);

getchar (); getchar ();

Defining functions

Let's consider the definition of a function using the sum function as an example.

In C and C ++, functions do not need to be defined until they are used, but they must be previously declared. But even after all this, in the end, this function must be defined. The function prototype and definition are then linked and the function can be used.

If the function was previously declared, it must be defined with the same return value and data types, otherwise a new, overloaded function will be created. Note that the names of the function parameters do not have to be the same.

 

It might be helpful to read: