Index

Symbols

. (dot) character, regular expressions, 84

/ (slash) character, regular expressions, 84

$ (dollar sign), regular expressions, 84

A

AAA (arrange, act, and assert) test structure, 48, 66

Abstract Factory pattern

overview of, 156159

testing data-driven execution, 33

Acceptance tests, 9, 41, 200

Access levels

adjusting visibility by changing, 109111

adjusting visibility by packaging tests, 105107

designating with test-only interfaces, 111112

using reflection to coerce access, 114115, 126

AccessibleObject class, 115

Agile development

Automated Testing Triangle, 9

overview of, 56

Alternate path tests, 2931

Annotations

simplifying error condition tests with, 131

in test naming conventions, 4950

Anonymous entities, difficult to test, 113

Anonymous inner classes, Java

adjusting visibility, 111112

in error injection, 98

API specification, testing interfaces using, 146

Appender

testing code using custom logging, 161163

in thread-synchronization, 182184

Approach to testing, 41

Architectural layers, influencing scope, 24

Assertion failures, using unique values, 57

Attribute encapsulation

accessing with getter methods, 64

resulting in coupling, 53

testing getters and setters, 6667

Attributes

adjusting visibility, 105

encapsulation resulting in coupling, 4546

in exception design, 141

exception-based, 134135, 137138, 141

hiding for security, 55

in naming conventions, 49

in state verification tests, 27

tests that pass when lying about, 19

tests verifying individual, 45

Authentication, expiration boundary test for, 7275

Automated testing. See Starting

Automated Testing Triangle, 9, 28

Automotive engineers, 4

B

Basics, testing

adjusting visibility, 7577

bootstrapping constructors, 6366

encapsulating and overriding, 7275

locally redefine, 7071

sharing constants, 6770

temporarily replace, 7172

testing simple getters and setters, 6667

verification by injection, 7779

Behavioral encapsulation, 3940

Behavioral testing

of alternate paths, 2930

clarifying use of, 2627

JavaScript example of, 27

purpose of regression test, 41

of Singleton nature, 122123

Black-box tests

coupling and, 4243

defined, 4041

testing transparency, 41

BlockingQueue interface, 185

Bootstrapping

constructors, 6366

test-driven Java, 196197

testing simple getters and setters, 6667

Bottom-up testing, 213

Boundary conditions test, 3132

Branch coverage, 1314

Buffered I/O classes, 39

Bugs

avoiding test code in production, 52

code coverage and, 12

eliminating rework of, 5

minimalism for less, 18, 122

preventing rather than catching, 8

race-condition, 165, 167, 185

in threads, 167

C

C

dynamic-binding and reflection, 34

function pointers, 151

implementing callbacks, 151

printf format strings, 8889

static analysis tool for, 7

verifying interface definition, 146

C++

access level changes, 109

context mutability, 21

declaring entities in nested classes, 112

dynamic-binding and reflection, 34

error condition verification, 134

error condition verification in, 137

friend keyword, 113114, 126

implementing callbacks, 151153

nested anonymous enumerations, 70

pointer-to-member function, 151, 153

static analysis tool for, 7

verifying interface definition, 146

Callable interface, Java

in common lock synchronization, 177178, 180

directly testing thread task, 173

Callbacks, 150154

Catch clause, verifying exception type, 131132

Characterization testing

legacy code and economics of, 28

mess of code requiring, 25

scaling up legacy code, 215

Checkstyle, 7

Chunking, 127

Civil engineers, 4

Clarity of intention, in minimalist approaches, 18

Class

refactoring to enhance testability, 108109

testing Singleton’s purpose, 123127

Class::Std module, Perl, 109, 116117

Cleanliness of code, and scope of testing, 2425

Clover, 14

Code

avoid testing the framework, 5860

simplifying tests by deleting, 58

testing untested. See Legacy JavaScript

thread-safe, 167

Code checker constraints, in unit testing, 10

Code coverage

avoid testing code in production with, 52

blind spots, 1112

deceptions of, 1213

