Unit Testing .NET Applications Using Code Contracts

As a developer is going through the testing phase of application development, they will typically take the app through unit testing, where several small tests validate each unit of code. Each application will typically require hundreds or even thousands of tests to successfully validate the code.

Like the application itself, the success of the unit tests depends on how they are written. Code Contracts, available since the debut of .NET framework 4, go hand in hand with unit testing. They enable the developer to define preconditions, postconditions and class invariants, and require code to be embedded in a developer's existing classes.

As a developer is going through the testing phase of application development, they will typically take the app through unit testing, where several small tests validate each unit of code. Each application will typically require hundreds or even thousands of tests to successfully validate the code.

View Article



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Entire organizations suffer when their networks can't keep up and new opportunities are put on hold. Waiting on service providers isn't good business. In these examples, learn how to simplify network management so that your organization can better manage costs, adapt quickly to business demands, and seize market opportunities when they arise.

  • Today's enterprise datacenter can be one of the most complex business environments with dozens (for smaller business), hundreds (for larger and midsize business), even thousands (for hyperscale businesses) of servers that must be managed and monitored. At this level, just managing the cords can be challenging — let alone keeping up with the growing need for more agility and scalability within the datacenter. Simply put, companies are aggressively looking for less complexity and more agility from their …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date