Acceptance testing frameworks
automated, 310
business-logic acceptance testing, 311–312
exception handling, 310
formal acceptance phase, 309
goal, 309
informal acceptance phase, 309
testing with specifications and behaviors, 310
Concordion .NET, 311
FitNesse, 311
SpecFlow, 311
test scripts vs. specification, 310
Achieving desired results
common understanding, 44
detailed examples, 48
documented architecture, 47
report mockups, 47
ruthlessly helpful practices, 37
success conditions, 39
awareness and acknowledgement, 39
context and preconditions, 40
developers, 39
diversions and distractions, 43
priorities, 41
project inception, 42
team leaders, 40
Application lifecycle management (ALM)
agile software development, 23
analogy, 21
analysis phase, 22
architecture phase, 22
inception phase, 22
operations phase, 22
Archetype, 6
benefits, 48
NerDinner application, 49
vertical slice, 49
Arrange-Act-Assert (3-As) pattern, 141–142
Assembly analysis, 236
FxCop (see FxCop)
program database, 236
Assertions
classic model, 293
comparison, 293
conditional, 293
equality, 293
identity, 293
type, 293
utility, 293
constraint-based assert model, 293, 294
Automated integration testing
performance testing, 169
smoke testing, 168
stability testing, 169
Automated testing
automated integration testing, 168
performance testing, 169
smoke testing, 168
stability testing, 169
Brownfield applications, 133–135
database considerations, 169–170
fake, stubs and mocks, 161–165
greenfield applications, 135–136
model-based testing (MBT), 131
ruthlessly helpful practices, 130
security testing, 131
SLOS software, 131
test code maintainability, 136
naming conventions, 137
test method body, 141
unit testing (see Unit testing)
Aversions and biases
ambiguity effect, 320
cognitive illusions, 313
Dunning-Kruger effect, 318
group-individual appraisal, 316
group-serving bias, 315
hyperbolic discounting, 321
normalcy bias, 322
Ostrich effect, 319
physiological illusions, 313
ruthlessly helpful practices, 314
status quo, 317
system justification, 317
Build automation
automated deployment, 197
build once, deploy many, 197–198
deployment tools, 200
date and time functions, 192–193
deploying, 173
import and include tasks, 188–190
libraries and extensions, 188
logging, 183
detailed logging option, 184
file logging option, 184
FileLogger facility, 183
runner.msbuild script file, 183
verbosity options, 185
MSBuild fundamentals, 175
PropertyGroup and ItemGroup, 178–182
packaging, 173
parameters and variables, 186–188
ruthlessly helpful practices, 173
CI lifecycle
analysis phase, 218
full analysis, 221
goals, 219
trigger events, 219
deployment phase, 223
deliverables, 225
schematic representation, 224
triggering event, 224
packaging phase, 221
deliverables, 222
schematic representation, 222
triggering event, 222
rebuilding phase
clean working folder, 212
goals, 209
MSBuild configuration, 213–214
schematic representation, 210
successful build, 210
stability phase, 226
automated integration testing, 226
report generation, 228
run stability test, 228
schematic representation, 227
smoke tests, 227
triggering event, 227
TeamCity project administration, 208, 209
unit testing phase, 215
artifacts, 217
failed test, 216
goals, 215
run unit tests, 217
schematic representation, 216
surface tests, 218
triggering event, 217
Jenkins, 206
Team foundation server (TFS), 207
TeamCity, 206
widely-used servers, 204
Classic assertion model, 293
Code analysis
analysis phase, 231
analyze phase, 231
architecture and design, 255–257
assembly analysis (see Assembly analysis)
code metrics, 257
performance profiling, 261
query profiling, 262
improve phase, 231
quality assurance metrics, 257–258
ruthlessly helpful practices, 232
SLOS software application, 233
coding standards, 236
duplicate code finders, 253–254
manual code review, 254
MSDN, 235
purposes, 235
source analysis, 247
source code/assemblies, 235
StyleCop (see StyleCop)
Code Analysis Tool .NET, 34
complicated source code, 104–105
unused, unreachable, and dead code, 105
Code–driven testing. See Unit testing frameworks
Command-line runner. See Echo
Comparison, classic assertion, 293
Concordion .NET, 311
Conditional, classic assertion, 293
Constraint-based assert model, 293, 294
Continuous integration (CI)
ruthlessly helpful practices, 201
Jenkins, 206
Team Foundation Server (TFS), 207
TeamCity, 206
widely-used servers, 204
SLOS software, 203
Cyclomatic complexity (CCMax), 64
Database testing frameworks, NDbUnit, 303
calling retrieve method, 307
creation of .NET DataSet schema definition file, 305
database servers, 304
features, 304
setting database state, 306–307
Defect tracking system, 19
DotCover, 275
.NET code coverage tool. See DotCover
.NET coding standards and guidelines
calling virtual methods in constructors, 97–99
disposable pattern
nested using statements, 96–97
owns native resources and fields, 93–95
exceptions
catching exceptions, 90
throwing exceptions, 88
publicly visible constant fields, 100–101
return an empty instance, 100
sources, 87
AIOCF .NET coding standards, 87
C# coding guidelines, 87
CAT.NET rules, 87
class libraries, 88
conventions and practices, 88
FxCop rules, 88
Gendarme rules, 88
IDesign C# coding standards, 88
ReSharper code inspections, 88
zero-value enum element, 99–100
.NET Practices
application lifecycle management (see Application lifecycle management (ALM))
automated testing, 15 (see also Automated testing)
code analysis, 15 (see also Code analysis)
continuous integration, 15 (see also Continuous integration (CI))
internal sources, 17
defect tracking system, 19
retrospective analysis, 20
Microsoft SDL (see Microsoft Security Development Security (SDL))
patterns and guidance, 23
framework design guidelines, 24
object-to-object mapping, 26–27
presentation layer design patterns, 25–26
research and development, 28
automated test generation, 29–32
ruthlessly helpful practices, 16
.NET rules and regulations
complicated source code, 104–105
unused, unreachable, and dead code, 105
coding standards and guidelines, 86
calling virtual methods in constructors, 97–99
publicly visible constant fields, 100–101
return an empty instance, 100
zero-value enum element, 99–100
goals, 85
ruthlessly helpful practices, 85
Dunning-Kruger effect, 318
Echo, 282
Equality, classic assertion, 293
FitNesse, 311
Flash, 309
Fuzzing, 33
application and command-line tool, 237
brownfield applications, 238
desktop application, 237
.NET framework guidelines, 236
Financial Rewrite project, 243
FxCopCmd, 245
general options tab, 240
Lender.Slos.Financial.dll, 238–242
mandatory rules, 238
mandatory rules, violations, 244
Rethrow to preserve stack detail, 242
SLOS project, 237
spelling and analysis options tab, 241
Gallio test runner, 282
Echo, 282
Icarus, 282
Icarus interface, 282
Icarus, 282
Identity, classic assertion, 293
Language-integrated query (LINQ), 122
query syntax, 123
reactive extensions, 127
MbUnit testing framework:, 266, 267
Microsoft All-In-One Code Framework (AIOCF), 86, 87
Microsoft patterns and practices (PnP) group, 24
Microsoft Security Development Lifecycle (SDL)
CAT.NET, 34
fuzzing, 33
MiniFuzz, 34
phases, 33
WACA, 34
Windows protection library, 34
MiniFuzz, 34
Mock object frameworks
moles framework, isolation testing, 298
automated integration testing of Import.Load method, 299–300
Class-Under-Test, Import class, 298
code-generated stub type, 300
configuring Visual Studio external tool, 302
FileSystem class, external dependency, 298
ReadAllText static method, 299
test run output, 303
unit testing of Import.Load method, 301
Rhino Mocks with dynamic fake objects, 294
Arrange-Act-Assert pattern test methods, 295
generating stub repositories, 295–296
limitations, 294
student class constructor, 295
stub/mock, 294
Moles framework, isolation testing
automated integration testing of Import.Load method, 299–300
Class-Under-Test, Import class, 298
code-generated stub type, 300
configuring Visual Studio external tool, 302
FileSystem class, external dependency, 298
ReadAllText static method, 299
test run output, 303
unit testing of Import.Load method, 301
MSTest unit testing framework, 266, 267
Naming conventions, 137
Test Code, 138
tests class, 140
NerdDinner application, 49
Non-commented lines of code (NCLOC), 63
Null-coalescing operator, 116–117
NUnit console runner, 268
configuring Visual Studio external tools, 271
nunit-console.exe program, 271
test run output, 272
NUnit GUI runner, 268
configuring Visual Studio debugger, 270
documentation, 269
nunit.exe/nunit-x86.exe, 268
tree view, 269
NUnit testing framework:, 266, 267
NUnitForms, 309
Ostrich effect, 319
Performance profiling, 276
Pex and Moles tools
capabilities, 29
parameterized unit tests, 30
sample code, 30
test cases, 31
Powerful C# Constructs, 107
extension methods, 108
benefits, 111
helper method approach, 109
IsWeekend Extension Method, 110
IsWeekend helper method, 109
naming conventions, 110
repeating code, 108
implicitly typed local variables, 111
advantages, 114
anonymous type declaration, 112
ApplicationCollection class, 113
fallacies, 112
Process2 method, 112
Search method, 113
var keyword, 112
LINQ (see LINQ)
null-coalesing operator, 116–117
ruthlessly helpful practices, 108
anecdotal evidence
automated deployments, 68
automated testing, 68
continuous integration, 68
end-users testimonials, 69
ruthlessly helpful practices, 55
sources of data, 63
stakeholders value, 57
individual and team effectiveness, 61, 62
manageability, 59
quality attributes, 60
Ranorex, 309
ReSharper test runner, 272
add-in, 274
code inspection, 273
context menu, 273
performance profiling, 276
refactoring functionality, 273
Unit Test Explorer window, 273, 274
Unit Test Sessions window, 274, 275
Retrospective meeting, 20
Rhino Mocks, 294
Arrange-Act-Assert pattern test methods, 295
generating stub repositories, 295–296
limitations, 294
student class constructor, 295
Ruthlessly helpful practices
achieving desired results (see Achieving desired results)
archetype, 6
aversion and biases, 314
build automation, 173
code analysis, 232
continuous integration, 201
definition, 1
.Net practices (see .Net practices)
generally-accepted and widely-used practices, 5
improvement
quality, 10
target areas, 6
point-of-view and assertion, 2
powerful C# constructs, 108
rapid development, 2
Steve McConnell's analysis, 3
triage principle, 3
Silverlight, 309
Silverlight Toolkit, 309
SpecFlow, 311
Strategy
awareness, 73
Brainstorming techniques, 74–75
conditions, 73
events, 73
failure paths, 73
monitoring, 76
patterns, 73
perception, 73
definition, 71
leverage
alert system, 83
automation, 82
CI server, 81
experience and expertise, 83–84
personal process, 78
commitment to excellence, 79
effort and perseverance, 80–81
virtuous discipline, 80
ruthlessly helpful practices, 72
Student Loan Origination System (SLOS) software, 131, 203, 233
code cleanup and feedback, 248
coding standards, 248
Financial Rewrite project, 249
source code-analysis tool, 248
Team Foundation Server (TFS), 207
Teardown method, 285
Test fixture/context, 285
Test frameworks
acceptance testing frameworks, 309
automated, 310
business-logic acceptance testing, 311–312
exception handling, 310
formal acceptance phase, 309
goal, 309
informal acceptance phase, 309
testing with specifications and behaviors, 310
best practices, 265
mock object frameworks, 294
Moles framework, isolation testing, 298–303
Rhino Mocks with dynamic fake objects, 294–298
stub/mock, 294
NDbUnit database testing frameworks, 303
calling retrieve method, 307
creation of .NET DataSet schema definition file, 305
database servers, 304
features, 304
setting database state, 306–307
test runners, 267
ReSharper test runner, 272–277
test suite, 267
Visual Studio test runner, 277–281
xUnit.net test runner, 283–285
unit testing frameworks, 266
user interface testing frameworks, 307
Flash, 309
NUnitForms, 309
Ranorex, 309
Silverlight, 309
Silverlight Toolkit, 309
web application test frameworks, 308
White, 309
Windows Forms, 309
Windows Presentation Foundation (WPF), 309
Test method body, 141
Arrange-Act-Assert pattern, 141–142
short method, 142
Test runners, 267
ReSharper test runner, 272–277
test suite, 267
Visual Studio test runner, 277–281
xUnit.net test runner, 283–285
Test suite, 267
Type, classic assertion, 293
Typemock Isolator mock object framework, 303
Unit test runners
multiple test frameworks
DevExpress, 277
ReSharper, 277
TestDriven.NET, 277
performance profiling, 276
Unit testing
explicit preconditions, 160–161
Test Code, 154
Unit testing frameworks, 266
MbUnit, 267
MSTest, 267
NUnit, 267
xUnit.net, 267
User interface (UI) prototypes, 45
User interface (UI) testing frameworks
Flash, 309
NUnitForms, 309
Ranorex, 309
Silverlight, 309
Silverlight Toolkit, 309
web application test frameworks, 308
automated, 308
browser automation, 308
Lightweight Test Automation Framework, 308
Selenium, 308
WatiN, 308
White, 309
Windows Forms, 309
Windows Presentation Foundation (WPF), 309
Utility, classic assertion, 293
Visual Studio test runner, 277
code coverage, 280
Code Coverage Detail window, 281
Code Coverage Results window, 281
main menu, 277
Test View window, 278
Web Application Configuration Analyzer, 34
Web application test frameworks, 308
automated, 308
browser automation, 308
Lightweight Test Automation Framework, 308
Selenium, 308
WatiN, 308
White, 309
Windows Forms, 309
Windows GUI. See Icarus
Windows Presentation Foundation (WPF), 309
xUnit test frameworks. See Unit testing frameworks
XUnit test pattern
assertions, 292
classic model, 293
constraint-based assert model, 293, 294
FixtureSetup method, 289
FixtureTeardown method, 289
identifying fixture setup and teardown methods, 287
identifying test class and fixture, 286, 287
identifying test method, 285, 286
teardown method, 285
test fixture/context, 285
using NUnit test framework, 287–288
using Visual Studio test framework, 290–292
XUnit.net test runner, 283
console runner, 284
GUI, 284
lean framework, 283
test run output, 285
18.225.57.164