defined, 1011

as guide, 13

metrics, 1315

removing code in testing to increase, 58

unit testing with, 7

Code generation tools, 7, 5960

Code smell

concurrency, 169

defined, 7

encountering through your tests, 128

CodeCover, 14

CodeMash, 3

Coincidental equality, 73, 82, 86

Coincidental similarity, 82

Collaborators

defined, 77, 98

injecting into tests, 148149

legacy code and, 215217

replacing, 98100

Test Doubles and, 100

Command-line debuggers, 190

Comments, relaxing visibility with, 111

Common lock synchronization, 176181

Complete verification, testing for, 55

Component level

cost of integration tests at, 28

testing purpose of code at, 25

Conceptual framework, for testing, 2526

Concurrency

code smell, 169

monkey test for, 189

race conditions in, 185, 188

Condition coverage, 1314

ConnectException, 133, 134

Connection collaborator, 99100, 102

Constants

exact verification of strings with shared, 8587

exact verification with formatted results using, 8889

limitations of, 88

testing constructors using shared, 6770

Constructor injection, 148149

Constructors

bootstrapping, 6366, 196197

test-driven Java, 196197, 200

testing Singleton with relaxed access to, 125127

testing using shared constants, 6770

Containment

false-positive weaknesses of, 88

verification of strings by, 8183

Context, differentiating exceptions, 137138

Continuous integration, in software craftsmanship, 78

Cooperative multitasking, in parallel programming, 166

Coupling

concept of, 53

defined, 42

factories as test seams and, 159

inputs to outputs in tests, 4849

less likely with small tests, 5556

minimizing in software, 4246

mocks introducing high degree of, 201

null object implementations and, 103

reducing test, 5354

Coverage

metrics, 1314

testing alternate paths, 30

unit testing for, 1015

Craftsmanship

practices supporting software, 68

principles for testing, 4751

role in first-time quality, 35

software engineering and, 23

testing and, 810

unit testing for coverage, 1015

unit testing under code checker constraints, 10

Critical section of code, read-write race conditions, 168

Cucumber tool, 200

Curl tool. See Test-driven Java

Custom logging appender, 161163

D

Data path coverage, 14

Data permutations tests

boundary conditions, 3132

data-driven execution, 3233

overview of, 3031

run-time and dynamic binding, 3335

Data type injection, overriding encapsulation, 9194

Data-driven execution

testing for permutations, 3233

unit testing for coverage, 11

DataProvider parameter, @Test, 9394

Deadlocks, 169

Debugger

APIs, 189191

Java code using log4j as seam for, 160163

reproducing race conditions, 171172

Declarations, runtime exceptions, 134

Declarative scope changing, adjusting visibility, 116117

Defects, testing for, 35

Def-use chains, 14

Deleting code, 58

Delimiters, naming conventions, 50

Depended-On Components (DOCs), 77

Dependencies. See Coupling

Dependency injection

as alternative to Singleton pattern, 122

overview of, 147150

registries providing indirect form of, 155

synchronization through, 181184

test-driven Java, 200

testing by, 7779

Design and testability

about design paradigms, 3738

behavioral encapsulation, 3940

coupling, 4246

dimensions of testing, 41

encapsulation, observability and, 42

overview of, 37

representational encapsulation, 3839

shades of testing, 4041

Devel::Cover, 14

Difficult-to-test designs, 122

Dimensions of testing, 41

Direct calls, using existing seams, 146147

Direct testing, adjusting visibility, 7577

DNS (Domain Name System), 32

DOCs (Depended-On Components), 77

Documentation, relaxing visibility with, 111

Dollar sign ($), regular expressions, 84

The DOM, 211212

Domain Name System (DNS), 32

Dot (.) character, regular expressions, 84

Dp4j tool, Java reflection, 115

Dynamic binding, reflection-based code, 3335

Dynamic dispatch, unit test for coverage, 12

E

EasyMock

in dependency injection, 149

overview of, 100

registries and, 155

Economics of testing types, 28

Encapsulation

