Главная » Все файлы » Просмотр файлов из архивов » 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), страница 33

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

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

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

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

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

Test cases 4 and 5 ensure thatthe inputs are within the defined range, which is greater than 0 andless than, or equal to, 1,000.Case 6 tests whether the application properly handles characterinput values. Because we are doing a calculation, it is obvious that theapplication should reject character datatypes. The assumption withthis test case is that Java will handle the datatype check. This application must handle the exception raised when an invalid datatype issupplied. This test will ensure that the exception is thrown. Last, tests7 and 8 check for the correct number of input values; any numberother than 1 should fail.Test Driver and ApplicationNow that we have designed both test cases, we can create the testdriver class, check4PrimeTest. Table 8.3 maps the JUnit methods incheck4PrimeTest to the test cases covered.Note that the testCheckPrime_false() method tests two conditions because the boundary values are not prime numbers.

Therefore,we can check for boundary-value errors and for invalid primes withone test method. Examining this method in detail will reveal that thetwo tests actually do occur within it. Here is the complete JUnitmethod from the check4JavaTest class listed in Appendix A.Table 8.3Test Driver MethodsMethodstestCheckPrime_true()testCheckPrime_false()testCheck4Prime_checkArgs_char_input()testCheck4Prime_checkArgs_above_upper_bound()testCheck4Prime_checkArgs_neg_input()testCheck4Prime_checkArgs_2_inputs()testCheck4Prime_checkArgs_0_inputs()Test Case Examined12, 375468190The Art of Software Testingpublic void testCheckPrime_false(){assertFalse(check4prime.primeCheck(0));assertFalse(check4prime.primeCheck(10000));}Notice that the JUnit method, assertFalse(), checks to seewhether the parameter supplied to it is false.

The parameter must bea Boolean datatype, or a function that returns a Boolean value. If falseis returned, then the test is considered a success.The snippet also provides an example of a benefit of creating testcases and test harnesses first. You may notice that the parameter inthe assertFalse() methods is a method, check4prime.primeCheck(n).This method will reside in a class of the application. Creating the testharness first forced us to think about the structure of the application.In some respects, the application is designed to support the test harness.

Here we will need a method to check whether the input is aprime number, so we included it in the application.With the test harness complete, application coding can begin.Based on the program specification, test cases, and the test harness,the resultant Java application will consist of a single class, check4Prime,with the following definition:public class check4Prime {public static void main (String [] args)public void checkArgs(String [] args) throws Exceptionpublic boolean primeCheck (int num)}Briefly, per Java requirements, the main() procedure provides theentry point into the application. The checkArgs() method assertsthat the input value is a positive, n, where 0 ⭌ n ⬉ 1,000. TheprimeCheck() procedure checks the input value against a calculatedlist of prime numbers.

We implemented the sieve of Eratosthenes toquickly calculate the prime numbers. This approach is acceptablebecause of the small number of prime numbers involved.Extreme Testing191SummaryWith the increased competitiveness of software products, there is aneed to introduce the products very quickly into the marketplace. Asa result, the Extreme Programming model was developed to supportrapid application development. This lightweight development processfocuses on communication, planning, and testing.The testing aspect of Extreme Programming is termed ExtremeTesting. It focuses on unit and acceptance tests. You run unit testswhenever a change to the code base occurs. The customer runs theacceptance tests at major release points.Extreme Testing also requires you to create the test harness, basedon the program specification, before you start coding your application.

In this manner, you design your application to pass the unit tests,thus increasing the probability that it will meet the specification.CHAPTER 9Testing InternetApplicationsJust a few years ago, Internetbased applications seemed to be the wave of the future; today, thewave has arrived onshore, and customers, employees, and businesspartners expect companies to have a Web presence.Generally, small to medium-size businesses have simple Web pagesthey use to tout their products and services. Larger enterprises oftenbuild full-fledged e-commerce applications to sell their wares, fromcookies to cars and from consulting services to entire virtual companies that exist only on the Internet.Internet applications are essentially client-server applications inwhich the client is a Web browser and the server is a Web or application server.

Although conceptually simple, the complexity of theseapplications varies wildly. Some companies have applications built forbusiness-to-consumer uses such as banking services or retail stores,while others have business-to-business applications such as supplychain management. Development and user presentation/user interface strategies vary for these different types of Websites, and, as youmight imagine, the testing approach varies for the different types ofsites as well.The goal of testing Internet-based applications is no different fromthat of traditional applications.

You need to uncover errors in theapplication before deploying it to the Internet. And, given the complexity of these applications and the interdependency of the components, you likely will succeed in finding plenty of errors.The importance of rooting out the errors in an Internet application cannot be understated. As a result of the openness and accessi193194The Art of Software Testingbility of the Internet, competition in the business-to-consumer arenais intense. Thus, the Internet has created a buyer’s market for goodsand services.

Consumers have developed high expectations, and ifyour site does not load quickly, respond immediately, and provideintuitive navigation features, chances are that the user will findanother site with which to conduct business.It would seem that consumers have higher quality expectations forInternet applications than they do for shrink-wrapped applications.When people buy products in a box and install them on their computers, as long as the quality is “average,” they will continue to use them.One reason for this behavior is that they have paid for the applicationand it must be a product they perceive as useful or desirable.

Even aless-than-satisfactory program can’t be corrected easily, so if the application at least satisfies the users’ basic needs, they likely will retain theprogram. On the Internet, an average-quality application will likelycause your customer to use a competitor’s site. Not only will the customer leave your site if it exhibits poor quality, your corporate imagebecomes tarnished as well.

After all, who feels comfortable buying a carfrom a company that cannot build a suitable Website? Like it or not,your Website has become the new first impression for business. In general, consumers don’t pay to access your Website, so there is littleincentive to remain loyal in the face of mediocre Website design orperformance.This chapter covers some of the basics of testing Internet applications. This subject is large and complex, and many references existthat explore its details. However, you will find that the techniquesexplained in early chapters apply to Internet testing as well.

Nevertheless, because there are, indeed, functional and design differencesbetween Web applications and conventional applications, we wantedto point out some of the particulars of Web-based application testing.Basic E-commerce ArchitectureBefore diving into testing Internet-based applications, we will provide an overview of the three-tier client-server (C/S) architectureTesting Internet Applications195used in a typical Internet-based e-commerce application. Conceptually, each tier is treated as a black box with well-defined interfaces.This model allows you to change the internals of each tier withoutworrying about breaking another tier. Figure 9.1 illustrates each tierand the associated components used by most e-commerce sites.Although not an official tier in the architecture, the client side andits relevance are worth discussing.

Most of the access to your applications occurs from a Web browser running on a computer, althoughmany devices, such as cell phones, refrigerators, pagers, and automobiles, are being developed that can connect to the Internet. Browsersvary dramatically in how they render content from a Website. Aswe discuss later in this chapter, testing for browser compatibility isone challenge associated with testing Internet applications. Vendorsloosely follow published standards to help make browsers behaveconsistently, but they also build in proprietary enhancements thatcause inconsistent behavior.

The remainder of the clients employcustom applications that use the Internet as a pipeline to a particularsite. In this scenario, the application mimics a standard client-serverapplication you might find on a company’s local area network.Figure 9.1Typical architecture of an e-commerce site.ClientsXYZ, Inc.InternetLaptop computerIBM CompatibleFirewallTier 1WebServerTier 2BusinessLogicTier 3DataStores196The Art of Software TestingThe Web server represents the first tier in the three-tier architecture and houses the Website. The look and feel of an Internet application comes from the first tier.

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