Quality assurance is not testing

We at Headspring have just posted our Quality Assurance article over at http://blogs.headspring.com.

I’ll give a summary here of our view of QA.  Here are the main points:

  1. Move QA before coding
    That’s right.  We are assuring quality of the whole result, not just the code.  If we code the whole thing, but the quality of the design or analysis wasn’t spot-on, we have a problem.  QA starts with analysis and goes through deployment and operations.
  2. Unit testing vs. Full system testing
    Everyone is so caught up with unit testing and TDD, but full-system testing is the only type of testing that gives close to the coverage the system will experience in a production environment.  If you aren’t doing any type of automated testing, start with full-system testing, not unit tests.
  3. Get to production quick, before the software is finished (ok, this is a point I wish were in the article)
    I’m actually expanding on it right here, but you will never have as clear a picture of whether something works until it it goes to production.  Until then, there is a risk that it will fail.  Get to production quick.  Sometimes, it seems that the type of problem or system just won’t work with an incremental rollout.  The hard problem to solve is how to not solve the whole problem right away.  How do we solve a piece of it quickly, but fully solve it.  In some cases, an incremental production rollout might be incremental by feature.  In others, it may be incremental by user group.  Still in other cases, live pilots may be appropriate.  In any case, old and new systems will need to be integrated.

Go check out the article here.

What is the difference in <%: variable%> and <%= variable%> in ASP.NET MVC?

With many folks adopting ASP.NET MVC as well as Visual Studio 2010, there is a fairly confusing change if you are one of those people who doesn’t engage in the alpha and beta phases of new product releases from Microsoft or any other vendor, for that matter.

The issue of <%: vs. <%= has had a great deal of discussion around it in the years leading up to the Visual Studio 2010 release.  This new expression syntax, or code nugget, is a new feature of ASP.NET 4.  It applies equally to ASP.NET Web Forms and ASP.NET MVC applications that are using the Web Forms view engine (ASPX).

In short, <%: ViewData["Message"] %> does the same thing as <%= Html.Encode(ViewData["Message"]) %>.

When creating a new ASP.NET MVC web application in Visual Studio 2010, you will see that the default Home/Index.aspx view is as follows.

image

However, if you create an ASP.NET MVC 2 web application in Visual Studio 2008, you see that ViewData[“Message”] is printed using the syntax that heralds back to the IDC/HTX technology of IIS 2.

image

I hope this tidbit helps in sorting through code samples online.  If you see <%: %>, you know that the code sample was produced for ASP.NET 4 or later.

INETA comes on board as a sponsor of Party with Palermo!

Thanks to INETA, which has become the latest sponsor of Party with Palermo.

ineta300

Plugged in, not charging Windows 7 solution

I recently had the popular problem of Windows 7 battery manager malfunctioning and not charging my battery when plugged in.  The battery was fine, the power supply was fine, and the motherboard was fine (I have enough laptops with the same specs in the Headspring office, and I was able to swap out parts to isolate the problem).

I also searched for this problem online, and many folks are having this problem with all makes of laptop computers.  I found the steps that solved my problem here on the TechNet forums.

There are multiple solutions proposed, and here are the steps that fixed it for me:

  1. Disconnect AC
  2. Shutdown
  3. Remove battery
  4. Connect AC
  5. Startup
  6. Under the Batteries category, right-click all of the Microsoft ACPI Compliant Control Method Battery listings, and select Uninstall (it’s ok if you only have 1).
  7. Shutdown
  8. Disconnect AC
  9. Insert battery
  10. Connect AC
  11. Startup

Please comment if this fixes your problem so that others can solve their problem sooner.  I was surprised at how many people were having this problem with Windows 7.

Jimmy Bogard to teach next MVC Boot Camp in Austin, TX on May 26th

Jimmy Bogard is again teaching the MVC Boot Camp from Headspring

http://www.headspringsystems.com/services/agile-training/mvc-training/

The class runs 3 days from May 26-28.  Give us a call at 512-459-2260 to inquire about an available discount.

