Test-Driven Development in Microsoft® .NET
Please login to add notes
- + Cover
- Contents at a Glance
- + Introduction
Part I: Test-Driven Development Primer
- + Chapter 1: Test-Driven Development Practices
Chapter 2: Test-Driven Development in .NET—By Example
- The Task
- + Test List
- Test 1: Create a Stack and verify that IsEmpty is true.
- Test 2: Push a single object on the Stack and verify that IsEmpty is false.
- Test 3: Push a single object, Pop the object, and verify that IsEmpty is true.
- Test 4: Push a single object, remembering what it is; Pop the object, and verify that the two objects are equal.
- Test 5: Push three objects, remembering what they are; Pop each one, and verify that they are correct.
- Test 6: Pop a Stack that has no elements.
- Test 7: Push a single object and then call Top. Verify that IsEmpty returns false.
- Test 8: Push a single object, remembering what it is; and then call Top. Verify that the object that is returned is equal to the one that was pushed.
- Test 9: Push multiple objects, remembering what they are; call Top, and verify that the last item pushed is equal to the one returned by Top.
- Test 10: Push one object and call Top repeatedly, comparing what is returned to what was pushed.
- Test 11: Call Top on a Stack that has no elements.
- Test 12: Push null onto the Stack and verify that IsEmpty is false.
- Test 13: Push null onto the Stack, Pop the Stack, and verify that the value returned is null.
- Test 14: Push null onto the Stack, call Top, and verify that the value returned is null.
Chapter 3: Refactoring-By Example
- Before Refactoring the Code: Make Sure It All Works
- Refactoring 0: Remove Unneeded Code
- Refactoring 1: Rename Method
- Refactoring 2: Add a Test
- Refactoring 3: Hide Method
- Refactoring 4: Replace Nested Conditional with Guard Clauses
- Refactoring 5: Inline Method
- Refactoring 6: Rename Variable
- Refactoring 7: Collapse Loops
- Refactoring 8: Remove Dead Code
- Refactoring 9: Collapse Loops (Again)
- Refactoring 10: Reduce Local Variable Scope
- Refactoring 11: Replace Temp with Query
- Refactoring 12: Remove Dead Code
- Refactoring 13: Extract Method
- Refactoring 14: Extract Method (Again)
- Refactoring 15: Reduce Local Variable Scope
- Refactoring 16: Convert Procedural Design to Objects
- Refactoring 17: Keep the Data Close to Where It Is Used
- + The Sieve
Part II: Test-Driven Development Example
- + Chapter 4: The Media Library Example
- + Chapter 5: Programmer Tests: Using TDD with ADO.NET
- + Chapter 6: Programmer Tests: Using TDD with ASP.NET Web Services
Chapter 7: Customer Tests: Completing the First Feature
- + Chapter 8: Driving Development with Customer Tests
- + Chapter 9: Driving Development with Customer Tests: Exposing a Failure Condition
- + Chapter 10: Programmer Tests: Using Transactions
- + Chapter 11: Service Layer Refactoring
- + Chapter 12: Implementing a Web Client
Part III: Appendixes
Appendix A: NUnit Primer
NUnit Quick Start
- Step 1. Create Visual Studio Project for your test code.
- Step 2. Add a reference to the NUnit Framework.
- Step 3. Add a class to the project.
- Step 4. Set up your Visual Studio Project to use the NUnit-Gui test runner.
- Step 5. Compile and run your test.
- Step 6. Become familiar with the NUnit-Gui layout.
- + NUnit Core Concepts
- + Other NUnit Capabilities
- Using the Visual Studio .NET Debugger with NUnit-Gui
- + NUnit Quick Start
- + Appendix B: Transactions in ADO.NET
- Appendix C: Bibliography
- + Index
- + Appendix A: NUnit Primer
- About the Authors
With the clarity and precision intrinsic to the Test-Driven Development (TDD) process itself, experts James Newkirk and Alexei Vorontsov demonstrate how to implement TDD principles and practices to drive lean, efficient coding—and better design. The best way to understand TDD is to see it in action, and Newkirk and Vorontsov walk step by step through TDD and refactoring in an n-tier, .NET-connected solution. And, as members of the development team for NUnit, a leading unit-testing framework for Microsoft .NET, the authors can offer matchless insights on testing in this environment—ultimately making their expertise your own.
Test first—and drive ambiguity out of the development process:
Document your code with tests, rather than paper
Use test lists to generate explicit requirements and completion criteria
Refactor—and improve the design of existing code
Alternate programmer tests with customer tests
Change how you build UI code—a thin layer on top of rigorously tested code
Use tests to make small, incremental changes—and minimize the debugging process
Deliver software that’s verifiable, reliable, and robust
Test the closed alpha on paperc.com