Microsoft MVC bloggers

Sponsors

Browse by Tags

All Tags » TDD (RSS)
ASP.NET MVC + Selenium + IISExpress
The goal of this blog entry is to explain how you can create integration tests for ASP.NET MVC applications by using a combination of Selenium WebDriver and IISExpress. Integration tests are useful when you want to test an entire user story. For example, you might want to test whether a user can successfully add an item to a shopping cart. Adding an item to a shopping cart might require the execution of C# code, database code, and JavaScript code. Using an integration test, you can verify that the entire process of buying an item from your website works. Typically, an integration test is contrasted with a unit test . A unit test is used to test a unit of code in isolation. A unit test is typically used to verify the behavior of a single method...
Building an HTML5 App with ASP.NET
I’m teaching several JavaScript and ASP.NET workshops over the next couple of months (thanks everyone!) and I thought it would be useful for my students to have a really easy to use JavaScript reference. I wanted a simple interactive JavaScript reference and I could not find one so I decided to put together one of my own. I decided to use the latest features of JavaScript, HTML5 and jQuery such as local storage, offline manifests, and jQuery templates. What could be more appropriate than building a JavaScript Reference with JavaScript? You can try out the application by visiting: http://Superexpert.com/JavaScriptReference Because the app takes advantage of several advanced features of HTML5, it won’t work with Internet Explorer 6 (but really...
Integrating JavaScript Unit Tests with Visual Studio
Modern ASP.NET web applications take full advantage of client-side JavaScript to provide better interactivity and responsiveness. If you are building an ASP.NET application in the right way, you quickly end up with lots and lots of JavaScript code. When writing server code, you should be writing unit tests. One big advantage of unit tests is that they provide you with a safety net that enable you to safely modify your existing code – for example, fix bugs, add new features, and make performance enhancements -- without breaking your existing code. Every time you modify your code, you can execute your unit tests to verify that you have not broken anything. For the same reason that you should write unit tests for your server code, you should write...
Unit Testing JavaScript with FireUnit
I’ve been investigating different unit testing frameworks for JavaScript lately and I stumbled onto FireUnit. FireUnit is a unit testing framework created by John Resig (of well-deserved jQuery fame) and Jan Odvarko. In this blog entry, I provide a brief overview of the FireUnit testing framework. In particular, I explain how you can use FireUnit to unit test JavaScript code. Installing FireUnit FireUnit is implemented as a FireFox extension. This is both bad and good. First, the bad news. You cannot use FireUnit with Internet Explorer, Safari, Chrome, or any other browser than Mozilla Firefox. Here’s the good news. FireUnit extends Firefox with a new Test tab. This Test tab appears as an extra Firebug tab. Therefore, seeing test results is...
TDD Tests are not Unit Tests
The motivation for this blog entry is to explain the nature and purpose of the tests used in Test-Driven Development. To avoid confusion, I’ll use the expression TDD test to refer to the type of test used in the context of Test-Driven Development. The goal of this blog entry is to clarify the relationship among TDD tests, unit tests, and acceptance tests. TDD Tests are not Unit Tests Let’s start with the distinction between TDD tests and unit tests. On the surface, TDD tests are very similar to unit tests. This is not surprising, since you use a unit testing framework such as Visual Studio Tests or NUnit to create both types of tests. The purpose of a unit test is to test a unit of code in isolation. For example, you might create a unit test...
Test-After Development is not Test-Driven Development
Recently, I had a disagreement with a colleague over the correct way to do Test-Driven Development. This is an important disagreement because it affects the design of the ASP.NET MVC framework. According to my co-worker (let’s call him Tad), there is no difference between Test-First Development and Test-After Development “except when you write your unit tests.” Tad is a practitioner and proponent of Test-After Development. When you practice Test-After Development, you write application code first and then you write a unit test that tests the application code. From the perspective of someone who practices Test-Driven Development , this gets things backwards. I believe that it is an essential part of Test-Driven Development that you must write...
ASP.NET MVC Workshop Code
Thank you everyone who came to my one day ASP.NET MVC workshop at ASP.NET Connections. We managed to build an entire Movie Database application with unit tests and a reasonably good design -- Congratulations! I've attached the Movie Database application and the demo code from the workshop below. Workshop Code Read More...
More Posts