Testing

There are 15 entries for the tag Testing
Okay, so recently I was working on a new suggestion for my client. It was a fairly simple request; create a snapshot of data to be used in monthly calculations, with the option to regenerate the snapshot at a later time. The snapshot was easy. I thought regenerating the snapshot would be easy too, but somehow I found a way to make it hard. The first mistake I made was not writing a test first. Really this had a lot to do with laziness. The data that I am capturing is only available via a view into ......
Recently, Ayende Rahien (Oren Eini) blogged about Planning for Rhino Mocks 4.0. He’s calling for all of us to contribute our ideas on how to improve Rhino Mocks. He set up a forum where we can submit our ideas and vote on them as well. This lead me to review some of my more complex tests involving Rhino Mocks (I’m on version 3.6). Were there mocking difficulties that I could propose a solution to? Let’s find out… A frequent pattern in my tests is verifying that my controllers pull properties from ......
With my new job, I’ve not been able to take advantage of a lot of Agile/XP practices. In a company of four, where each is effectively working on a different project, collaboration is minimal. Also, for the projects that I am working on, the customer is very adamant about getting a detailed proposal up front, including a list of all of the screens and how they will operate. I’ve managed to get by without too much detail, but it is still more than I am generally comfortable with. TDD and Continuous ......
Recently I blogged that the Resharper install corrupted TestDriven.Net. I followed up to say that certainly wasn't the case. In fact, there was nothing wrong with TestDriven.Net. The problem was between the keyboard and chair. I kept getting an error about not being able to load one of my base test classes. At compile time everything was fine. I would get the error only when trying to run the test in TestDriven.Net. R# could run the tests with no problem. This led me to believe it was a problem with ......
So day two brought more items of interest. Unit Testing still problematic Apparently, ReSharper installs with version 2.2.8 of NUnit. I am using 2.4.8 which includes syntax helpers. A bunch of my tests were failing with multiple TypeLoadExceptions. To resolve the issue, I ran the tests in debug mode and took a look at where the nunit.framework library was being loaded from. I found that it was being loaded from C:\Program Files\JetBrains\ReSharper\v... Once I determined that I was dealing with ......
I finally installed ReSharper yesterday to try it out. I've been dragging my heals because I didn't want to have to learn a bunch of new commands and pay for that right (I'm cheap, I know). Here are a few things I noticed immediately. Keep in mind that these are first impressions, and they are sure to change over the next couple of weeks. [Update] I turns out that ReSharper is not the culprit here. See this post for more details. TestDriven.Net broken after ReSharper install. Any time I attempt to ......
Introduction This part in the series will focus on the SelectionController. Here is where most of the work is done. We've already covered the view interface, IRowSelectionView. Now we will see how the controller interacts with the view. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Capturing Shift and Ctrl Key Status We want to emulate multi-selection as in Windows Explorer. The Shift ......
Background Way back in March I posted about a custom GridView I was working on. Then in June, I said that I would be posting some guidelines "in the coming weeks". Needless to say, I've been busy with other things. I am hoping to provide some basic guidelines on how to customize a ASP.Net GridView. I am no expert. The experts build components for retail use. Also, I've taken a server-side approach to the problem which is perhaps a little outdated with AJAX technology available. In my case, I use ......
In the application I've been working on, we have the requirement to handle unique constraint errors gracefully. It wasn't really hard, I just had to check for OracleException.Code == 1. The trick was the testing. Testing a unique constraint error was not a problem. The issue is verifying that other exceptions are bubbled up properly. The basic exception handling code is like this: 1 protected bool HasUniqueConstraintError( Action databaseAction ) 2 { 3 try 4 { 5 databaseAction(); 6 return false; ......
Introduction In all honesty, this review may be a bit premature. However, I wanted to record my thoughts and see if anyone listening shares them or has a difference of opinion. I've been evaluating the SlickEdit Tools and have come up with a few top picks. Also, I have identified some that make little difference to me. First of all, the Tools are segregated into two products: Editing Toolbox and Versioning Toolbox. I'll review them separately. Editing Toolbox Top Picks: Acronyms - This one is quite ......
I had the opportunity today to write some more complex LINQ queries. First, I started with a simple group by expression allowing me to subtotal some data for a particular key. Certainly I could have done this in the database. Many would argue that that the database is the expert at these sorts of things, so we should let the expert take care of it. I have a couple of reasons for placing the group by in the LINQ query. First, I don't have a lot of control over the data layer. Second, I can unit test ......
Last month was a busy month for me. We deployed the first version (beta) of the product I have been working on over the last couple of months. Meeting the deadline with all of the promised features (almost) was critical. However, when you fix the time line and fix the feature set, then something else has got to give. You guessed it, quality. Quality is not just a concern over failures. There is a level of quality in your successes as well. So far, the feedback on the product has been very positive, ......
This week, we had our first deployment of the product I have been working on for the last several weeks. The deployment is to the customer's test environment and it is not a fully functional product. However, the features delivered are complete. The user are very excited. In fact, they immediately started testing the data in parallel against their prior system (Access and Excel). We received an email yesterday, stating that the data looks great and the tone of the email was very positive. Personally, ......
In a recent post, I mentioned that I was working on a customized grid view. Last week I completed the "binding to user settings" behavior. Then I took a look at the source and was stunned. I had almost 700 lines of code (and comments) and it wasn't well organized. So, I set out to start adding regions to the code to separate different behavior. The last sentence should have raised some flags. Regions to separate behavior? What happened to the cohesion of my grid view? I seem to have lost sight of ......
There are some key practices that all Agile developers should be familiar with. In fact, "familiar" probably isn't strong enough. One of these practices is test-driven development (TDD). As one of the most important activities it ironically requires a lot of discipline. What does Red-Green-Refactor mean? Here is a brief description. There are plenty of places to learn about TDD and Refactoring in more depth. Red: write a test (it fails of course) Green: write the least amount of code (the simplest ......