behavioral, 3940

breaking via direct testing, 7577

coupling in attribute, 4546

from coupling in unit testing, 53

design paradigms and, 37

observability, testing and, 42

representational, 3839

Encapsulation and override, 7275

Encapsulation and override variations

data injection, 9194

encapsulating loop conditions, 9496

error injection, 9698

overview of, 91

replacing collaborators, 98100

using existing no-op classes, 101103

Engineering and craftsmanship

engineering, 23

first-time quality and, 35

practices supporting craftsmanship, 510

software, 23

testing and, 810

unit testing for coverage, 1015

unit testing under code checker constraints, 10

Errno values, verifying error conditions, 129130

Error condition verification

checking return value, 129130

exception design, 140143

overview of, 129

verifying exception instance, 137140

verifying exception message, 132134

verifying exception payload, 134137

verifying exception type, 130132

Error conditions, null values indicating, 101

Error injection, testing using overrides for, 9698

Error path testing

for boundary conditions, 31

scaling up legacy code, 215216

software archeology and legacy code, 217

testing, 30

Errors, in Java, 134

Event objects, coupling in, 44

Exceptions

error injection for testing, 9698

indicating with existing no-op classes, 101103

injecting by replacing collaborators, 99100

thoughts on designing, 140143

verifying instance, 137140

verifying message, 132134

verifying payload, 134137

verifying type, 130132

Executor, Java packages, 173

Expiration boundary tests, 7275

Explicit intent of development, testing implementation to match, 17

Externally triggered loop termination, encapsulation of, 9495

Extract Class refactoring, 3940

Extract Method refactoring, 3940, 74, 113, 138

F

Facilities, testing with available, 55

Factories, 156

Factory Method and Builder, 156159

Fail() assertion, 131132

Failure paths, testing. See Error condition verification

Fakes, 100

Feathers, Michael, 2, 2526, 28, 145, 209

Field length limits, testing for boundary conditions in, 31

FindBugs, 7

First-time quality, and craftsmanship, 35, 610

Fixture, 54, 123126

Format string constants, exception design, 141143

Formatted results, for exact verification of strings, 8889

Four-Phase Test, 48, 66

Fowler, Martin, 101, 147

Fragile Tests, 138, 184

Frameworks

avoiding testing of, 5859

inversion of control, 147150

sometimes testing, 60

Fresh fixtures, 54

Friend keyword

adjusting visibility with, 113114

testing Singleton with, 126

Full stack tests

of error paths, 30

of happy path, 29

overview of, 24

Functionality

to test or not to test, 2728

testing code at module/component level, 25

testing happy path for primary, 29

testing separately, 5657

testing Singleton’s class purpose, 123127

unit testing of value added by code, 26

Functions, locally redefining within test, 7071

The Fundamental Theorem of Software Engineering, 3233

G

Garbage-collected teardown

in common lock synchronization, 179

testing simple getters and setters, 6667

Gdb commands, 190191

Generated code, avoid testing of, 5960

GetInstance() method

in common lock synchronization, 179180

testing Singleton’s behaviors, 122123

Getters

constructor bootstrapping model, 65

naming conventions for, 75

testing simple, 6667

verifying constructor state with, 64

GitHub, worked examples in, 193194

Global Day of Code Retreat, 1015

Granularity, testing, 41

Gray-box tests

coupling and, 4243

defined, 4041

testing transparency, 41

H

Hamcrest matchers, 67

Happy path testing

for primary purpose of code, 29

scaling up legacy code, 215216

for test-driven Java, 197198

Hierarchical locking, 169

HttpClient library, 197198

Hypothesis, race conditions, 171172

I

IDE (Integrated development environment), software craftsmanship, 67

IllegalArgumentException, Java, 134136

Immediately invoked function expression (IIFE), 210211

Implementation tests, scaling up legacy code, 216

Implementations

direct testing of refactored, 3940

separating intent from, 1822

shades of testing for, 4041

testing code using, 146147

using factories as seams, coupling tests to, 159