Version Control & Build Systems – free Headspring on 5/18

Headspring is putting on another free workshop at the Austin Microsoft office.  This one will be led by Senior Consultant, Eric Anderson.  Here are the details:

Headspring Presents:

Version Control and Build Systems for Growing Teams a workshop by Eric Anderson on:

Does your team run into frequent conflicts with source control? Has your build system become a broken window with little hope of repair? Do you struggle to deploy minor changes and bug fixes while keeping the system stable? If so, perhaps this session is for you. Come learn how Headspring tackles these problems with source control strategies and continuous integration systems. This session will start at an introductory level and move on to more advanced tips and tricks for generally making your development life easier with version control and continuous integration.

Topics to be covered include:

  • Branching strategies in Subversion
  • Branching strategies in DVCS with Mercurial
  • Continuous Integration with Hudson
  • Continuous Integration with CruiseControl.Net

Tuesday, May 18, 2010
2:00 PM to 4:00 PM

Microsoft hosts Headspring at:
Microsoft Technology Center
9606 N Mo Pac Expy
Austin, TX 78759
(map)

Headspring training: What would you like to see?

Since January of 2008, Headspring has offered small, very advanced boot camp trainings.  These have been 3 days long and very fast-paced.  Everyone who has come through these training classes has proclaimed that they are the best organized courses they have ever taken.  Our approach to any of the boot camps is to team the practices that we employ while creating software for our clients.

We have an ASP.NET MVC Boot Camp coming up on 5/26 as well as an Agile Boot Camp on 5/19.

First and foremost, Headspring does deliverable-based project work.  We don’t do staff-augmentation, and we don’t sell our curriculum to training companies (mostly because we are always improving it).  These classes teach what we have learned regarding technologies and development practices via software projects with client.  Regarding ASP.NET MVC, four of our employees are authors on a book by Manning Publications on the topic.

If you would like to know more about our worldview of software and consulting, you can read our whitepapers, which are available via our website at http://headspring.com

Lastly, I ask, what would you like to see from Headspring to help you be better at your job?  I’m mostly asking programmers and people who manage programmers here.  We try to be an open book regarding our methods, so sharing is important.  There are many technologies and methods in which we are experts.  What offerings would you take part in?  Specifically, what offerings would you or your company be willing to invest in (with dollars)?  Let me know, and I’ll see what I can do to make them available.

Party with Palermo, Tech Ed 2010 save the date!

Party with Palermo is back at Tech Ed, New Orleans in 2010.  The date is:

June 6, 2010 at around 7PM

Location:  Margaritaville

The party will once again have Diamond Sponsor of The Code Project, so thanks to them!  Keep an eye here for announcements of more details and a registration page. 

Read all of ASP.NET MVC 2 in Action now while you wait for the printed book

image First, you should place your advance order for ASP.NET MVC 2 in Action at http://manning.com/palermo2.  That way, you will receive the printed book even before you see it at your local bookstore. 

The entire book is finished, and we are just moving through production right now.  But that doesn’t mean you have to wait to read it and learn about ASP.NET MVC 2.  Since the beginning of the book project, you have been able to see the progression of the book on GitHub, our project site and version control system.  That’s right, version control is for more than just code!

Head over to http://github.com/jeffreypalermo/mvc2inaction and go to the “manuscript” folder to read the entire book in Word document form.  All the content is there.  In fact, the Word documents for the 1st edition is there as well.  You can see just how much we have expanded the 2nd edition to not only cover version 2 but also to incorporate lessons learned using the framework over the last 2 years.

Creative Commons LicenseYou will notice that the raw files in GitHub are released under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.  That means you can use the content in blog posts, whitepapers, and you can use the code samples in any way you like.  The only restriction, really, is that you have to give us credit if you republish portions of it (and you can NOT republish the full work, of course), and you can’t resell our work.  Other than that, use it the best way you can.  We hope it is a great learning tool for you, and we hope that releasing the raw files early help you get a jump-start learning about ASP.NET MVC 2.

