Effective software testing: a developer's guide
Saved in:
Main Author: | |
---|---|
Format: | Book |
Language: | English |
Published: |
Shelter Island
Manning
[2022]
|
Subjects: | |
Links: | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033083829&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
Physical Description: | xxvi, 300 Seiten Diagramme |
ISBN: | 1633439933 9781633439931 |
Staff View
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV047699883 | ||
003 | DE-604 | ||
005 | 20241127 | ||
007 | t| | ||
008 | 220120s2022 xx |||| |||| 00||| eng d | ||
020 | |a 1633439933 |9 1-63343-993-3 | ||
020 | |a 9781633439931 |9 978-1-63343-993-1 | ||
035 | |a (OCoLC)1288137053 | ||
035 | |a (DE-599)BVBBV047699883 | ||
040 | |a DE-604 |b ger | ||
041 | 0 | |a eng | |
049 | |a DE-739 |a DE-11 |a DE-703 | ||
084 | |a ST 233 |0 (DE-625)143620: |2 rvk | ||
100 | 1 | |a Aniche, Mauricio |d ca. 20./21. Jh. |e Verfasser |0 (DE-588)1259296474 |4 aut | |
245 | 1 | 0 | |a Effective software testing |b a developer's guide |c Mauricio Aniche ; forewords by Arie van Deursen and Steve Freeman |
264 | 1 | |a Shelter Island |b Manning |c [2022] | |
264 | 4 | |c © 2022 | |
300 | |a xxvi, 300 Seiten |b Diagramme | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a Softwareentwicklung |0 (DE-588)4116522-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Softwaretest |0 (DE-588)4132652-0 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Softwareentwicklung |0 (DE-588)4116522-6 |D s |
689 | 0 | 1 | |a Softwaretest |0 (DE-588)4132652-0 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Passau - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033083829&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
943 | 1 | |a oai:aleph.bib-bvb.de:BVB01-033083829 |
Record in the Search Index
_version_ | 1820957227381424128 |
---|---|
adam_text |
brief contents 1 ■ Effective and systematic software testing 2 ■ Specification-based testing з ■ Structural testing and code coverage 4 ■ Designing contracts 5 ■ Property-based testing 6 ■ Test doubles and mocks 141 7 ■ Designing for testability 172 Ց ■ Test-driven development 9 ■ Writing larger tests 97 117 198 215 10 ■ Test code quality 258 11 ■ Wrapping up the book V 30 276 63 1
contents forewords xiii preface xvi acknowledgments xviii about this book xxi about the author xxv about the cover illustration xxvi Effective and systematic software testing 1.1 1.2 1 Developers who test vs. developers who do not 2 Effective software testing for developers 11 Effective testing in the development process 12 ■ Effective testing as an iterative process 14 ■ Focusing on development and then on testing 14· The myth of “correctness by design” 15· The cost oftesting 15* The meaning of effective and systematic 15 The role of test automation 16 1.3 Principles of software testing (or, why testing is so difficult) 16 Exhaustive testing is impossible 16 · Knowing when to stop testing 17· Variability is important (the pesticide paradox) 17 Bugs happen in some places more than others 17· No matter what testing you do, it will never be perfect or enough 18 · Context is king 18 · Verification is not validation 18 vii
CONTENTS 1.4 The testing pyramid, and where we should focus 19 Unit testing 19 ■ Integration testing 20 ■ System testing 21 When to use each test level 23· Why do Ifavor unit tests'? 23 What do I test at the different levels ? 24 · What ifyou disagree with the testing pyramid? 25 * Will this book help you find all the bugs? 27 Specification-based testing 30 2.1 The requirements say it all 31 Step 1: Understanding the requirements, inputs, and outputs 33 Step 2: Explore what the program does for various inputs 34 Step 3: Explore possible inputs and outputs, and identify partitions 35 ■ Step 4: Analyze the boundaries 37 * Step 5: Devise test cases 39 ■ Step 6: Automate the test cases 41 Step 7: Augment the test suite with creativity and experience 43 2.2 2.3 2.4 Specification-based testing in a nutshell 45 Finding bugs with specification testing 46 Specification-based testing in the real world 54 The process should be iterative, not sequential 54 · How far should specification testing go? 55 · Partition or boundary ? It does not matter! 55 ■ On and offpoints are enough, butfeelfree to add in and out points 55 ■ Use variations of the same input to facilitate understanding 55 ■ When the number of combinations explodes, be pragmatic 56 ■ When in doubt, go for the simplest input 56 ■ Pick reasonable values for inputs you do not care about 56 ■ Test for nuUs and exceptional cases, but only when it makes sense 56 ■ Go for parameterized tests when tests have the same skeleton 57· Requirements can be of any granularity 57 How does this work with classes and state? 57· The role of
experience and creativity 59 Structural testing and code coverage 3.1 3.2 3.3 Code coverage, the right way 64 Structural testing in a nutshell 68 Code coverage criteria 69 Line coverage 69 ■ Branch coverage coverage 70 ■ Path coverage 71 3.4 69 ■ Condition + branch Complex conditions and the MC/DC coverage criterion An abstract example MC/DC 73 3.5 63 72 ■ Creating a test suite that achieves Handling loops and similar constructs 75 72
CONTENTS 3.6 3.7 3.8 3.9 3.10 ix Criteria subsumption, and choosing a criterion 75 Specification-based and structural testing: A running example 77 Boundary testing and structural testing 82 Structural testing alone often is not enough 82 Structural testing in the real world 84 Why do some people hate code coverage1? 84* What does it mean to achieve 100% coverage? 86* What coverage criterion to use 88 MC/DC when expressions are too complex and cannot be simplified 88 ■ Other coverage criteria 89 ■ WAaZ should not be covered? 90 3.11 Mutation testing Designing contracts 4.1 97 Pre-conditions and post-conditions The assert keyword conditions 100 4.2 4.3 90 99 ■ Strong and weak pre- and post Invariants 102 Changing contracts, and the Liskov substitution principle Inheritance and contracts 4.4 4.5 98 107 How is design-by-contract related to testing? Design-by-contract in the real world 110 109 Weak or strong pre-conditions? 110* Input validation, contracts, or both ? 110 * Asserts and exceptions: When to use one or the other 112* Exception or soft return values? 113 * When not to use design-by-contract 113* Should we write tests for pre-conditions, post-conditions, and invariants? 114* Tooling support 114 Property-based testing 5.1 5.2 5.3 5.4 5.5 5.6 117 Example 1: The passing grade program 118 Example 2: Testing the unique method 122 Example 3: Testing the indexOf method 124 Example 4: Testing the Basket class 129 Example 5: Creating complex domain objects 136 Property-based testing in the real world 137 Example-based testing vs. property-based testing 137* Common issues in
property-based tests 138* Creativity is key 139 105
CONTENTS x X՜ Test doubles and mocks 6.1 141 Dummies, fakes, stubs, spies, and mocks Dummy objects 143 ■ Fake objects Mocks 144 · Spies 144 6.2 143 144 ■ Stubs An introduction to mocking frameworks 144 145 Stubbing dependencies 145 ■ Mocks and expectations 150 Capturing arguments 153 ■ Simulating exceptions 157 6.3 Mocks in the real world 158 The disadvantages of mocking 159* What to mock and what not to mock 160 · Date and time wrappers 164 ■ Mocking types you do not own 166* What do others say about mocking? 168 77 Designingfor testability 172 ' 7.1 7.2 7.3 Separating infrastructure code from domain code 173 Dependency injection and controllability 181 Making your classes and methods observable 184 Example 1: Introducing methods to facilitate assertions 184 Example 2: Observing the behavior of void methods 186 7.4 7.5 Dependency via class constructor or value via method parameter? 189 Designing for testability in the real world 191 The cohesion of the class under test 192* The coupling of the class under test 193 · Complex conditions and testability 193 Private methods and testability 193 · Static methods, singletons, and testability 194 * The Hexagonal Architecture and mocks as a design technique 194 * Further reading about designingfor testability 195 О Test-driven development 8.1 8.2 8.3 198 Our first TDD session 199 Reflecting on our first TDD experience TDD in the real world 208 206 To TDD or not to TDD? 208 - TDD 100% of the time? 209 Does TDD work for all types of applications and domains? 209 What does the research say about TDD? 209 · Other schools of TDD 211 *
TDD and proper testing 212
CONTENTS Writing larger tests 9.1 215 When to use larger tests 216 Testing larger components 216 ■ Testing larger components that go beyond our code base 224 9.2 Database and SQL testing 229 What to test in a SQL query 229 ■ Writing automated tests for SQL queries 231 ■ Setting up infrastructure for SQL tests 236 Best practices 238 9.3 System tests 239 An introduction to Selenium 239 ■ Designing page objects Patterns and best practices 251 9.4 Final notes on larger tests 242 254 How do all the testing techniques fit? 254 ■ Perform cost/benefit analysis 255 ■ Be careful with methods that are covered but not tested 255 ■ Proper code infrastructure is key 255 ■ DSLs and tools for stakeholders to write tests 256 * Testing other types of web systems 256 Test code quality 10.1 258 Principles of maintainable test code 259 Tests should befast 259 ■ Tests should be cohesive, independent, and isolated 259 ■ Tests should have a reason to exist 260 Tests should be repeatable and not flaky 260 * Tests should have strong assertions 261 ■ Tests should break if the behavior changes 261 ■ Tests should have a single and clear reason to fail 262 ■ Tests should be easy to write 262 ■ Tests should be easy to read 262 ■ Tests should be easy to change and evolve 266 10.2 Test smells 267 Excessive duplication 267 · Unclear assertions 268 · Bad handling of complex or external resources 268 ■ Fixtures that are too general 269 · Sensitive assertions 270 Wrapping up the book 11.1 11.2 11.3 11.4 276 Although the model looks linear, iterations are fundamental 276 Bug-free software development: Reality
or myth? Involve your final user 278 Unit testing is hard in practice 278 277
CONTENTS xii 11.5 Invest in monitoring 11.6 What’s next? appendix 280 Answers to exercises References index 295 289 279 281 |
any_adam_object | 1 |
author | Aniche, Mauricio ca. 20./21. Jh |
author_GND | (DE-588)1259296474 |
author_facet | Aniche, Mauricio ca. 20./21. Jh |
author_role | aut |
author_sort | Aniche, Mauricio ca. 20./21. Jh |
author_variant | m a ma |
building | Verbundindex |
bvnumber | BV047699883 |
classification_rvk | ST 233 |
ctrlnum | (OCoLC)1288137053 (DE-599)BVBBV047699883 |
discipline | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>00000nam a2200000 c 4500</leader><controlfield tag="001">BV047699883</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20241127</controlfield><controlfield tag="007">t|</controlfield><controlfield tag="008">220120s2022 xx |||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1633439933</subfield><subfield code="9">1-63343-993-3</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781633439931</subfield><subfield code="9">978-1-63343-993-1</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)1288137053</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV047699883</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-739</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-703</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">Aniche, Mauricio</subfield><subfield code="d">ca. 20./21. Jh.</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1259296474</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Effective software testing</subfield><subfield code="b">a developer's guide</subfield><subfield code="c">Mauricio Aniche ; forewords by Arie van Deursen and Steve Freeman</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Shelter Island</subfield><subfield code="b">Manning</subfield><subfield code="c">[2022]</subfield></datafield><datafield tag="264" ind1=" " ind2="4"><subfield code="c">© 2022</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">xxvi, 300 Seiten</subfield><subfield code="b">Diagramme</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="650" ind1="0" ind2="7"><subfield code="a">Softwareentwicklung</subfield><subfield code="0">(DE-588)4116522-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Softwaretest</subfield><subfield code="0">(DE-588)4132652-0</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Softwareentwicklung</subfield><subfield code="0">(DE-588)4116522-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Softwaretest</subfield><subfield code="0">(DE-588)4132652-0</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Passau - ADAM Catalogue Enrichment</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=033083829&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="943" ind1="1" ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-033083829</subfield></datafield></record></collection> |
id | DE-604.BV047699883 |
illustrated | Not Illustrated |
indexdate | 2025-01-11T12:55:38Z |
institution | BVB |
isbn | 1633439933 9781633439931 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-033083829 |
oclc_num | 1288137053 |
open_access_boolean | |
owner | DE-739 DE-11 DE-703 |
owner_facet | DE-739 DE-11 DE-703 |
physical | xxvi, 300 Seiten Diagramme |
publishDate | 2022 |
publishDateSearch | 2022 |
publishDateSort | 2022 |
publisher | Manning |
record_format | marc |
spelling | Aniche, Mauricio ca. 20./21. Jh. Verfasser (DE-588)1259296474 aut Effective software testing a developer's guide Mauricio Aniche ; forewords by Arie van Deursen and Steve Freeman Shelter Island Manning [2022] © 2022 xxvi, 300 Seiten Diagramme txt rdacontent n rdamedia nc rdacarrier Softwareentwicklung (DE-588)4116522-6 gnd rswk-swf Softwaretest (DE-588)4132652-0 gnd rswk-swf Softwareentwicklung (DE-588)4116522-6 s Softwaretest (DE-588)4132652-0 s DE-604 Digitalisierung UB Passau - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033083829&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Aniche, Mauricio ca. 20./21. Jh Effective software testing a developer's guide Softwareentwicklung (DE-588)4116522-6 gnd Softwaretest (DE-588)4132652-0 gnd |
subject_GND | (DE-588)4116522-6 (DE-588)4132652-0 |
title | Effective software testing a developer's guide |
title_auth | Effective software testing a developer's guide |
title_exact_search | Effective software testing a developer's guide |
title_full | Effective software testing a developer's guide Mauricio Aniche ; forewords by Arie van Deursen and Steve Freeman |
title_fullStr | Effective software testing a developer's guide Mauricio Aniche ; forewords by Arie van Deursen and Steve Freeman |
title_full_unstemmed | Effective software testing a developer's guide Mauricio Aniche ; forewords by Arie van Deursen and Steve Freeman |
title_short | Effective software testing |
title_sort | effective software testing a developer s guide |
title_sub | a developer's guide |
topic | Softwareentwicklung (DE-588)4116522-6 gnd Softwaretest (DE-588)4132652-0 gnd |
topic_facet | Softwareentwicklung Softwaretest |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033083829&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT anichemauricio effectivesoftwaretestingadevelopersguide |