using registries as seams, 155156

verifying intent over, 52

Implicit intent of development, testing implementation to match, 17

Infinite loops, encapsulation of, 95

Infinite Monkey Theorem, 189

Initialization, and factory seams, 156159

Injection, verification by, 7779

Injection points, as seams, 181

Inputs, coupling test outputs to test, 4849

Instance, testing Singleton with constraints on, 124125

Instance, verifying exception, 137140

Instruction-level write-write race conditions, 168

Integrated development environment (IDE), software craftsmanship, 67

Integration tests, 25, 28

Intent of code

crafting tests for, 4748

for difficult-to-test designs, 122

discerning, 127128

example of, 1922

exception design and, 141143

overview of, 17, 119120

separating implementation from, 1819

slipperiness of, 18

testing Singleton pattern, 120121

testing strategy, 121127

verifying over implementation, 52

Intention Checker, 17

Interface-based design, 100

Interfaces

direct testing of thread task, 173

implementing callbacks through, 151

testing code using, 146

Internationalization error messages, exception design, 141

Inter-Process Communications (IPC) mechanisms, 166167

InterruptedException, Java, 140

Inventory, as waste in Lean manufacturing, 5

IPC (Inter-Process Communications) mechanisms, 166167

Isolation tests, 41

J

Jasmine test framework

scaling up legacy code, 215216

temporarily replacing methods in, 72

testing DOM set up using, 212

Java

adjusting visibility, 105109, 111112, 114115

breaking encapsulation, 7576

error condition verification, 134

exception design, 140

implementing callbacks through interfaces, 151

logging seam, 160163

packages, 7677, 105107

Singleton pattern, 120

synchronization, 179

test-driven example of. See Test-driven Java

verifying interface definition, 146

Java Concurrency in Practice, 166

Java.net.URI class, 201203

JavaScript

callback functions, 151

de facto interface of, 100

declaring functions in any scope, 112

function pointers, 151

implementing callbacks, 151

testing UI component, 193194

write-read race condition, 167

JavaScript, legacy

getting started, 210211

overview of, 209210

retrospective, 218

scaling up, 215217

software archeology, 217

on toothpaste and testing, 213214

Java.util.concurrent packages, Java 5, 173

JMock, 100101

JQuery Timepicker Addon project

getting started, 210211

overview of, 209210

retrospective, 218

scaling up, 215217

software archeology, 217

on toothpaste and testing, 213214

Jshint, 7

Jslint, 7

JUnit

testing simple getters and setters, 67

TestNG vs., 93

verifying exception message in, 133

verifying exception type in, 131

L

Law of Demeter, 46

Lean production

building quality into product, 4

preventing vs. catching defects in, 8

rework as waste in, 5

as testing approach, 56

Legacy code, 209

Legacy JavaScript

getting started, 210211

overview of, 209210

retrospective, 218

scaling up, 215217

software archeology, 217

on toothpaste and testing, 213214

Libraries

avoiding testing of, 5859

object-oriented threading, 173175

Line coverage, 13

Lint, 7

Listeners, 150154

Localized error messages, exception design, 141143

Log4j, 160161, 182183

Logging

injecting synchronization through, 181184

testing code using, 159162

Lookup key, dependency injection in registries, 155

Loop conditions, encapsulation of, 9496

Loop coverage, 1314

M

Main() method, testing, 196197

Manual tests

Automated Testing Triangle, 9

test-driven Java, 200

MapReduce frameworks, 174

Martin, Robert C., 2, 101

Mathematical functions

state verification tests of, 2627

testing for boundary conditions in, 3132

Mathematical view of tests, 6466

Maturity of code, and scope of testing, 2425

Messages, exception

design of, 141

verifying, 132134

Meszaros, Gerard, 2, 24, 37, 54, 63, 77, 100

Methodologies, Agile and Lean testing, 56

Methods

adjusting visibility by changing access levels, 109111

refactoring to enhance testability, 108109

replacing temporarily within test, 7172

Meyers, Scott, 113

