Test-driven development for embedded C:
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Raleigh, N.C. [u.a.]
Pragmatic Bookshelf
2011
|
Schriftenreihe: | The Pragmatic Programmers
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XXIV, 326 S. graph. Darst. |
ISBN: | 9781934356623 193435662X |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV037404254 | ||
003 | DE-604 | ||
005 | 20210818 | ||
007 | t | ||
008 | 110517s2011 d||| |||| 00||| eng d | ||
020 | |a 9781934356623 |9 978-1-934356-62-3 | ||
020 | |a 193435662X |9 1-934356-62-X | ||
024 | 3 | |a 9781934356623 | |
035 | |a (OCoLC)729948986 | ||
035 | |a (DE-599)BSZ344482170 | ||
040 | |a DE-604 |b ger | ||
041 | 0 | |a eng | |
049 | |a DE-522 |a DE-83 |a DE-91G |a DE-Aug4 |a DE-188 |a DE-739 |a DE-11 |a DE-M347 |a DE-384 | ||
082 | 0 | |a 005.12 | |
084 | |a ST 153 |0 (DE-625)143597: |2 rvk | ||
084 | |a DAT 358f |2 stub | ||
084 | |a DAT 330f |2 stub | ||
084 | |a DAT 310f |2 stub | ||
084 | |a DAT 260f |2 stub | ||
100 | 1 | |a Grenning, James W. |e Verfasser |4 aut | |
245 | 1 | 0 | |a Test-driven development for embedded C |c James W. Grenning |
264 | 1 | |a Raleigh, N.C. [u.a.] |b Pragmatic Bookshelf |c 2011 | |
300 | |a XXIV, 326 S. |b graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a The Pragmatic Programmers | |
650 | 4 | |a Application software / Development | |
650 | 4 | |a C (Computer program language) | |
650 | 0 | 7 | |a Softwareentwicklung |0 (DE-588)4116522-6 |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 Eingebettetes System |0 (DE-588)4396978-1 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Test-First-Ansatz |0 (DE-588)4674451-4 |D s |
689 | 0 | 1 | |a Eingebettetes System |0 (DE-588)4396978-1 |D s |
689 | 0 | 2 | |a Softwareentwicklung |0 (DE-588)4116522-6 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Passau |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=022556857&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-022556857 |
Datensatz im Suchindex
_version_ | 1804145698735652864 |
---|---|
adam_text | JÛQDîentS
Foreword by Jack Ganssle
......... xiii
Foreword by Robert C. Martin
........ xv
Acknowledgments
........... xix
Preface
.............. xxi
1.
Test-Driven Development
.......... 1
1.1
Why Do We Need TDD?
2
1.2
What Is Test-Driven Development?
4
1.3
Physics of TDD
5
1.4
The TDD
Microcycle
6
1.5
TDD Benefits
8
1.6
Benefits for Embedded
10
Part I
—
Getting Started
2.
Test-Driving Tools and Conventions
....... 13
2.1
What Is a Unit Test Harness?
13
2.2
Unity: A
С
-Only Test Harness
14
2.3
CppUTest: A
C++
Unit Test Harness
21
2.4
Unit Tests Can Crash
24
2.5
The Four-Phase Test Pattern
25
2.6
Where Are We?
25
3.
Starting
а С
Module
........... 27
3.1
Elements of a Testable
С
Module
27
3.2
What Does an LED Driver Do?
29
3.3
Write a Test List
29
3.4
Writing the First Test
31
3.5
Test-Drive the Interface Before the Internals
36
viii
· Contents
3.6
Incremental
Progress
42
3.7
Test-Driven Developer State Machine
45
3.8
Tests Are FIRST
46
3.9
Where Are We?
47
4.
Testing Your Way to Done
.........49
4.1
Grow the Solution from Simple Beginnings
49
4.2
Keep the Code Clean
—
Refactor
as You Go
64
4.3
Repeat Until Done
67
4.4
Take a Step Back Before Claiming Done
73
4.5
Where Are We?
74
5.
Embedded TDD Strategy
.........77
5.1
The Target Hardware Bottleneck
77
5.2
Benefits of Dual-Targeting
78
5.3
Risks of Dual-Target Testing
79
5.4
The Embedded TDD Cycle
80
5.5
Dual-Target Incompatibilities
83
5.6
Testing with Hardware
88
5.7
Slow Down to Go Fast
91
5.8
Where Are We?
91
6.
Yeah, but
................93
6.1
We Don t Have Time
93
6.2
Why Not Write Tests After the Code?
97
6.3
We ll Have to Maintain the Tests
97
6.4
Unit Tests Don t Find All the Bugs
98
6.5
We Have a Long Build Time
98
6.6
We Have Existing Code
99
6.7
We Have Constrained Memory
99
6.8
We Have to Interact with Hardware
100
6.9
Why a
C++
Test Harness for Testing C?
101
6.10
Where Are We?
102
Part II
—
Testing Modules with Collaborators
7.
Introducing Test Doubles
.........107
7.1
Collaborators
107
7.2
Breaking Dependencies
108
7.3
When to Use a Test Double
112
Contents · ix
7.4 Faking
It
in
С,
What s Next
113
7.5
Where Are We?
116
8.
Spying on the Production Code
.......117
8.1
Light Scheduler Test List
118
8.2
Dependencies on Hardware and OS
118
8.3
Link-Time Substitution
119
8.4
Spying on the Code Under Test
120
8.5
Controlling the Clock
126
8.6
Make It Work for None, Then One
127
8.7
Make It Work for Many
140
8.8
Where Are We?
145
9.
Runtime-Bound Test Doubles
........147
9.1
Testing Randomness
147
9.2
Faking with a Function Pointer
149
9.3
Surgically Inserted Spy
152
9.4
Verifying Output with a Spy
156
9.5
Where Are We?
160
10.
The Mock Object
...........163
10.1
Flash Driver
163
10.2
MocklO
171
10.3
Test-Driving the Driver
174
10.4
Simulating a Device Timeout
178
10.5
Is It Worth It?
180
10.6
Mocking with CppUMock
180
10.7
Generating Mocks
183
10.8
Where Are We?
185
Part III
—
Design and Continuous Improvement
11.
SOLID, Flexible, and Testable Designs
......189
11.1
SOLID Design Principles
190
11.2
SOLID
С
Design Models
193
11.3
Evolving Requirements and a Problem Design
195
11.4
Improving the Design with Dynamic Interface
203
11.5
More Flexibility with
Per
-Туре
Dynamic Interface
210
11.6
How Much Design Is Enough?
214
11.7
Where Are We?
216
χ
· Contents
12.
Refactoring
............219
12.1
Two
Values
of
Software
219
12.2
Three Critical Skills
220
12.3
Code Smells and How to Improve Them
222
12.4
Transforming the Code
232
12.5
But What About Performance and Size?
249
12.6
Where Are We?
251
13.
Adding Tests to Legacy Code
........253
13.1
Legacy Code Change Policy
253
13.2
Boy Scout Principle
254
13.3
Legacy Change Algorithm
255
13.4
Test Points
257
13.5
Two-Stage struct Initialization
260
13.6
Crash to Pass
263
13.7
Characterization Tests
268
13.8
Learning Tests for Third-Party Code
271
13.9
Test-Driven Bug Fixes
274
13.10
Add Strategic Tests
274
13.11
Where Are We?
274
14.
Test Patterns and Antipatterns
........277
14.1
Ramble-on Test Antipattem
277
14.2
Copy-Paste-Tweak-Repeat Antipattem
279
14.3
Sore Thumb Test Cases Antipattem
280
14.4
Duplication Between Test Groups Antipattem
282
14.5
Test Disrespect Antipattem
283
14.6
Behavior-Driven Development Test Pattern
283
14.7
Where Are We?
284
15.
Closing Thoughts
...........285
Part IV
—
Appendixes
Al.
Development System Test Environment
.....291
Al
. 1
Development System Tool Chain
291
Al.
2
Full Test Build makefile
293
A1.3 Smaller Test Builds
294
Contents · xi
A2.
Unity Quick Reference
.......... 297
A2.1 Unity Test File
297
A2.2 Unity Test main
299
A2.3 Unity TEST Condition Checks
299
A2.4 Command-Line Options
300
A2.5 Unity in Your Target
300
A3.
CppUTest Quick Reference
......... 303
A3.1 The CppUTest Test File
303
A3.2 Test Main
304
A3.3 TEST Condition Checks
304
A3.4 Test Execution Order
305
A3.5
Scripts to Create Starter Files
305
A3.6
CppUTest in Your Target
306
A3.7 Convert CppUTest Tests to Unity
307
A4.
LedDriver After Getting Started
....... 309
A4.1
LedDriver First Few Tests in Unity
309
A4.2
LedDriver First Few Tests in CppUTest
310
A4.3 LedDriver Early Interface
310
A4.4
LedDriver Skeletal Implementation
311
A5. Example OS Isolation Layer
........ 313
A5.
1
Test Cases to Assure Substitutable Behavior
314
A5.2 POSIX Implementation
315
A5.3 Micrium RTOS Implementation
317
A5.4
Win32
Implementation
319
A5.5 Burden the Layer, Not the Application
320
A6. Bibliography
............ 321
Index
.............. 323
|
any_adam_object | 1 |
author | Grenning, James W. |
author_facet | Grenning, James W. |
author_role | aut |
author_sort | Grenning, James W. |
author_variant | j w g jw jwg |
building | Verbundindex |
bvnumber | BV037404254 |
classification_rvk | ST 153 |
classification_tum | DAT 358f DAT 330f DAT 310f DAT 260f |
ctrlnum | (OCoLC)729948986 (DE-599)BSZ344482170 |
dewey-full | 005.12 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.12 |
dewey-search | 005.12 |
dewey-sort | 15.12 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01856nam a2200481 c 4500</leader><controlfield tag="001">BV037404254</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20210818 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">110517s2011 d||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781934356623</subfield><subfield code="9">978-1-934356-62-3</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">193435662X</subfield><subfield code="9">1-934356-62-X</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9781934356623</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)729948986</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BSZ344482170</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-522</subfield><subfield code="a">DE-83</subfield><subfield code="a">DE-91G</subfield><subfield code="a">DE-Aug4</subfield><subfield code="a">DE-188</subfield><subfield code="a">DE-739</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-M347</subfield><subfield code="a">DE-384</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.12</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 153</subfield><subfield code="0">(DE-625)143597:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 358f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 330f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 310f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 260f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Grenning, James W.</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Test-driven development for embedded C</subfield><subfield code="c">James W. Grenning</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Raleigh, N.C. [u.a.]</subfield><subfield code="b">Pragmatic Bookshelf</subfield><subfield code="c">2011</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXIV, 326 S.</subfield><subfield code="b">graph. Darst.</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="490" ind1="0" ind2=" "><subfield code="a">The Pragmatic Programmers</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Application software / Development</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">C (Computer program language)</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">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">Eingebettetes System</subfield><subfield code="0">(DE-588)4396978-1</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><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="1"><subfield code="a">Eingebettetes System</subfield><subfield code="0">(DE-588)4396978-1</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="2"><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=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Passau</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=022556857&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-022556857</subfield></datafield></record></collection> |
id | DE-604.BV037404254 |
illustrated | Illustrated |
indexdate | 2024-07-09T23:23:35Z |
institution | BVB |
isbn | 9781934356623 193435662X |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-022556857 |
oclc_num | 729948986 |
open_access_boolean | |
owner | DE-522 DE-83 DE-91G DE-BY-TUM DE-Aug4 DE-188 DE-739 DE-11 DE-M347 DE-384 |
owner_facet | DE-522 DE-83 DE-91G DE-BY-TUM DE-Aug4 DE-188 DE-739 DE-11 DE-M347 DE-384 |
physical | XXIV, 326 S. graph. Darst. |
publishDate | 2011 |
publishDateSearch | 2011 |
publishDateSort | 2011 |
publisher | Pragmatic Bookshelf |
record_format | marc |
series2 | The Pragmatic Programmers |
spelling | Grenning, James W. Verfasser aut Test-driven development for embedded C James W. Grenning Raleigh, N.C. [u.a.] Pragmatic Bookshelf 2011 XXIV, 326 S. graph. Darst. txt rdacontent n rdamedia nc rdacarrier The Pragmatic Programmers Application software / Development C (Computer program language) Softwareentwicklung (DE-588)4116522-6 gnd rswk-swf Test-First-Ansatz (DE-588)4674451-4 gnd rswk-swf Eingebettetes System (DE-588)4396978-1 gnd rswk-swf Test-First-Ansatz (DE-588)4674451-4 s Eingebettetes System (DE-588)4396978-1 s Softwareentwicklung (DE-588)4116522-6 s DE-604 Digitalisierung UB Passau application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=022556857&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Grenning, James W. Test-driven development for embedded C Application software / Development C (Computer program language) Softwareentwicklung (DE-588)4116522-6 gnd Test-First-Ansatz (DE-588)4674451-4 gnd Eingebettetes System (DE-588)4396978-1 gnd |
subject_GND | (DE-588)4116522-6 (DE-588)4674451-4 (DE-588)4396978-1 |
title | Test-driven development for embedded C |
title_auth | Test-driven development for embedded C |
title_exact_search | Test-driven development for embedded C |
title_full | Test-driven development for embedded C James W. Grenning |
title_fullStr | Test-driven development for embedded C James W. Grenning |
title_full_unstemmed | Test-driven development for embedded C James W. Grenning |
title_short | Test-driven development for embedded C |
title_sort | test driven development for embedded c |
topic | Application software / Development C (Computer program language) Softwareentwicklung (DE-588)4116522-6 gnd Test-First-Ansatz (DE-588)4674451-4 gnd Eingebettetes System (DE-588)4396978-1 gnd |
topic_facet | Application software / Development C (Computer program language) Softwareentwicklung Test-First-Ansatz Eingebettetes System |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=022556857&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT grenningjamesw testdrivendevelopmentforembeddedc |