Book Image

Improving your C# Skills

By : Ovais Mehboob Ahmed Khan, John Callaway, Clayton Hunt, Rod Stephens
Book Image

Improving your C# Skills

By: Ovais Mehboob Ahmed Khan, John Callaway, Clayton Hunt, Rod Stephens

Overview of this book

This Learning Path shows you how to create high performing applications and solve programming challenges using a wide range of C# features. You’ll begin by learning how to identify the bottlenecks in writing programs, highlight common performance pitfalls, and apply strategies to detect and resolve these issues early. You'll also study the importance of micro-services architecture for building fast applications and implementing resiliency and security in .NET Core. Then, you'll study the importance of defining and testing boundaries, abstracting away third-party code, and working with different types of test double, such as spies, mocks, and fakes. In addition to describing programming trade-offs, this Learning Path will also help you build a useful toolkit of techniques, including value caching, statistical analysis, and geometric algorithms. This Learning Path includes content from the following Packt products: • C# 7 and .NET Core 2.0 High Performance by Ovais Mehboob Ahmed Khan • Practical Test-Driven Development using C# 7 by John Callaway, Clayton Hunt • The Modern C# Challenge by Rod Stephens
Table of Contents (26 chapters)
Title Page
Copyright and Credits
About Packt
What to Know Before Getting Started
Files and Directories
Advanced C# and .NET Features

When testing is painful

There may come a time when you may encounter some pain. Perhaps you've forced yourself into a corner with your design. Maybe you're unsure what the next, most interesting test would be. Sure, you didn't mean to, but conceivably you could have taken too great a leap between tests. Whatever the case may be, there may come a time when testing becomes painful.

A spike

If you find that you're stuck or you're debating between options on how to proceed, it might be beneficial to run a spike. A spike is a means with which you can investigate an idea. Give yourself a time limit or some other limiting metric. Once sufficient knowledge or insight has been gained by the exercise, throw away the results. The purpose of the spike is not to walk away with the working code. The goal should be to gain understanding and provide a better idea of a path forward.

Assert first

At times, you may know the next test you want to write without being quite sure how to start. If this happens, start...