You are previewing Pro .NET Best Practices.
O'Reilly logo
Pro .NET Best Practices

Book Description

Pro .NET Best Practices is a practical reference to the best practices that you can apply to your .NET projects today. You will learn standards, techniques, and conventions that are sharply focused, realistic and helpful for achieving results, steering clear of unproven, idealistic, and impractical recommendations.

Pro .NET Best Practices covers a broad range of practices and principles that development experts agree are the right ways to develop software, which includes continuous integration, automated testing, automated deployment, and code analysis. Whether the solution is from a free and open source or a commercial offering, you will learn how to get a continuous integration server running and executing builds every time code changes. You will write clearer and more maintainable automated testing code that focuses on prevention and helping your .NET project succeed. By learning and following the .NET best practices in this book, you will avoid making the same mistakes once.

With this book at your side, you'll get:

Real-world, no-nonsense approaches to continuous integration, automated testing, automated deployment, and code analysis

Tips and tricks you'll need to clear hurdles that keep others from putting these common sense ideas into common practice

Guidance from the minimal, essential approach all the way to what's necessary to deliver at the highest levels of quality and effectiveness

Benefit immediately, even before finishing it, from the knowledge, workable advice, and experience found in Pro .NET Best Practices.

What you'll learn

How to set up a continuous integration server that executes builds every time code changes

How to create automated tests that are easier to write, easier to maintain, and focused on making sure the code-under-test works the way it's intended to work

How to write a common automated deployment script that deploys to all target environments

How to perform meaningful code analysis that gives the kind of information you can take action upon

Why some best practices, which were once fresh, are now stale; avoid this trap by following best practices grounded in correct principles that endure

How to gain support for following best practices from all project stakeholders by recognizing and overcoming biases, highlighting gaps, and demonstrating value

Who this book is for

Pro .NET Best Practices is for the .NET developer who is ready to learn realistic, practicable, and truly helpful best practices. It's for the .NET developer who wants to take the initiative and get started following best practices today, quickly producing results. It's for .NET developers who want to stay away from practices that only have theoretical benefits and move toward ones with real value, especially within a skeptical project environment. It's for the technical lead who has seen best practices get started only to fall out of practice, and wants to understand what goes wrong and how to implement suitable best practices likely to be followed by project teams.

Table of Contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Introduction
    1. Who This Book Is For
    2. How This Book Is Structured
    3. Prerequisites
    4. Downloading the Code
    5. Contacting the Author
  9. Chapter 1: Ruthlessly Helpful
    1. Practice Selection
    2. Target Areas for Improvement
    3. Overall Improvement
    4. Summary
  10. Chapter 2: .NET Practice Areas
    1. Internal Sources
    2. Application Lifecycle Management
    3. Patterns and Guidance
    4. Research and Development
    5. Microsoft Security Development Lifecycle
    6. Summary
  11. Chapter 3: Achieving Desired Results
    1. Success Conditions
    2. Common Understanding
    3. Desired Results
    4. Summary
  12. Chapter 4: Quantifying Value
    1. Value
    2. Sources of Data
    3. Summary
  13. Chapter 5: Strategy
    1. Awareness
    2. Personal Process
    3. Leverage
    4. Summary
  14. Chapter 6: .NET Rules and Regulations
    1. Coding Standards and Guidelines
    2. Code Smells
    3. Summary
  15. Chapter 7: Powerful C# Constructs
    1. Extension Methods
    2. Implicitly Typed Local Variables
    3. Nullable Types
    4. The Null-Coalescing Operator
    5. Optional Parameters
    6. Generics
    7. LINQ
    8. Summary
  16. Chapter 8: Automated Testing
    1. Case Study
    2. Brownfield Applications
    3. Greenfield Applications
    4. Automated Testing Groundwork
    5. Test Code Maintainability
    6. Unit Testing
    7. Fakes, Stubs, and Mocks
    8. Surface Testing
    9. Automated Integration Testing
    10. Database Considerations
    11. Summary
  17. Chapter 9: Build Automation
    1. Build Tools
    2. MSBuild Fundamentals
    3. Logging
    4. Parameters and Variables
    5. Libraries and Extensions
    6. Import and Include
    7. Inline Tasks
    8. Common Tasks
    9. Automated Deployment
    10. Summary
  18. Chapter 10: Continuous Integration
    1. Case Study
    2. The CI Server
    3. CI Lifecycle
    4. Summary
  19. Chapter 11: Code Analysis
    1. Case Study
    2. Static Analysis
    3. Dynamic Analysis
    4. Summary
  20. Chapter 12: Test Frameworks
    1. Unit Testing Frameworks
    2. Test Runners
    3. XUnit Test Pattern
    4. Mock Object Frameworks
    5. Database Testing Frameworks
    6. User Interface Testing Frameworks
    7. Acceptance Testing Frameworks
    8. Summary
  21. Chapter 13: Aversions and Biases
    1. Group-Serving Bias
    2. Rosy Retrospection
    3. Group-Individual Appraisal
    4. Status Quo and System Justification
    5. Illusory Superiority
    6. Dunning-Kruger Effect
    7. Ostrich Effect
    8. Gambler's Fallacy
    9. Ambiguity Effect
    10. Focusing Effect
    11. Hyperbolic Discounting
    12. Normalcy Bias
    13. Summary
  22. APPENDIX A: Resources
    1. General Software Development
    2. .NET Guidelines, Patterns and Practices
    3. C# Language
    4. Testing and Test Frameworks
    5. Debugging and Problem Solving
    6. Build Automation
    7. Continuous Integration
    8. Static Code Analysis
    9. Dynamic Code Analysis
    10. Security
    11. Microsoft Research
    12. Miscellaneous
  23. APPENDIX B: Scorecard
    1. Automated Testing
    2. Build Automation
    3. Continuous Integration
    4. Code Analysis
    5. Calculating the Overall Score
  24. Index