Unit testing in Java: how tests drive the code
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Amsterdam [u.a.]
Morgan Kaufmann Publ.
2009
|
Ausgabe: | transferred to digital print. |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | Includes bibliographical references and index |
Beschreibung: | XVII, 376 S. |
ISBN: | 9781558608689 1558608680 |
Internformat
MARC
LEADER | 00000nam a2200000zc 4500 | ||
---|---|---|---|
001 | BV037249633 | ||
003 | DE-604 | ||
005 | 00000000000000.0 | ||
007 | t | ||
008 | 110225s2009 xxu |||| 00||| eng d | ||
020 | |a 9781558608689 |9 978-1-55860-868-9 | ||
020 | |a 1558608680 |9 1-55860-868-0 | ||
035 | |a (OCoLC)711833993 | ||
035 | |a (DE-599)BVBBV037249633 | ||
040 | |a DE-604 |b ger |e aacr | ||
041 | 0 | |a eng | |
044 | |a xxu |c US | ||
049 | |a DE-473 | ||
084 | |a ST 233 |0 (DE-625)143620: |2 rvk | ||
100 | 1 | |a Link, Johannes |e Verfasser |4 aut | |
240 | 1 | 0 | |a Unite tests mit Java |
245 | 1 | 0 | |a Unit testing in Java |b how tests drive the code |c Johannes Link. With contibutions by Peter Fröhlich |
250 | |a transferred to digital print. | ||
264 | 1 | |a Amsterdam [u.a.] |b Morgan Kaufmann Publ. |c 2009 | |
300 | |a XVII, 376 S. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
500 | |a Includes bibliographical references and index | ||
650 | 0 | 7 | |a Extreme programming |0 (DE-588)4618499-5 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Test-First-Ansatz |0 (DE-588)4674451-4 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Java |g Programmiersprache |0 (DE-588)4401313-9 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Komponententest |0 (DE-588)4674453-8 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a JUnit |0 (DE-588)4773076-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Automation |0 (DE-588)4003957-2 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Extreme programming |0 (DE-588)4618499-5 |D s |
689 | 0 | 1 | |a Komponententest |0 (DE-588)4674453-8 |D s |
689 | 0 | 2 | |a Automation |0 (DE-588)4003957-2 |D s |
689 | 0 | 3 | |a Test-First-Ansatz |0 (DE-588)4674451-4 |D s |
689 | 0 | 4 | |a Java |g Programmiersprache |0 (DE-588)4401313-9 |D s |
689 | 0 | |8 1\p |5 DE-604 | |
689 | 1 | 0 | |a JUnit |0 (DE-588)4773076-6 |D s |
689 | 1 | |8 2\p |5 DE-604 | |
700 | 1 | |a Frölich, Peter |e Sonstige |4 oth | |
856 | 4 | 2 | |m Digitalisierung UB Bamberg |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021162973&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-021162973 | ||
883 | 1 | |8 1\p |a cgwrk |d 20201028 |q DE-101 |u https://d-nb.info/provenance/plan#cgwrk | |
883 | 1 | |8 2\p |a cgwrk |d 20201028 |q DE-101 |u https://d-nb.info/provenance/plan#cgwrk |
Datensatz im Suchindex
_version_ | 1804143864078925824 |
---|---|
adam_text | Contents
Foreword
Erich
Gamma
Foreward
FrankWestphal
Preface
vu
XVII
Part I
Basic Techniques
Chapter
1
Introduction
1.1
Important Terms
5
1.2
XP Testing
6
Communication, Simplicity, Feedback, and Courage
7
Pair Programming
7
Incremental and Iterative Development
8
Refactoring
8
Test Types in XP
9
XPorNotXP?
10
1.3
Classic Testing
11
1.4
Test-First Development-A Brief Definition
16
1.5
Java Only-Or Other Coffee?
18
1.6
Objectives of This Book
18
1.7
Organization of This Book
19
X D
Contents
Chapter
2
Chapter
3
1.8
Conventions in This Book
20
1.9
Web Site to This Book
21
Automating Unit Tests
2.1
What Do We Want to Automate?
24
2.2
Requirements for an Automation Framework
25
2.3
JUnit
27
Installing and Running Tests
28
Creating Test Classes
30
Fixtures
34
Creating Test Suites
36
2.4
Summary
37
Basic Steps of the Test-First Approach
3.1
Step by Step
39
3.2
Dependencies
48
3.3
Organizing and Running Tests
57
Organizing Tests
57
Running Tests
62
3.4
Summary
63
23
39
Chapter
4
Test
Ideas and Heuristics
4.1
Reworking Single Tests
66
4.2
Black and White Boxes
70
4.3
Testing the Typical Functionality
71
4.4
Threshold Values and Equivalence Classes
73
4.5
Error Cases and Exceptions
75
4.6
Object Interactions
81
4.7
Design by Contract
84
4.8
More Ideas to Find Test Cases
86
4.9
Refactoring Code
and Tests
87
4.10
Summary
90
Chapter
5
The
nner Life of a Test Framework
65
91
5.1
Statics
91
5.2
The Life Cycle of a Test Suite
93
5.3
Project-Specific Expansions
95
5.4
Summary
96
Contents
α
xi
Chapter
6
Dummy and Mock Objects for Independence
6.1
Little Dummies
97
6.2
Weltering in Technical Terms
100
6.3
Big Dummies
100
6.4
Extending Our Mansion
107
6.5
Endoscopie
Testing
108
6.6
Mock Objects from the Assembly Line
113
Mock Library
113
Mock Generators
114
Mock Objects the Easy Way
114
6.7
Testing Threshold Values and Exceptions
116
6.8
How Does the Test Get to the Mock?
119
6.9
Evil Singletons
122
6.10
Lightweight and Heavyweight Mocks
124
6.11
File Dummies
129
6.12
More Typical Mock Objects
133
6.13
External Components
134
6.14
The Pros and Cons
137
Heuristics for the Use of Mocks
140
6.15
Summary
141
Chapter
7
Inheritance and Polymorphism
7.1
Inheritance
143
Well-Shaped Inheritance Hierarchies
143
Reusing Superclass Tests
146
Test Class Hierarchies by
Refactoring
151
Testing Interfaces
152
Testing Abstract Classes
155
7.2
Polymorphism
155
7.3
Summary
160
Chapter
8
How
Much Is Enough?
8.1
The XP Rule
162
8.2
Clear Answers to Clear Questions
163
97
143
161
Tests per Class
164
Getters and Setters
164
Non-Public Object Properties
164
Complex Interaction Tests
166
Testing the Tests
167
xii
D
Contents
8.3
Test Coverage
167
Specification-Based Coverage
168
Code-Based Coverage
168
8.4
Summary
170
Part II
Advanced Topics
Chapter
9
Persistent Objects
9.1
Abstract Persistence Interface
175
9.2
Persistent Dummy
178
9.3
Designing a Database Interface
181
Transactions
182
Ad Hoc Queries
184
Object-Centered Persistence
185
9.4
Testing the Right Persistence
187
Approaches for Test Data Consistency
191
Speeding Up the Test Suite
192
JDBC Mocks
193
Evolution of the Persistence Technology
195
9.5
Interaction between Persistence Layer and Client
196
9.6
Summary
198
Chapter
10
Concurrent Programs
173
201
10.1
Problems Using Threads
202
Nondeterminism
203
Target Objects
203
10.2
Testing Asynchronous Services
204
Service without Result
204
Service with Result
208
Expected Exceptions in Split-Off Threads
210
Unexpected Exceptions
212
10.3
Testing for Synchronization
212
Simple Test Cases
213
Concurrent Test Cases
214
Nondeterministic Test Cases
219
10.4
Summary
222
Contents D
ХІІІ
Chapter
11
Chapter
12
Chapter
13
Distributed Applications
Distribution Mechanisms in Java
226
11.1
RMI
227
The Server
227
The Client
232
Summary of RMI
235
11.2
Enterprise JavaBeans
236
Just a Facade
237
Testing Inside the Container
238
EJBs and Simple Design
239
11.3
Summary
240
Web Applications
12.1
Functional Tests
242
12.2
Testing on the Server
247
12.3
Testing with Dummies
250
12.4
Separating the
Serviet
API from the
Serviet
Logic
256
12.5
Testing the HTML Generation
259
Java Server Pages
260
JSP Custom Tags
260
Struts
261
12.6
Summary
261
Graphical User Interfaces
13.1
The Direct Way
263
Brief Summary
283
Keeping the GUI Clear
285
13.2
Short Detours
286
JFCUnit
287
The AWT Robot
289
Other Tools
290
13.3
Summary
290
225
241
263
Chapter
14
The Role of Unit Tests ¡n the Software Process
291
14.1
Activities in the Defined Software Process
292
Activities and Products
292
Construction Activities
294
Verification
295
xiv
D
Contents
Validation
296
Quality Assurance
297
14.2
Process Types and Testing Strategies
299
Sequential Models
300
Incremental Models
302
Evolutionary Models
303
Continuous Integration
305
14.3
Costs and Benefits of Automated Unit Tests
305
14.4
Commercial Process Models
307
Rational Unified Process
308
Extreme Programming
311
XP versus
RUP
312
14.5
Will Automated Unit Tests Fit in My Process?
312
Chapter
15
Loose Ends and Opportunities
313
15.1
Unit Testing for Existing Software
314
Testing around Legacy Code
316
15.2
Introducing Unit Tests to the Development Team
317
The Craftsmanship Approach
318
The Organizational Approach
318
15.3
What s Missing?
320
Part III
Appendices
Appendix A Notes to JUnit
325
A.1 Frequently Asked Questions (FAQs)
325
How Do I Implement a Test Case for a Thrown Exception?
326
How Do I Organize My Test Case Classes?
326
How Do I Run Setup Code Once for All My Test Cases?
327
I Get a ClassNotFoundException When I Use LoadingTestRunner.
What Can I Do?
327
Why Do I Get Exception XYZ When Using a Graphical Test Runner, But Not in
the Textual Test Runner?
328
assert Has Been a Keyword Since JDK
1.4.
lsn t There a Conflict with JUnit s
Assert Method?
328
How Do I Best Integrate JUnit with My Favorite Development Environment?
328
Contents D
XV
A.2 JUnit
Expansions
329
JUnitX
and XPTest
329
Daedalos JUnit
Extensions
329
JFCUnit 330
JUnitPP 330
Mock Objects
330
МоскМакег
330
EasyMock 331
JXUnit
331
JUnitHelp
ЪЪ
Joshua
331
JDepend
331
JesTer
332
HttpUnit
332
JUnitEE
332
Canoo WebTest
333
Cactus
333
JUnitPerf
333
J2ME Unit
333
Test Mentor Java Edition
334
Appendix
В
Unit Tests with Other Programming Languages
335
B.1 Smalltalk
335
Creating Test Cases with SUnit
335
Differences to Java
336
Evaluation
337
B.2
C++ 338
Installation
338
Setting Up a Test Project
339
Creating Test Cases
339
Running Your Tests
340
Overall Impression
343
3.3
The Rest
343
Glossary
345
Bibliography and List of References
353
Bibliography
353
URL·
359
Further Reading
362
Extreme Programming
362
Test-First and
JUnit
363
Testing Object-Oriented Software
363
Miscellaneous
364
Index
365
|
any_adam_object | 1 |
author | Link, Johannes |
author_facet | Link, Johannes |
author_role | aut |
author_sort | Link, Johannes |
author_variant | j l jl |
building | Verbundindex |
bvnumber | BV037249633 |
classification_rvk | ST 233 |
ctrlnum | (OCoLC)711833993 (DE-599)BVBBV037249633 |
discipline | Informatik |
edition | transferred to digital print. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>02265nam a2200541zc 4500</leader><controlfield tag="001">BV037249633</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">00000000000000.0</controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">110225s2009 xxu |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781558608689</subfield><subfield code="9">978-1-55860-868-9</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1558608680</subfield><subfield code="9">1-55860-868-0</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)711833993</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV037249633</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">aacr</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="044" ind1=" " ind2=" "><subfield code="a">xxu</subfield><subfield code="c">US</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-473</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 233</subfield><subfield code="0">(DE-625)143620:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Link, Johannes</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="240" ind1="1" ind2="0"><subfield code="a">Unite tests mit Java</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Unit testing in Java</subfield><subfield code="b">how tests drive the code</subfield><subfield code="c">Johannes Link. With contibutions by Peter Fröhlich</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">transferred to digital print.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Amsterdam [u.a.]</subfield><subfield code="b">Morgan Kaufmann Publ.</subfield><subfield code="c">2009</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XVII, 376 S.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Includes bibliographical references and index</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Extreme programming</subfield><subfield code="0">(DE-588)4618499-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Test-First-Ansatz</subfield><subfield code="0">(DE-588)4674451-4</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Java</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4401313-9</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Komponententest</subfield><subfield code="0">(DE-588)4674453-8</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">JUnit</subfield><subfield code="0">(DE-588)4773076-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Automation</subfield><subfield code="0">(DE-588)4003957-2</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Extreme programming</subfield><subfield code="0">(DE-588)4618499-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Komponententest</subfield><subfield code="0">(DE-588)4674453-8</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="2"><subfield code="a">Automation</subfield><subfield code="0">(DE-588)4003957-2</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="3"><subfield code="a">Test-First-Ansatz</subfield><subfield code="0">(DE-588)4674451-4</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="4"><subfield code="a">Java</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4401313-9</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="8">1\p</subfield><subfield code="5">DE-604</subfield></datafield><datafield tag="689" ind1="1" ind2="0"><subfield code="a">JUnit</subfield><subfield code="0">(DE-588)4773076-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="1" ind2=" "><subfield code="8">2\p</subfield><subfield code="5">DE-604</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Frölich, Peter</subfield><subfield code="e">Sonstige</subfield><subfield code="4">oth</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Bamberg</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021162973&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-021162973</subfield></datafield><datafield tag="883" ind1="1" ind2=" "><subfield code="8">1\p</subfield><subfield code="a">cgwrk</subfield><subfield code="d">20201028</subfield><subfield code="q">DE-101</subfield><subfield code="u">https://d-nb.info/provenance/plan#cgwrk</subfield></datafield><datafield tag="883" ind1="1" ind2=" "><subfield code="8">2\p</subfield><subfield code="a">cgwrk</subfield><subfield code="d">20201028</subfield><subfield code="q">DE-101</subfield><subfield code="u">https://d-nb.info/provenance/plan#cgwrk</subfield></datafield></record></collection> |
id | DE-604.BV037249633 |
illustrated | Not Illustrated |
indexdate | 2024-07-09T22:54:26Z |
institution | BVB |
isbn | 9781558608689 1558608680 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-021162973 |
oclc_num | 711833993 |
open_access_boolean | |
owner | DE-473 DE-BY-UBG |
owner_facet | DE-473 DE-BY-UBG |
physical | XVII, 376 S. |
publishDate | 2009 |
publishDateSearch | 2009 |
publishDateSort | 2009 |
publisher | Morgan Kaufmann Publ. |
record_format | marc |
spelling | Link, Johannes Verfasser aut Unite tests mit Java Unit testing in Java how tests drive the code Johannes Link. With contibutions by Peter Fröhlich transferred to digital print. Amsterdam [u.a.] Morgan Kaufmann Publ. 2009 XVII, 376 S. txt rdacontent n rdamedia nc rdacarrier Includes bibliographical references and index Extreme programming (DE-588)4618499-5 gnd rswk-swf Test-First-Ansatz (DE-588)4674451-4 gnd rswk-swf Java Programmiersprache (DE-588)4401313-9 gnd rswk-swf Komponententest (DE-588)4674453-8 gnd rswk-swf JUnit (DE-588)4773076-6 gnd rswk-swf Automation (DE-588)4003957-2 gnd rswk-swf Extreme programming (DE-588)4618499-5 s Komponententest (DE-588)4674453-8 s Automation (DE-588)4003957-2 s Test-First-Ansatz (DE-588)4674451-4 s Java Programmiersprache (DE-588)4401313-9 s 1\p DE-604 JUnit (DE-588)4773076-6 s 2\p DE-604 Frölich, Peter Sonstige oth Digitalisierung UB Bamberg application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021162973&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis 1\p cgwrk 20201028 DE-101 https://d-nb.info/provenance/plan#cgwrk 2\p cgwrk 20201028 DE-101 https://d-nb.info/provenance/plan#cgwrk |
spellingShingle | Link, Johannes Unit testing in Java how tests drive the code Extreme programming (DE-588)4618499-5 gnd Test-First-Ansatz (DE-588)4674451-4 gnd Java Programmiersprache (DE-588)4401313-9 gnd Komponententest (DE-588)4674453-8 gnd JUnit (DE-588)4773076-6 gnd Automation (DE-588)4003957-2 gnd |
subject_GND | (DE-588)4618499-5 (DE-588)4674451-4 (DE-588)4401313-9 (DE-588)4674453-8 (DE-588)4773076-6 (DE-588)4003957-2 |
title | Unit testing in Java how tests drive the code |
title_alt | Unite tests mit Java |
title_auth | Unit testing in Java how tests drive the code |
title_exact_search | Unit testing in Java how tests drive the code |
title_full | Unit testing in Java how tests drive the code Johannes Link. With contibutions by Peter Fröhlich |
title_fullStr | Unit testing in Java how tests drive the code Johannes Link. With contibutions by Peter Fröhlich |
title_full_unstemmed | Unit testing in Java how tests drive the code Johannes Link. With contibutions by Peter Fröhlich |
title_short | Unit testing in Java |
title_sort | unit testing in java how tests drive the code |
title_sub | how tests drive the code |
topic | Extreme programming (DE-588)4618499-5 gnd Test-First-Ansatz (DE-588)4674451-4 gnd Java Programmiersprache (DE-588)4401313-9 gnd Komponententest (DE-588)4674453-8 gnd JUnit (DE-588)4773076-6 gnd Automation (DE-588)4003957-2 gnd |
topic_facet | Extreme programming Test-First-Ansatz Java Programmiersprache Komponententest JUnit Automation |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021162973&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT linkjohannes unitetestsmitjava AT frolichpeter unitetestsmitjava AT linkjohannes unittestinginjavahowtestsdrivethecode AT frolichpeter unittestinginjavahowtestsdrivethecode |