Credits:

Authors:  Jeffrey Palermo, Ben Scheirman, Jimmy Bogard, Eric Hexter, Matt Hinze 

Technical Editor:  Jeremy Skinner 

Foreword:  Phil Haack

P.S.  I wish I could say that we are pioneers in this, but I have personally benefited from two others I know about who have worked on their books “out in the open”:

Automating ASP.NET MVC deployments using Web Deploy

The following is an excerpt from ASP.NET MVC 2 in Action, a book from Manning to be in bookstores in May.  The early access (MEAP) edition is available now on http://manning.com/palermo2.  Authors include Jeffrey Palermo, Ben Scheirman, Jimmy Bogard, Matt Hinze.  Technically edited by Jeremy Skinner.

17.4 Enabling remote server deployments with Web Deploy

After getting a deployment script that can set up your application and database, the next step is to take on the challenge of pushing deployments to multiple servers. The key takeaway is that by automating the task of deployment, you can eliminate all the manual steps that are prone to errors.

In order to eliminate the need to log on to servers one by one, an additional technology is needed. This is where the Web Deployment Tool (formerly named MSDeploy) comes into play. You can download it from http://www.iis.net/expand/webdeploy. This tool provides a host of features and functions, , but the features most important for our deployment approach are

  • The ability to sync files over HTTP
  • The ability to execute a remote command

These features support both enterprise and hosted environments, and the scripts can be used for both preproduction environments and production environments.

Typically, for web applications, there will be a development server that hosts the web application and database on the same machine. The quality assurance (QA) environment may be set up the same way. Then, in the staging and production environments, more servers come into play. There may be a separate database server, multiple web servers, and even an application server. Automating a deployment to multiple machines can become complex very quickly. In order to reduce the complexity, Web Deploy can be used to sync files to multiple machines and execute the deployment script on each server. It can also run remotely so that deployments execute the same way that they would in the development environment.

Listing 17.4 shows the command-line arguments used to copy deployment files from a build server to a web server and then run the deployment.

Listing 17.4 Using Web Deploy to remotely execute a deployment

msdeploy.exe  -verb:sync -source:dirPath=deploymentFiles               |#1
-dest:dirPath='c:\installs',computername=192.168.1.34                  |#1

msdeploy.exe  -verb:sync                                               |#2
  -source:runCommand='c:\installs\dev.bat'                             |#2 
  -dest:auto,computername=192.168.1.34                                 |#2
#1 Copy files to remote server
#2 Execute command on remote server

First, msdeploy.exe is called with the sync verb specifying a source directory on the local machine (#1). This command copies all the files inside the deploymentFiles directory (C:\installs) to the remote server (in this case, the computer with the IP address 192.168.1.34).

Next, msdeploy.exe is called with the sync verb, but this time the runCommand argument is specified (#2). This means that Web Deploy will execute the batch file at c:\installs\dev.bat on the remote server in the same way you would run it if you logged in via remote desktop.

Using a technology like Web Deploy can greatly simplify a complex deployment. By running each command locally on each server in the deployment, scripts will run consistently from the development environment through the production environment. The real advantage is that the calls to msdeploy.exe can be scripted, which means that a multiserver deployment can be totally automated and repeatable. Scripting this type of deployment also means that from a single machine you can monitor a deployment and see the results of each script consolidated on your desktop.

17.5 Summary

When we configure our environment, we must devise a reliable deployment strategy to ensure that the right application is deployed with the correct configuration. At the heart of a solid deployment strategy is continuous integration, which includes practices such as automated deployments and self-testing builds.

With free, widely used open source tools such as CruiseControl.NET, NAnt, NUnit, and others, we can create an automated build and deployment server. By packaging NAnt, a build script, and a bootstrap batch file, we can harness the flexibility and power of NAnt to deploy and configure our application to multiple environments, up to and including production. By layering on the Web Deploy tool to reduce the friction of copying and executing the build scripts across multiple servers, we can have a totally automated solution that’s repeatable and reliable.