Главная » Все файлы » Просмотр файлов из архивов » PDF-файлы » The art of software testing. Myers (2nd edition) (2004)

The art of software testing. Myers (2nd edition) (2004) (The art of software testing. Myers (2nd edition) (2004).pdf), страница 5

PDF-файл The art of software testing. Myers (2nd edition) (2004) (The art of software testing. Myers (2nd edition) (2004).pdf), страница 5 Тестирование ПО (63885): Книга - 11 семестр (3 семестр магистратуры)The art of software testing. Myers (2nd edition) (2004) (The art of software testing. Myers (2nd edition) (2004).pdf) - PDF, страница 5 (63885) - Студ2020-08-25СтудИзба

Описание файла

PDF-файл из архива "The art of software testing. Myers (2nd edition) (2004).pdf", который расположен в категории "". Всё это находится в предмете "тестирование по" из 11 семестр (3 семестр магистратуры), которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .

Просмотр PDF-файла онлайн

Текст 5 страницы из PDF

Therefore, a test case must consistof two components:1. A description of the input data to the program.2. A precise description of the correct output of the programfor that set of input data.The Psychology and Economics of Program Testing15Table 2.1Vital Program Testing GuidelinesPrincipleNumber12345678910PrincipleA necessary part of a test case is a definition of theexpected output or result.A programmer should avoid attempting to test his or herown program.A programming organization should not test its ownprograms.Thoroughly inspect the results of each test.Test cases must be written for input conditions that areinvalid and unexpected, as well as for those that are validand expected.Examining a program to see if it does not do what it issupposed to do is only half the battle; the other half isseeing whether the program does what it is not supposedto do.Avoid throwaway test cases unless the program is truly athrowaway program.Do not plan a testing effort under the tacit assumptionthat no errors will be found.The probability of the existence of more errors in asection of a program is proportional to the number oferrors already found in that section.Testing is an extremely creative and intellectuallychallenging task.A problem may be characterized as a fact or group of facts forwhich we have no acceptable explanation, that seem unusual, or thatfail to fit in with our expectations or preconceptions.

It should beobvious that some prior beliefs are required if anything is to appearproblematic. If there are no expectations, there can be no surprises.16The Art of Software TestingPrinciple 2: A programmer should avoid attempting to testhis or her own program.Any writer knows—or should know—that it’s a bad idea toattempt to edit or proofread his or her own work. You know what thepiece is supposed to say and may not recognize when it says otherwise.And you really don’t want to find errors in your own work. The sameapplies to software authors.Another problem arises with a change in focus on a software project. After a programmer has constructively designed and coded a program, it is extremely difficult to suddenly change perspective to lookat the program with a destructive eye.As many homeowners know, removing wallpaper (a destructiveprocess) is not easy, but it is almost unbearably depressing if it wasyour hands that hung the paper in the first place.

Similarly, most programmers cannot effectively test their own programs because theycannot bring themselves to shift mental gears to attempt to exposeerrors. In addition, a programmer may subconsciously avoid findingerrors for fear of retribution from peers or from a supervisor, a client,or the owner of the program or system being developed.In addition to these psychological issues, there is a second significant problem: The program may contain errors due to the programmer’s misunderstanding of the problem statement or specification. Ifthis is the case, it is likely that the programmer will carry the samemisunderstanding into tests of his or her own program.This does not mean that it is impossible for a programmer to testhis or her own program. Rather, it implies that testing is more effective and successful if someone else does it.Note that this argument does not apply to debugging (correctingknown errors); debugging is more efficiently performed by the original programmer.Principle 3: A programming organization should not testits own programs.The Psychology and Economics of Program Testing17The argument here is similar to the previous argument.

A projector programming organization is, in many senses, a living organizationwith psychological problems similar to those of individual programmers. Furthermore, in most environments, a programming organization or a project manager is largely measured on the ability toproduce a program by a given date and for a certain cost. One reasonfor this is that it is easy to measure time and cost objectives, but it isextremely difficult to quantify the reliability of a program.

Therefore,it is difficult for a programming organization to be objective in testing its own programs, because the testing process, if approached withthe proper definition, may be viewed as decreasing the probability ofmeeting the schedule and the cost objectives.Again, this does not say that it is impossible for a programmingorganization to find some of its errors, because organizations doaccomplish this with some degree of success. Rather, it implies thatit is more economical for testing to be performed by an objective,independent party.Principle 4:Thoroughly inspect the results of each test.This is probably the most obvious principle, but again it is something that is often overlooked. We’ve seen numerous experimentsthat show many subjects failed to detect certain errors, even whensymptoms of those errors were clearly observable on the output listings.

