Главная » Просмотр файлов » Software Engineering Body of Knowledge (v3) (2014)

Software Engineering Body of Knowledge (v3) (2014) (811503), страница 64

Файл №811503 Software Engineering Body of Knowledge (v3) (2014) (Software Engineering Body of Knowledge (v3) (2014).pdf) 64 страницаSoftware Engineering Body of Knowledge (v3) (2014) (811503) страница 642020-08-25СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 64)

In a practical sense, a programming language is a notation for writing programs and thusshould be able to express most data structures andalgorithms. Some, but not all, people restrict theterm “programming language” to those languagesthat can express all possible algorithms.Not all languages have the same importanceand popularity. The most popular ones are oftendefined by a specification document establishedby a well-known and respected organization.

Forexample, the C programming language is specified by an ISO standard named ISO/IEC 9899.Other languages, such as Perl and Python, do notenjoy such treatment and often have a dominantimplementation that is used as a reference.4.2. Syntax and Semantics of ProgrammingLanguagesJust like natural languages, many programminglanguages have some form of written specification of their syntax (form) and semantics (meaning). Such specifications include, for example,Computing Foundations  13-7specific requirements for the definition of variables and constants (in other words, declaration and types) and format requirements for theinstructions themselves.In general, a programming language supportssuch constructs as variables, data types, constants, literals, assignment statements, controlstatements, procedures, functions, and comments.The syntax and semantics of each construct mustbe clearly specified.4.3. Low-Level Programming LanguagesProgramming language can be classified into twoclasses: low-level languages and high-level languages.

Low-level languages can be understoodby a computer with no or minimal assistance andtypically include machine languages and assembly languages. A machine language uses onesand zeros to represent instructions and variables,and is directly understandable by a computer. Anassembly language contains the same instructionsas a machine language but the instructions andvariables have symbolic names that are easier forhumans to remember.Assembly languages cannot be directly understood by a computer and must be translated into amachine language by a utility program called anassembler. There often exists a correspondencebetween the instructions of an assembly languageand a machine language, and the translation fromassembly code to machine code is straightforward.

For example, “add r1, r2, r3” is an assembly instruction for adding the content of registerr2 and r3 and storing the sum into register r1. Thisinstruction can be easily translated into machinecode “0001 0001 0010 0011.” (Assume the operation code for addition is 0001, see Figure 13.2).add0001r1,0001r2,0010r30011Figure 13.2. Assembly-to-Binary TranslationsOne common trait shared by these two typesof language is their close association with thespecifics of a type of computer or instruction setarchitecture (ISA).4.4. High-Level Programming LanguagesA high-level programming language has a strongabstraction from the details of the computer’sISA.

In comparison to low-level programminglanguages, it often uses natural-language elements and is thus much easier for humans tounderstand. Such languages allow symbolic naming of variables, provide expressiveness, andenable abstraction of the underlying hardware.For example, while each microprocessor has itsown ISA, code written in a high-level programming language is usually portable between manydifferent hardware platforms. For these reasons,most programmers use and most software arewritten in high-level programming languages.Examples of high-level programming languagesinclude C, C++, C#, and Java.4.5. Declarative vs. Imperative ProgrammingLanguagesMost programming languages (high-level or lowlevel) allow programmers to specify the individual instructions that a computer is to execute.Such programming languages are called imperative programming languages because one has tospecify every step clearly to the computer.

Butsome programming languages allow programmers to only describe the function to be performed without specifying the exact instructionsequences to be executed. Such programminglanguages are called declarative programminglanguages. Declarative languages are high-levellanguages. The actual implementation of thecomputation written in such a language is hiddenfrom the programmers and thus is not a concernfor them.The key point to note is that declarative programming only describes what the programshould accomplish without describing how toaccomplish it. For this reason, many peoplebelieve declarative programming facilitateseasier software development.

Declarative programming languages include Lisp (also a functional programming language) and Prolog, whileimperative programming languages include C,C++, and JAVA.13-8  SWEBOK® Guide V3.05. Debugging Tools and Techniques[3*, c23]Once a program is coded and compiled (compilation will be discussed in section 10), the next stepis debugging, which is a methodical process offinding and reducing the number of bugs or faultsin a program. The purpose of debugging is to findout why a program doesn’t work or produces awrong result or output.