Milestones, for coverage metrics, 1415

Minimal fixtures, 54

Minimalism, applied to software, 18

Mockito, 100101

Mocks

creating test doubles, 149

danger of testing with, 201

overriding methods, 101

overview of, 100

using registries as seams, 155

Module level

integration tests at, 28

testing purpose of code at, 25

Monitoring results, reproducing race conditions, 172173

Monkey testing, 41, 189

Monte Carlo testing, 41, 190

Mutability, exception, 137

N

Naming conventions

for designating exposed functions as private, 210211

exception design, 141143

getters, 75

for specific use of callbacks, 154

for tests, 4951

Nested anonymous enumerations, 70

Notifiers, as specialized callback, 154

Null Object pattern, 101103

NullPointerException, unit testing, 12

Numerical functions, testing for boundary conditions, 3132

O

Object-oriented (OO) design

as dominant design paradigm, 3738

encapsulation and observability in, 3842

implementation hiding in, 38

Observer pattern, 154

Operations, behavioral verification tests of, 27

OU (organizational unit), LDAP, 154

Outputs, coupling test inputs to test, 4849

Override

encapsulation and. See Encapsulation and override

injection, 93

P

Package declaration, Class:Std, 116

Packages

elevating access to code being tested, 105107

in Java, 7677

Parallelism

deadlocks, 169

debugger APIs, 189191

history of, 166

overview of, 165166

race conditions, 167169

reproducing race conditions, 170173

statistical verification, 187189

supervisory control, 184187

synchronizing through common lock, 176181

synchronizing through injection, 181184

testing thread task directly, 173175

threads, 166

Partial verification, testing for, 55

Pattern, verification of strings by, 8385

Pattern Languages of Program Design, 101

Payload, verifying exception, 134137

Performance tests, 41

Perl

checking stylistic problems, 7

Class::Std module, 109

function pointers, 151

package declarations, 107

testing Singleton, 126127

verifying strings by pattern, 8385

Perlcritic, 7

Plug-ins, avoiding testing of, 5859

PMD

code coverage metrics, 14

static analysis tool, 7

POSIX

loading and invoking functions as callbacks, 151152

runtime binding without error handling, 3435

verifying error conditions, 129130

PowerMock, 115

Preallocated exceptions, verifying exception instance, 138139

Preemptive multitasking, 166

Principle of Least Knowledge, minimizing coupling, 46

Principles, testing. See Testing principles

Private functions, legacy JavaScript, 210211

Private methods

adjusting visibility, 75

changing access levels, 109110

coercing test access with reflection, 114115

debate on testing, 40

as implementation details, 110

simplifying public interface with, 108

PRIVATE trait, Class:Std, 116

Privateer, 115

Privileges, debugger, 190

Processes, in parallel programming, 166

Production, avoiding test code in, 5152

Protected method, changing access levels, 109111

Public method, changing access levels, 109111

Purpose

as dimension of testing, 41

testing based on, 2526

testing happy path for primary, 29

Python modules, 106

R

Race conditions

in common lock synchronization, 176178, 180

deadlocks vs., 169

identifying, 170171

isolating using gdb commands, 190191

with logging seam, 181184

reproducing, 171173

statistical verification of, 187189

threads and, 167169

with thread-safe components, 185186

Random event testing, 41

Read-write race conditions, 167

Recipe, testing. See Testing recipe

Redefining variable or function, local tests, 7071

Redundant tests, removing, 58

Refactoring

behavioral encapsulation and, 3940

for better testability, 8687

of classes, 108109

expiration boundary test with, 7275

to provide seam for test-driven Java, 198199

software archeology and legacy code, 217

for testable loop control, 96

testing thread task directly, 175

toothpaste, 213

References, storing in newer registries, 154155

Reflection

coerced access via, 114115

overview of, 3334

testing Singleton, 126

Registration management, and factory seams, 157159

Registries, as seams for testing, 154156

Regression tests, 41

Regular expressions, 8485, 88

RemoteException, 130134

Replace methods, temporarily within test, 7172