Put another way, errors that are found on later tests are oftenmissed in the results from earlier tests.Principle 5:Test cases must be written for input conditionsthat are invalid and unexpected, as well as for thosethat are valid and expected.There is a natural tendency when testing a program to concentrateon the valid and expected input conditions, at the neglect of theinvalid and unexpected conditions.

For instance, this tendency frequently appears in the testing of the triangle program in Chapter 1.18The Art of Software TestingFew people, for instance, feed the program the numbers 1,2,5 tomake sure that the program does not erroneously interpret this as ascalene triangle instead of an invalid triangle. Also, many errors thatare suddenly discovered in production programs turn up when theprogram is used in some new or unexpected way. Therefore, testcases representing unexpected and invalid input conditions seem tohave a higher error-detection yield than do test cases for valid inputconditions.Principle 6: Examining a program to see if it does not do whatit is supposed to do is only half the battle; the other half isseeing whether the program does what it is not supposed to do.This is a corollary to the previous principle. Programs must beexamined for unwanted side effects.

For instance, a payroll programthat produces the correct paychecks is still an erroneous program if italso produces extra checks for nonexistent employees or if it overwrites the first record of the personnel file.Principle 7: Avoid throwaway test cases unless the program istruly a throwaway program.This problem is seen most often with interactive systems to testprograms. A common practice is to sit at a terminal and invent testcases on the fly, and then send these test cases through the program.The major problem is that test cases represent a valuable investmentthat, in this environment, disappears after the testing has been completed.

Whenever the program has to be tested again (for example,after correcting an error or making an improvement), the test casesmust be reinvented. More often than not, since this reinventionrequires a considerable amount of work, people tend to avoid it.Therefore, the retest of the program is rarely as rigorous as the original test, meaning that if the modification causes a previously functional part of the program to fail, this error often goes undetected.Saving test cases and running them again after changes to other components of the program is known as regression testing.The Psychology and Economics of Program Testing19Principle 8: Do not plan a testing effort under the tacitassumption that no errors will be found.This is a mistake project managers often make and is a sign of theuse of the incorrect definition of testing—that is, the assumption thattesting is the process of showing that the program functions correctly.Once again, the definition of testing is the process of executing aprogram with the intent of finding errors.Principle 9:The probability of the existence of more errorsin a section of a program is proportional to the numberof errors already found in that section.This phenomenon is illustrated in Figure 2.2.

At first glance itmakes little sense, but it is a phenomenon present in many programs.For instance, if a program consists of two modules, classes, or subroutines A and B, and five errors have been found in module A andonly one error has been found in module B, and if module A has notbeen purposely subjected to a more rigorous test, then this principletells us that the likelihood of more errors in module A is greater thanthe likelihood of more errors in module B.Another way of stating this principle is to say that errors tend tocome in clusters and that, in the typical program, some sections seemto be much more prone to errors than other sections, althoughnobody has supplied a good explanation of why this occurs. Thephenomenon is useful in that it gives us insight or feedback in thetesting process.

If a particular section of a program seems to be muchmore prone to errors than other sections, then this phenomenon tellsus that, in terms of yield on our testing investment, additional testingefforts are best focused against this error-prone section.Principle 10:Testing is an extremely creativeand intellectually challenging task.It is probably true that the creativity required in testing a large program exceeds the creativity required in designing that program. We20The Art of Software TestingFigure 2.2The Surprising Errors Remaining/Errors FoundRelationship.already have seen that it is impossible to test a program sufficiently toguarantee the absence of all errors.

Methodologies discussed later inthis book let you develop a reasonable set of test cases for a program,but these methodologies still require a significant amount of creativity.SummaryAs you proceed through this book, keep in mind these three important principles of testing:• Testing is the process of executing a program with the intent offinding errors.• A good test case is one that has a high probability of detectingan as yet undiscovered error.• A successful test case is one that detects an as yet undiscoverederror.CHAPTER 3Program Inspections,Walkthroughs,and ReviewsFor many years, most of us in theprogramming community worked under the assumptions that programs are written solely for machine execution and are not intendedfor people to read, and that the only way to test a program is to execute it on a machine.

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