Except for very simpleprograms, debugging is always necessary.5.1. Types of ErrorsWhen a program does not work, it is often becausethe program contains bugs or errors that can beeither syntactic errors, logical errors, or data errors.Logical errors and data errors are also known astwo categories of “faults” in software engineeringterminology (see topic 1.1, Testing-Related Terminology, in the Software Testing KA).Syntax errors are simply any error that prevents the translator (compiler/interpreter) fromsuccessfully parsing the statement. Every statement in a program must be parse-able before itsmeaning can be understood and interpreted (and,therefore, executed). In high-level programminglanguages, syntax errors are caught during thecompilation or translation from the high-levellanguage into machine code. For example, in theC/C++ programming language, the statement“123=constant;” contains a syntax error that willbe caught by the compiler during compilation.Logic errors are semantic errors that result inincorrect computations or program behaviors.Your program is legal, but wrong! So the resultsdo not match the problem statement or user expectations.

For example, in the C/C++ programminglanguage, the inline function “int f(int x) {returnf(x-1);}” for computing factorial x! is legal butlogically incorrect. This type of error cannot becaught by a compiler during compilation and isoften discovered through tracing the execution ofthe program (Modern static checkers do identifysome of these errors. However, the point remainsthat these are not machine checkable in general).Data errors are input errors that result either ininput data that is different from what the programexpects or in the processing of wrong data.5.2. Debugging TechniquesDebugging involves many activities and can bestatic, dynamic, or postmortem.

Static debugging usually takes the form of code review, whiledynamic debugging usually takes the form oftracing and is closely associated with testing.Postmortem debugging is the act of debuggingthe core dump (memory dump) of a process. Coredumps are often generated after a process has terminated due to an unhandled exception. All threetechniques are used at various stages of programdevelopment.The main activity of dynamic debugging istracing, which is executing the program one pieceat a time, examining the contents of registers andmemory, in order to examine the results at eachstep. There are three ways to trace a program.•  Single-stepping: execute one instruction ata time to make sure each instruction is executed correctly.

This method is tedious butuseful in verifying each step of a program.•  Breakpoints: tell the program to stop executing when it reaches a specific instruction.This technique lets one quickly executeselected code sequences to get a high-leveloverview of the execution behavior.•  Watch points: tell the program to stop when aregister or memory location changes or whenit equals to a specific value. This techniqueis useful when one doesn’t know where orwhen a value is changed and when this valuechange likely causes the error.5.3. Debugging ToolsDebugging can be complex, difficult, and tedious.Like programming, debugging is also highly creative (sometimes more creative than programming).

Thus some help from tools is in order. Fordynamic debugging, debuggers are widely usedand enable the programmer to monitor the execution of a program, stop the execution, restart theexecution, set breakpoints, change values in memory, and even, in some cases, go back in time.For static debugging, there are many staticcode analysis tools, which look for a specificset of known problems within the source code.Computing Foundations  13-9Both commercial and free tools exist in variouslanguages.

These tools can be extremely usefulwhen checking very large source trees, where it isimpractical to do code walkthroughs. The UNIXlint program is an early example.6. Data Structure and Representation[5*, s2.1–2.6]Programs work on data. But data must beexpressed and organized within computers beforebeing processed by programs.

This organizationand expression of data for programs’ use is thesubject of data structure and representation. Simply put, a data structure tries to store and organizedata in a computer in such a way that the data canbe used efficiently. There are many types of datastructures and each type of structure is suitablefor some kinds of applications. For example, B/B+ trees are well suited for implementing massive file systems and databases.6.1. Data Structure OverviewData structures are computer representations ofdata. Data structures are used in almost every program. In a sense, no meaningful program can beconstructed without the use of some sort of datastructure.

Some design methods and programming languages even organize an entire softwaresystem around data structures. Fundamentally,data structures are abstractions defined on a collection of data and its associated operations.Often, data structures are designed for improving program or algorithm efficiency. Examples ofsuch data structures include stacks, queues, andheaps. At other times, data structures are used forconceptual unity (abstract data type), such as thename and address of a person.

Характеристики

Тип файла
PDF-файл
Размер
6,58 Mb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6363
Авторов
на СтудИзбе
310
Средний доход
с одного платного файла
Обучение Подробнее