Representational encapsulation, 3839

Reproduction, race conditions, 170173, 177179

Resource constraints, testing for boundary conditions, 3132

RESTRICTED trait, Class:Std, 116

Reverse engineering, bottom-up testing, 213

Rework, as waste in Lean, 4

Risk assessment, testing third-party code, 60

Ruby, packages in, 106

Runnable interface, Java thread task, 173175

Run-time, testing for data permutations at, 3335

RuntimeExceptions, 134

S

Scaling, 68

Scope

changing declarative, 116117

scaling up for legacy code, 215217

small tests for limiting, 5556

testing error paths and, 30

testing granularity, 41

understanding for testing, 2425

Seams

bringing code under test with, 145

callbacks, observers, listeners, and notifiers as, 150154

in common lock synchronization, 176181

complex situations rich in, 170

dependency injection as, 147150

direct calls as, 146147

factories as, 156159

identifying in mess of code, 25

identifying in race conditions, 172

injection points as, 181

logging as, 159163

overview of, 145

registries as, 154156

reproducing race conditions, 172

for test-driven Java, 198200

Semantically handled edge cases, code coverage in, 12

Separating concerns, in testing, 5657

Sequencing issues, race conditions as, 171

ServerException, 133

ServiceFailureException, 130134

SetAccessible() method, Java reflection, 115

Setters

constructor bootstrapping model, 65

dependency injection using, 147149

testing simple, 6667

Shades of testing, 4041

Shared constants, 6770, 8587

Shared fixture, testing Singleton’s purpose, 124125

Simplicity, software hygiene, 67

Single Responsibility Principle, 119

Singleton object, 120

Singleton pattern

as difficult-to-test design, 119120, 122

intent, 121

removing Singleton nature, 124

testing class purpose, 123127

testing Singleton nature, 122123

testing strategy, 121122

using factories as seams, 156158

Slash (/) character, regular expressions, 84

Small tests, writing, 5556

Smalltalk, 110

Smoke testing, 41

Software

archeology and legacy code, 217

engineering and craftsmanship. See Engineering and craftsmanship

SOLID principles, 119

Solution, software hygiene, 67

Spring framework

dependency injection, 147150

reflection-based scheduling callbacks, 151152

Spy feature

defined, 100

in test-driven Java, 201203

verifying value-added by function, 214

SpyOn() method, 72, 100

Standards, boundary conditions from, 32

Starting

conceptual framework for, 2526

overview of, 23

state and behavioral testing, 2627

to test or not to test, 2728

testing alternate paths, 2930

testing data permutations, 3035

testing defects, 35

testing error paths, 30

testing “happy path,” 29

testing recipe, 2835

understanding scope, 2425

State testing, 2627

Statement coverage, 1314

Static analysis tools, 7

Static checkers

disabling for test code, 48

enforcing naming convention, 49

unit testing under constraints of, 10

Statistical verification, parallelism and, 187189

String handling

cautionary note, 90

exact verification by value, 8587

exact verification with formatted results, 8889

implementing callbacks through, 151152

verification by containment, 8183

verification by pattern, 8385

verifying strings, 81

Stubs

defined, 100

in test-driven Java, 199200

testing with null object implementations, 101103

Style, software hygiene, 67

Subsets of system, testing purpose of code for, 26

Supervisory control, parallelism and, 184187

Sustainability, testing code for, 28

Swallowed exception, 140

Synchronization

common lock, 176181

injecting, 181

Syntactic marker, naming conventions, 49

Syntax, software hygiene, 67

System tests

based on purpose of code, 2526

economics of, 28

T

Tasks, testing thread, 173175

Taxonomy, of software hygiene, 5

Technologies, influencing testing scope, 24

Templates, and factory seams, 156159

Test Doubles

collaborators and, 100

creating substitutes for collaborators, 77

defined, 24

Test subpackages, Java, 106

Test through the interface, 55

Test-driven development (TDD)

Java example of. See Test-driven Java

purpose of tests over time, 41

