【正文】
錯誤的用戶名和密碼,登錄系統(tǒng)系統(tǒng)提示登錄失敗跳轉(zhuǎn)到登陸界面,如圖531所示5成功登錄測試輸入正確的用戶名和密碼進(jìn)行測試登錄系統(tǒng)登錄成功自動跳轉(zhuǎn)到系統(tǒng)的首頁如圖534所示。表532 認(rèn)證測試結(jié)果圖表圖531未認(rèn)證操作結(jié)果圖圖532 空密碼登錄圖圖533 空用戶名登錄結(jié)果圖圖534成功登錄圖通過測試可以了解到,用戶認(rèn)證時必須輸入正確的用戶名和密碼才可以登錄系統(tǒng)分否則,系統(tǒng)將會提出用戶登錄失敗的提示信息,提示用戶再次登錄,當(dāng)用戶未曾認(rèn)證時,軟件的各個功能只能展示,而不能使用,當(dāng)用戶認(rèn)證通過后方可使用購菜,產(chǎn)看訂單等功能,所以用戶認(rèn)證是系統(tǒng)使用的前提條件。登錄認(rèn)證測試后,我們將對購菜功能進(jìn)行測試,只有選擇好正確的蔬菜商和蔬菜后,我們才可以下達(dá)訂單并且進(jìn)行支付,如果所購買的蔬菜總額不夠起送價時,提供“給予小費”和“繼續(xù)選擇蔬菜”2個選擇。當(dāng)選擇蔬菜完畢并成功提交和支付訂單后,我們就可以在“我的訂單”中查看到該訂單。我們采取的購菜的測試用例如下表533所示:表533 購菜功能測試用例表編號名稱操作結(jié)果1訂單總額不夠選擇少量蔬菜,使其總額小于起送價提示“繼續(xù)選菜”和“給予小費”選擇,下單不成功2給予小費總額不夠給予小費下單成功,進(jìn)入支付界面,支付成功跳轉(zhuǎn)到首頁3繼續(xù)選菜繼續(xù)選菜,到達(dá)起送價下單成功,進(jìn)入支付界面,支付成功跳轉(zhuǎn)到首頁以此運行測試用例,發(fā)現(xiàn)訂單成功下單,并且能夠支付成功,發(fā)現(xiàn)訂單能夠成功的在“我的訂單”中進(jìn)行查看,如果訂單下達(dá)不成功,則無法進(jìn)入支付界面,則購菜失敗,需要重新選擇并下單才可以。效果圖如下535和536所示:表534 購菜結(jié)果圖圖535 支付成功圖圖536 訂單列表通過以上測試用例,我們可以發(fā)現(xiàn)用戶選購的蔬菜滿足運送價或者給予足夠消費后,用戶能夠?qū)崿F(xiàn)訂單,并能夠成功支付,通過測試我們可以發(fā)現(xiàn)當(dāng)用戶使用購菜功能時,該軟件的功能可以完整實現(xiàn),也就是說當(dāng)當(dāng)前軟件的功能能夠被用戶使用。通過上述2個功能的測試我們接下來對于查看訂單,查看收藏的功能進(jìn)行測試,我們可以添加獲取訂單或收藏來查看收藏訂單功能是否能夠完全實現(xiàn),其中該功能的測試用例如下表535所示:535 查看訂單(收藏)的測試用例表編號名稱操作結(jié)果1添加收藏測試將“菜市場1號”進(jìn)行收藏在收藏列表中可以看到“菜市場1號”2刪除收藏測試將“菜市場1號”移除收藏列表在“菜市場1號”的主界面中收藏按鈕變?yōu)椤盀槭詹亍?下達(dá)訂單測試選擇購買蔬菜下達(dá)訂單,并成功支付訂單列表中存在該訂單,點擊可以查看該訂單詳情或刪除4刪除訂單測試將訂單移除訂單列表刷新后,該訂單被刪除當(dāng)商家被用戶收藏過后,用戶再次登錄商家的主界面后,收藏按鈕會顯示為“取消收藏”,表示用戶已經(jīng)收藏了該商家,收藏效果圖如圖537所示:圖537 收藏效果圖可以點擊“取消收藏”按鈕來取消收藏,當(dāng)取消收藏后,用戶再次進(jìn)入該商家,按鈕將會變成“收藏”如圖538所示:圖538 未收藏效果圖白盒測試又稱結(jié)構(gòu)測試、透明盒測試、邏輯驅(qū)動測試或基于代碼的測試。白盒測試是一種測試用例設(shè)計方法,盒子指的是被測試的軟件,白盒指的是盒子是可視的,你清楚盒子內(nèi)部的東西以及里面是如何運作的。白盒法全面了解程序內(nèi)部邏輯結(jié)構(gòu)、對所有邏輯路徑進(jìn)行測試。白盒法是窮舉路徑測試。在使用這一方案時,測試者必須檢查程序的內(nèi)部結(jié)構(gòu),從檢查程序的邏輯著手,得出測試數(shù)據(jù)。貫穿程序的獨立路徑數(shù)是天文數(shù)字[10]。在開發(fā)軟件過程中,將信息輸出到日志信息中,從而對程序的變量做到整體的把握。在用戶認(rèn)證時通過Toast方法彈出用戶提示信息,從而能夠更加準(zhǔn)確的輸入輸出信息,具體代碼可見如下圖539所示:圖539 Toast代碼測試用例但是相對于Toast方法來說,LOG方法,隱藏比較高,只在調(diào)試的時候可以查看,當(dāng)軟件運行時,其不再彈出,所以這種方法相對來說更加常見,下圖5310未LOG方法的典型代碼,這段代碼可以測試子進(jìn)程中的信息是否成功傳遞到了UI進(jìn)程,通過LOG的輸出,我們可以查看出到底哪行代碼發(fā)現(xiàn)錯誤:圖5310 LOG測試代碼在Logcat,我們可以跟蹤程序的執(zhí)行,如下圖5311我們可以上面程序執(zhí)行成功:圖5311 Logcat日志輸出圖 第6章 結(jié)論蔬菜寶手機(jī)APP在充分理解消費者需求的基礎(chǔ)上,對軟件進(jìn)行開發(fā),基本功能已經(jīng)大體實現(xiàn),但是由于資金和時間的關(guān)系,對軟件的測試尚未完成,所以不能進(jìn)行大規(guī)模推廣,只能進(jìn)行小規(guī)模試用。接下來,對軟件的進(jìn)一步優(yōu)化,可以在以下幾個方面入手:首先,由于是O2O模型需對軟件安全性進(jìn)行測試,其次對軟件的界面進(jìn)行美化,使界面更加符合用戶的使用習(xí)慣,其次,要規(guī)范設(shè)計和代碼過程,對影響系統(tǒng)性能的關(guān)鍵算法和代碼進(jìn)行必要的優(yōu)化,最后,研究系統(tǒng)與數(shù)據(jù)庫的接口,充分利用商用數(shù)據(jù)庫提供的優(yōu)化方法。參考文獻(xiàn)[1]汪永松編著 Android平臺開發(fā)之旅(第2版) 北京:機(jī)械工業(yè)出版社,2012[2] 王國輝, 李偉等編著 程序員開發(fā)寶典系列:Android開發(fā)寶典 北京:機(jī)械工業(yè)出版社,2012[3] 王衛(wèi)紅編著,Android應(yīng)用開發(fā)基礎(chǔ)教程 北京:機(jī)械工業(yè)出版社,2015[4] 張領(lǐng), 李根福, 王敬杰編著, Android程序開發(fā)范例寶典, 北京:人民郵電出版社,2015[5] 黃雋實著, Android和PHP開發(fā)最佳實踐, 北京:機(jī)械工業(yè)出版社,2013。[6] Android 開發(fā)手冊 ,[7]開源中國社區(qū),《安卓問題總結(jié)二(更新UI出現(xiàn)的問題)》[8]開源中國社區(qū),Android訪問php取回json數(shù)據(jù),[9]未知作者博客,《AlertDialog中獲取自定義控件》[10]CSDN論壇,Android:Activity+Fragment及它們之間的數(shù)據(jù)交換,[11]CSDN論壇,ListView添加底部按鈕的方法,[12] Michele E. Davis and Jon A. Phillips,《 學(xué)習(xí) PHP amp。 MySQL》南京 : 東南大學(xué)出版社, 2008.[13] David Sklar, Adam Trachtenberg著,《PHP經(jīng)典實例》,中國電力出版社 2009[14] 劉中華, 潘凱華編著,PHP編程寶典,人民郵電出版社 2011[15] Andi Gutmans, Stig S?ther Bakken, Derick Rethans著,PHP5權(quán)威編程 ,人民郵電出版社 2007附錄1 英文原文 Abstract— Mobile and emerce applications are tools for accessing the Internet and for buying products and services. These applications are constantly evolving due to the high rate of technological advances being made. This paper provides a new perspective on the types of applications that can be used. It describes and analyses device requirements, provides a literature review of important aspects of mobile devices that can use such applications and the requirements of websites designed for mmerce. The design and security aspects of mobile devices are also investigated. As an alternative to existing mmerce applications, this paper also investigates the characteristics and potential of the PhoneGap crossmobile platform application. The results suggest that effective mobile applications do exist for various Smartphones, and web applications on mobile devices should be effective. PhoneGap and Spree applications can municate using JSON instead of the XML language. Android simulators can be used for ensuring proper functionality and for piling the applications. Keywords Emerce 。 PhoneGap 。 Mmerce 。 Smartphones 。 Spree –merce 。 Ruby on Rails. I. INTRODUCTIONThe internet has changed many aspects of society, from business to recreation, from culture to munication and technology, as well as shopping and travelling. This new form of munication has provided new ways of doing business with the help of technological development. Emerce is the new way of shopping and doing business. Technology has allowed panies to promote and sell their products on new markets, overing geographical borders as never before. Consumers have access to a wider market of products when they use wireless and internet technologies. Mobile devices with wide access to the Internet have allowed panies to reach consumers in more diverse ways, thus ensuring deep market penetration. This study investigates the opportunities generated through mobile telephone access to the Internet [13]. Faster wireless networking standards allow wireless devices to use more emerce applications, and consequently, permit wider access to mobile merce (mmerce) [14]. Mmerce has been defined as “a special branch of emerce, in which mobile devices and their network connection medium are used to buy, sell, and promote products, services, and information” [20]. According to Koukia, Rigou and Sirmakessis (2006), wireless technologies have improved traditional emerce by “providing the additional aspects of mobility (of participation) and portability (of technology).” On this theme, mobile and emerce application developments are an important factor for the expansion of mmerce among consumers. The technical characteristics of devices and corresponding applications, as well as Internet access facilities, are determining the level of acceptance of mmerce and its development. Aspects like processing power, display and device size, mobile internet coverage, standardization and quality of devices, are only some of the important factors that decide the level of use of mmerce