Learn how to improve your Java coding skills using unit testing. Despite it's name, unit testing is really a coding technique, not a testing technique. Unit testing is done by programmers, for programmers. It's primarily for our benefit: we get improved confidence in our code, better ability to make deadlines, less time spent in the debugger, and less time beating on the code to make it work correctly. This book shows how to write tests, but more importantly, it goes where other books fear to tread and gives you concrete advice and examples of what to test--the common things that go wrong in all of our programs. Discover the tricky hiding places where bugs breed, and how to catch them using the freely available JUnit framework. It's easy to learn how to think of all the things in your code that are likely to break. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our www.pragmaticprogrammer.com website) to help you remember all this stuff. With this book you will:
Write better code, and take less time to write it
Discover the tricky places where bugs breed
Learn how to think of all the things that could go wrong
Test individual pieces of code without having to include the whole project
Test effectively with the whole team We'll also cover how to use Mock Objects for testing, how to write high quality test code, and how to use unit testing to improve your design skills. We'll show you frequent "gotchas"--along with the fixes--to save you time when problems come up. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our www.pragmaticprogrammer.com website). But the best part is that you don't need a sweeping mandate to change your whole team or your whole company. You don't need to adopt Extreme Programming or Test-Driven Development, or change your development process in order to reap the proven benefits of unit testing. You can start unit testing, the pragmatic way, right away.
Andrew Hunt和David Thomas是Pragmatic Programmers的閤夥人。他們不但為客戶開發復雜的軟件係統,而且為開發者和項目經理提供具有實務的各種資源。他們的第一本書《程序員修煉之道——從小工到專傢》(The Pragmatic Programmer:From jouneyman to master)是麵嚮技術和實踐的暢銷書籍,旨在讓編碼過程更加高效和有趣。
這本書隻有170多頁,讓你能夠在短時間內瞭解如何使用JUnit進行單元測試,而不必啃著大部頭還帶著挫摺感,是學習Junit的首選入門書籍。作者首先告訴你單元測試的重要性,然後手把手教你如何使用Junit進行簡單的單元測試,最後以自己的經驗告訴讀者好的測試應該具有怎樣的品質。...
評分對OOP有一定理解的讀者一定會發現,本書沒有講到單元測試的精髓。什麼是單元測試的精髓呢?我認為是測試類的內聚性。舉個例子:stack類的push和pop方法就是一種高內聚,它們的組閤纔有stack體現齣FILO的性質。單元測試的目標不是孤立地測試push和pop,而是測試FILO性質。 單元...
評分當一個失敗或者錯誤齣現的時候,當前測試方法的執行流程將會被中止,但是(位於同一個測試類中的)其他測試將會繼續進行。 斷言: assertEquals([String message] , expected , actual); message可選消息。錯誤發生時報告這個消息。 數組,比較的是引用。 比較浮點數: as...
評分當一個失敗或者錯誤齣現的時候,當前測試方法的執行流程將會被中止,但是(位於同一個測試類中的)其他測試將會繼續進行。 斷言: assertEquals([String message] , expected , actual); message可選消息。錯誤發生時報告這個消息。 數組,比較的是引用。 比較浮點數: as...
評分按照題目的提示,我也是一名Java初學者。學習編程到現在,聽過或看過不少敏捷編程的東西,知道這麼一個有用的單元測試。但事實上,寫單元測試還是很少,究其原因(就我而言): 1.沒有形成習慣。 2.沒有順手的工具(怕麻煩)。 3.有些情況不知道怎麼寫單元測試。 4.就算寫單元...
開始用Junit的時候可以看一下
评分行文簡要贊。Right-BIECP Corrent A-Trip!
评分清晰明瞭,就是JUnit版本較老。
评分開始用Junit的時候可以看一下
评分還行。隻是一本小書,介紹瞭Unit Test的思想以及使用的基本工具。寫得還不錯。
本站所有內容均為互聯網搜索引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度,google,bing,sogou 等
© 2026 onlinetoolsland.com All Rights Reserved. 本本书屋 版权所有