Getting started with Pex in Visual Studio 2008

Published August 24th, 2009 Under Software Testing | Leave a Comment

Nikolai Tillmann and Peli de Halleux give a short tutorial on Pex, an automated white box testing tool for .Net. The tutorial is a pair-programming session where they show us how to get started with Pex in Visual Studio, starting from an (untested) piece of C# code:
* how to use Pex to explore the behavior of any method in your code,
* how to save the exploration results into a unit test suite,
* how to improve the generated parameterized unit tests to leverage Pex code exploration engine.
If you want to follow up the steps on your machine as well,
* Download Pex from DevLabs
* Download the code example
* Ask your questions in the forum


Get Microsoft Silverlight

Eliminating Static Dependencies

Published August 21st, 2009 Under Coding, Software Testing, TDD | Leave a Comment

Nature abhors a vacuum.  It turns out she also abhors static dependencies (I have my sources).  Static dependencies are the modern-day globals, often exposed through classes named “Helper”.  I’ve certainly been guilty of overusing static dependencies in the past, with classes like “LoggingHelper”, “SessionHelper”, “DBHelper” and so on. The problem with static dependencies is that they are opaque to the extreme, enforcing a strong coupling that is impossible to see from users of the class.  To demonstrate techniques for eliminating static dependencies, Ray Houston and Jimmy Bogard created a short screencast. The screencast demonstrates using TDD along with ideas and techniques laid out in Michael Feathers’ Working Effectively with Legacy Code and Joshua Kerievsky’s Refactoring to Patterns.  It details how to make safe, responsible changes to an existing legacy codebase, while improving the design by breaking out dependencies to a static class.

Watch this screencast on Pablo TV

Pex – Automated Exploratory Testing for .NET

Published August 21st, 2009 Under Software Testing | Leave a Comment

Pex is a white-box test generation tool for .NET. Starting from a hand-written parameterized unit test, Pex analyzes the program-under-test to determine relevant test inputs fully automatically. To this end, Pex executes the program multiple times with different inputs while monitoring the taken execution paths. Pex uses a constraint solver to determine new test inputs that will exercise different execution paths. As a side effect, Pex may find errors in the program. The result is a traditional unit test suite with high code coverage. In addition, Pex suggests to the programmer how to fix certain errors. Pex is integrated into Microsoft Visual Studio.

Microsoft and ALT.NET – At the crossroads

Published August 19th, 2009 Under Agile | Leave a Comment

ALT.NET represents a community of thought leaders with a call to action of improving the status quo of how software is developed in the Microsoft developer ecosystem. ALT.NET encourages very strict adherence to agile practices such as BDD (Behavior Driven Development) and tools that map to those practices fairly closely. The result is that they have historically recommend open-source solutions such as NHibernate, Structure Map and Castle’s Monorail over Microsoft’s platform solutions. How has Microsoft responded at this crossroads? The answer has been is to become part of the community itself. As a result, several efforts have spawned throughout the company which are taking ALT.NET feedback and translating it into action. This includes providing better integration with open-source solutions, and supporting leading-edge ways to develop software.

Refactoring Techniques: Learning the Wrap Method

Published August 13th, 2009 Under Coding | Leave a Comment

In this episode we are going to take a look at a refactoring technique outlined in detail in working effectively with legacy code. We will walk though this technique and take a look at how it can help you to create better and more maintainable code.

http://www.dimecasts.net/Content/WatchEpisode/134

Isolation Frameworks: Learning how to validate expectations

Published July 21st, 2009 Under Software Testing | Leave a Comment

In this episode we are going to continue our series on learning how to use an isolation framework (Rhino Mocks) to help create simpler and more reliable unit tests. We will focus our learning this time around on the various ways you can setup and validate expectations on your stubs/fakes. Validating these expectations will allow your to confirm in tests your dependencies are being used in the manor expected.

http://www.dimecasts.net/Content/WatchEpisode/127

Resources
Rhino Mocks Home Page
Episode Source Code

Isolation Frameworks: Learning how to Stub & Fake Data

Published July 20th, 2009 Under Coding, Software Testing | Leave a Comment

In this episode we are going to start learning how to use an isolation framework (Rhino Mocks) to help create simpler and more reliable unit tests. We will start off our learning experience by learning the basics. We will be taking a look at how to setup stubs/fakes in order to hard wire return values for our objects/methods.

http://www.dimecasts.net/Content/WatchEpisode/125

Resources

Rhino Mocks Home Page
Episode Source Code

Building a NAnt script – Part 5: Adding MSTest results to your build scripts

Published July 17th, 2009 Under Software Testing | Leave a Comment

In this episode we will continue our series on how to create a build script using the NAnt build tool. In this episode we will take a look at how to add in the ability to run the MSTest testing engine via our scripts to run our MSTest unit tests.

http://www.dimecasts.net/Content/WatchEpisode/126

Learning Hudson: Setting up to run and report Unit Test results

Published June 15th, 2009 Under Software Testing | Leave a Comment

In this episode we will continue taking a look at how to setup the Hudson build server for usage in a .net environment.  We will be taking a look at how we can use Hudson to report our Unit Tests results after each build. We will be looking at both reporting NUnit and MSTest results and will also show how you can convert MSTest results into NUnit results in order to report all tests in a single screen.

http://www.dimecasts.net/Casts/CastDetails/116

The Joys and Pains of a Long Lived Codebase

Published June 12th, 2009 Under Coding, Software Testing, TDD | Leave a Comment

Agile development practices and good Object Oriented Design principles are supposed to enable unending, gentle modification of an existing codebase. Is this really true, though? In the course of 5+ years developing and evolving an open source framework, I’ve learned a lot of painful lessons about the issues that retard code extensions and modifications. I’ve also learned a little bit about the design decisions that dramatically increased my ability to extend the code. In this talk I’ll show several instances of how failing to heed design fundamentals introduced code viscosity, and how some strategic refactorings opened up the flood gates for new functionality.

Undoubtedly, the practice of Test Driven Development directly supports your ability to modify a system, but I found out the hard way that there are also plenty of ways to do it wrong. I’ll share examples of high friction TDD and the changes in strategy I employed to reduce that friction to wring more value out of TDD. The programming languages we use for .Net development have changed dramatically in 5 years. We can apply the new language features in C# 3.0 to improve the readability and structure of both our code and the way that we express unit test specifications. Lastly, I’ll discuss our changing expectations on framework usability and the resulting impact on design.

http://www.infoq.com/presentations/Lessons-Learned-Jeremy-Miller

« go backkeep looking »