as test- first approach, 810

Test-driven Java

bootstrapping, 196197

cutting cord, 198199

exercising options, 203204

first functionality, 197198

ghost protocol, 200203

moving downstream, 204206

moving to multiples, 199200

overview of, 195196

retrospective, 207

Testing

code coverage tools for, 7

craftsmanship assisted by, 810

inefficiencies of retesting, 5

methodologies for automated, 56

principles and practices, 12

separate intent from implementation, 1819, 2122

unit test for coverage, 1015

unit test under code checker constraints, 10

Testing principles

avoid test code in production, 5152

couple inputs to outputs, 4849

craft tests well, 4751

do not test framework, 5860

minimize coupling, 5354

overview of, 47

prefer complete over partial verification, 55

prefer minimal, fresh, transient fixtures, 54

remove code for simplicity, 58

separate your concerns, 5657

sometimes test framework, 60

use available facilities, 55

use naming conventions, 4951

use unique values, 57

verify intent over implementation, 52

write smaller tests, 5556

Testing recipe

overview of, 28

test alternate paths, 2930

test data permutations, 3035

test defects, 35

test error paths, 30

test “happy path,” 29

visualization of, 29

TestNG, 9394, 133

Test-only interfaces, adjusting visibility with, 111112

Test-then-set race conditions, 167168

Third-party code, testing, 60

Thread class, Java, 173175

Threads

in common lock synchronization, 176181

and deadlocks, 169

debugger APIs handling multiple, 189191

overview of, 166

and race conditions, 167169

reproducing race conditions, 170173

statistical verification, 187189

synchronization through injection and, 181184

testing thread task directly, 173175

using supervisory control, 184187

Thread-safe code, 167

Thread.State.BLOCKED state, Java, 180

Throwable class, verifying exception payload, 134137

Toothpaste refactoring, 213

Toothpaste testing, 213

Top-level domains, DNS, 32

Toyota Production System, 5

Transient fixtures, tests, 54

Transparency, 41

Try/catch, 217

Types, exception, 130133, 141143

U

UI component, JavaScript testing of, 193194

Unified exception handling, 130

Unique values, testing with, 57

Unit testing

adjusting visibility with friend keyword, 113114

of alternate paths, 30

Automated Testing Triangle for, 9

under code checker constraints, 10

coupling in, 4344

for coverage, 1015

defined, 26

economics of, 28

granularity of, 41

of happy path, 29

mathematical view of, 6566

objections to, 10

reducing coupling in, 5354

testing defects, 35

value-added perspective on, 2526

URI class, test-driven Java, 201203

Usage of object, representational encapsulation, 3839

V

Value constraints, boundary conditions in, 3132

Value-added perspective, unit testing, 2526

Value-added tax (VAT), 2526

Values

exact verification of strings by, 8587

older registries allowing storage of, 154

testing using unique, 57

verifying error conditions with return, 129130

Variables, locally redefining test, 7071

Verification

complete vs. partial, 55

by injection, 7779

statistical, 187189

using callbacks, 154

Verification, error condition

checking return value, 129130

exception design and, 140143

exception instance, 137140

exception message, 132134

exception payload, 134137

exception type, 130132

overview of, 129

Verification, string testing

cautionary note for, 90

by containment, 8183

with formatted results, 8889

by pattern, 8385

by value, 8587

Visibility, adjusting

becoming friend-ly, 113114

breaking it down, 108109

changing access levels, 109111

coerced access via reflection, 114115

declarative scope, 116117

improving testability by, 7577, 105

naming the unnamed, 112113

packaging tests with code, 105107

test-only interfaces, 111112

Visualization, of testing recipe, 29

W

Waste, Lean manufacturing minimizing, 5

WebRetriever. See Test-driven Java

White-box tests

coupling and, 4243

defined, 4041

testing transparency, 41

Worked examples, 193194

Write-read race conditions, 167

Write-write race conditions, 168169

X

XUnit Test Patterns, Meszaros, 54

Y

Yan Framework, 147

Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.37.196