Jul
15
2010

Application Acceptance Testing

Yesterday evening I found a set of Google blog posts talking about web application acceptance testing which reflect Google experience through “Several years of experience across multiple project teams”.

This reflect lot of points I brought into our discussions either at Innoveo or Jobping; best practices, screen/page object, dev. language, recording/coding, BDD..

Here are the blog posts:

And the key points I extracted from those three blog posts:

Best practices to have long-lived tests

“Acceptance tests must meet the needs of several groups, including the users and the developers. Long-lived tests must be written in the language of each group, using terms users will recognize and a programming language and style in which the developers are competent.”

Utilities such as recording tools can help reduce the effort required to discover how to interact with the web application. The open-source test automation tool Selenium (http://seleniumhq.org/) includes a simple IDE record and playback tool that runs in the Firefox browser. Recorded scripts can help bootstrap your automated tests. However, don’t be tempted to consider the recorded scripts as automated tests: they’re unlikely to be useful for long. Instead, plan to design and implement your test code properly, using good software design techniques.”

“Several years of experience across multiple project teams have taught us that the tests are more likely to survive when they’re familiar and close to the developers. Use their programming language, put them in their codebase, use their test automation framework (and even their operating system). We need to reduce the effort of maintaining the tests to a minimum. Get the developers to review the automated tests (whether they write them or you do) and actively involve them when designing and implementing the tests.”

Isolate things that change from those that don’t. For example, separate user account data from your test code. The separation makes changes easier, faster, and safer to implement, compared to making updates in the code for each test.”

“Robust tests can continue to operate correctly even when things change in the application being tested or in the environment. Web applications use HTML, so try to add IDs and CSS classes to relevant elements of the application

Try to avoid brittle identifiers, such as xpath expressions that rely on positional data. For example, /div[3]/div[1] becomes unreliable as soon as any of the positions change – and problems may be hard to identify unless the change is easy to identify.

Add guard conditions that assert your assumptions are still accurate. Design the tests to fail if any of the assumptions prove false.

Try to only make positive assertions. For example, if you expect an action to cause an item to be added to a list, assert that after the action the list contains the expected value, not that the list has changed size (because other functionality may affect the size). Also, if it's not something your test is concerned about, don't make assertions about it.

“Informative tests
Help your tests to help others by being informative. Use a combination of meaningful error messages and more detailed logs to help people to tell whether the tests are working as intended and, if problems occur, to figure out what’s going wrong.”

Taking screenshots of the UI when a problem occurs can help to debug the issue and disambiguate between mismatches in our assumptions vs. problems in the application.

Debug traces are useful for diagnosing acute problems, and range from simple debug statements like ‘I made it to this point’ to dumps of the entire state of values returned from the application by our automation tool. In comparison, logging is intended for longer-term tracking of behaviour which enables larger-scale thinking, such as enabling a test to be reproduced reliably over time.

Good error messages should say what’s expected and include the actual values being compared. Here are two examples of combinations of tests and assert messages, the second more helpful than the first:

1. Int actualResult = addTwoRandomOddNumbers();

assertTrue("Something wrong with calculation", actualResult % 2 == 0);

2. Int actualResult = addTwoRandomOddNumbers(number1, number2);

assertEquals(String.format("Adding two odd numbers [%d] and [%d] should return an even result. Calculated result = %d", number1, number2, actualResult) actualResult % 2 == 0);”

“My advice for developing acceptance tests for Web applications: start simple, keep them simple, and find ways to build and establish trust in your automation code.

The value of the tests, and their ability to act as safety rails, is directly related to how often failing tests are a "false positive." Too many false positives, and a team loses trust in their acceptance tests entirely.

Acceptance tests aren’t a ‘silver bullet.’ They don’t solve all our problems or provide complete confidence in the system being tested (real life usage generates plenty of humbling experiences). They should be backed up by comprehensive automated unit tests and tests for quality attributes such as performance and security. Typically, unit tests should comprise 70% of our functional tests, integration tests 20%, and acceptance tests the remaining 10%.

“Lots of bugs are discovered by means other than automated testing – they might be reported by users, for example. Once these bugs are fixed, the fixes must be tested. The tests must establish whether the problem has been fixed and, where practical, show that the root cause has been addressed. Since we want to make sure the bug doesn’t resurface unnoticed in future releases, having automated tests for the bug seems sensible. Create the acceptance tests first, and make sure they expose the problem; then fix the bug and run the tests again to ensure the fix works.”

About Screen/Page objects

Effective test designs

By using effective test designs, we can make tests easier to implement and maintain. The initial investment is minor compared to the benefits. One of my favourite designs is called Page Objects (see PageObjects on the Google Code site). A PageObject represents part or all of a page in a web application – something a user would interact with. A PageObject provides services to your test automation scripts and encapsulates the nitty-gritty details of how these services are performed. By encapsulating the nitty-gritty stuff, many changes to the web application, such as the reordering or renaming of elements, can be reflected in one place in your tests. A well-designed PageObject separates the ‘what’ from the ‘how’.

BDD – Behavior Driven Development

Another effective test design is based on three simple words: ‘given’, ‘when’, and ‘then’. As a trio they reflect the essential elements of many tests: given various preconditions and expectations, when such-and-such happens, then I expect a certain result.

// Given I have a valid user account and am at the login page,

// When I enter the account details and select the Enter button,

// Then I expect the inbox to be displayed with the most recent email selected.”

To me all those points are valid ! And the best is that most of them aren’t bound to a technology, a framework or whatsoever.

I could apply those principles on different applications built using ASP.NET MVC, WPF, Java JSF with different frameworks like MSpec, Watin, White, Selenium, JUnit/NUnit

You might read more about this on the following posts:

Oct
20
2009

Daily stand up meeting using Skype

Today at Innoveo Solutions we had our daily Stand Up meeting using Skype as I am at home. It worked really good ! I can’t wait to experience it on the new plasma TV that we have in our meeting room!

4028288873_799bc9aef2_o[1]

And a Chicken entering the meeting ! Hey Bojan :-)

4029051070_a90ca3a4e8_o[1]

Oct
14
2009

MVVM Light Toolkit V2

At Innoveo Solutions we are using .NET and WPF for our Innoveo Skye® Editor application. Skye® Editor is a distribution channel editor targeting business people letting them edit and configure their insurance products.

From the beginning we have adopted the Model-View-ViewModel architecture. Having our solution growing we were facing the issue of having our ViewModels dependency growing too. Some ViewModel became too much dependent of others. This was obvious in our unit tests whose complexity to setup were growing too. It was time to find a solution to decouple the ViewModels.

The solution came out after a discussion with Laurent Bugnion, the famous author of MVVM Light Toolkit. At that time we used the V1 that already helped a lot in this decoupling.

Now with MVVM Light Toolkit V2 it is even better with the new Messenger API. What we also really appreciated in comparison to other frameworks is that it is really light and the ability to open and edit the user interface into Expression Blend.

So Thank you Laurent for this GREAT framework and I looking forward for V3!

I also would like to thank my managers at Innoveo Solutions who understand Open Source and the need to have people contributing to Open Source projects, even during their professional working time. A Win-Win situation and not just a one way benefit as often.

Jul
2
2008

Innoveo Solutions new corporate identity & product name announced

At Innoveo Solutions, today we went live with our new corporate identity and announced our product name, INNOVEO SKYE.

I was quite involved into the process with the development of the web site and some minor other things.

Why a change after only 9 months?
Simply to reflect our personality, culture, spirit and soul in a more appropriate way:

VALUES /

  • INNOVATION
  • QUALITY, PROFESSIONALISM AND TRANSPARENCY
  • TRUST AND RESPECT
  • DYNAMISM AND FUN

MISSION /

  • ENABLING BUSINESS INNOVATION

VISION /

  • BE RESPECTED LEADERS IN CONNECTING THE INSURANCE BUSINESS WITH TECHNOLOGY

We started with an internal launch (I hope to be able to post some videos about it soon) made by Nick and myself!

Then after the official launch we had a little party with some German specialities brought by our German guy, Oli! And some from Italy brought by Nick!

And we made a little tour of the building to look at the new logo everywhere!

Concerning the web site here are some key points about it.

Technologies used:

Tools used during the development:

The website was developed using Scrum, Test Driven Development and Domain Driven Development.

I would like to make a BIG THANK to all peoples that helped into that process!

Internals:

  • Nick and Didier, for their great support (finally we went through the bottleneck ;)

Externals:

  • Andreas Koch, absolutely great designer (hey Andreas I am searching a designer for the new version of my website Tech Head Brothers ;-)
  • Wygwam, for their great help in the field of CSS, especially Guillaume and Matthieu (and for sure my old friend Rédo and Grégoire)
  • Evaluant, for their great Euss O/RM tool (and for sure thanks to Nicolas for the lunch, to Sébastien, Nicolas and Fabien for the support)

Stay tuned more to come from Innoveo Solutions

Jun
14
2008

Windows Live Writer Dynamic Template Plugin

Today working on the development of a website I had the following user story to develop “As an author I want to be able to add a lightbox/darkbox around my content in Live Writer”.

First of all I updated my version of Windows Live Writer to the latest CTP version. You can download it from here: Technical Preview: Now Available for Download! Nice work Joe, it is quite stable and look really nice.

Then I needed to address this user story. To do so I thought to develop my own Live Writer plugin but with some research led me to a FANTASTIC plugin called “Dynamic Template Plugin for Windows Live Writer” and by whom, you guessed, Joe. Great work!

With this plugin I was able to implement in a very user friendly way, the needed insertion of my light and dark boxes. No an author is two click away from having it boxes on the website. Nice, really nice.

But wait this plugin can do much more than templating!

Check all videos available! Watch Example 1, Watch Example 2, Watch Example 3, Watch Example 4, Watch Example 5.

Here is the result. On the left, what you see in live writer, on the right what you see on the website.

I love Live Writer! When the pages editing will evolve it will be the must for CMS.

Apr
24
2008

10 to -1, First negative score at Innoveo Solutions :-)

10 to -1 in BabyFoot at innoveo

Bojan and Me made it! Hey Lorenz and Andrea next time you will do better.

Mar
27
2008

Integration of VisualSVN (TortoiseSVN) and JIRA

The aim is to be able to associate a bug/feature described into JIRA to source code changes made into the Subversion repository.

First of all you need to install the JIRA Subversion Plugin on you JIRA server.

Then you need to have VisualSVN installed and configured with your project checkout and opened in Visual Studio. You might do the same directly with TortoiseSVN.

Right click on your solution in solution explorer and choose VisualSVN /properties:

Add then two properties bugtraq:url and bugtraq:message as here:

Now when you commit your code to Subversion using VisualSVN or TortoiseSVN you will get access to the textbox Bug-ID/Issue-Nr:

And in JIRA you will see linked to your bug/feature the Subversion commits associated to it:

A very nice feature to have in a development process!

Mar
21
2008

Set Up a Build Computer using VisualSVN, Team City, MsTest, NUnit

When I started to work on the new version of Tech Head Brothers I decided to use the new version of the unit testing framework from Microsoft. Before making this decision I read that it was much better and faster in several places. As I also wanted to get code coverage I thought it was a good idea.

I also had to setup a version control system and decided to use subversion with the facility of the free VisualSVN Server. Very simple way to setup in less than 10 min (including download time) a subversion repository on a Windows server. I highly recommend it ! I am also now, for some months, using VisualSVN that provides a seamless integration between subversion and Visual Studio 2005 and 2008. VisualSVN Limited offered a license of VisualSVN to me and my brother. Thanks a lot, really appreciated! And now at innoveo solutions, my company, we are also using it.

Then came the time to have a continuous integration server. After having CC.NET installed and used at innoveo solutions I decided to give a try to JetBrains Team City for my personal use  on Tech Head Brothers development. The installation and configuration with subversion was straight and achieved in less than two hours. So I had a version control system and continuous integration process setup in less than 2 hours and a half. Isn't that incredible?

But as you can see on the following picture I had and still had an issue!

 

My unit tests aren't running at all! And you know what? What I feared the most was actually true!

As you can read it on this msdn article: How to: Set Up a Build Computer 

Important Note:

In order to run tests during the build, Test Edition must be installed on the build computer. In order to run unit testing, code coverage, or code analysis, Visual Studio Team System Development Edition must be installed on the build computer.

Or on this forum post "Strange MSTest.exe problems with Build Server 2008 RTM"

We are indeed hoping to address this issue in a future release, but for now running unit tests with Team Build does require VS Team Suite or VS Team Tester on the build machine.

So no what I need to do as a next step is to convert my Visual Studio unit tests to a framework, like NUnit, that doesn't needs a development environment installed on a build server. What a waste of time!

At innoveo we are successfully using NUnit and Rhino Mocks with Team City!

Mar
11
2008

We are HP partner now

Nice to see that my company, innoveo solutions, became a HP Partner!

innoveo solutions

Developer & Solution Partner Program (DSPP)

Company name and address:

innoveo solutions
Hohlstrasse 560
Zurich ZH 8048
Switzerland

Contact information:

Phone: +41 43 500 54 54

URL: http://www.innoveo.com

Company Description:
innoveo solutions is a software company whose products, services and technologies enable its insurance industry clients to create business value. It provides high-level expertise in software, multi-channel e-business platforms, SOA, architecture, open source, infrastructure in combination with insurance industry knowledge.

Product Name: >> innoveo insurance enterprise sw

Last updated date: February 13, 2008

Mar
7
2008

Indexing and searching business entities using Lucene.Net Framework, part 3

Conception using generics and reflection of a search engine to index and search content in your business entities without being intrusive.

Part 1 and 2 are available following those links

  1. Indexing and searching business entities using Lucene.Net Framework, part 1
  2. Indexing and searching business entities using Lucene.Net Framework, part 2

Solution’s architecture

The main idea is to be able to define the business entity’s properties that must be indexed when this one is saved or updated in the chosen persistence system.

With the goal to be the less intrusive possible in our model we come fast to the idea that we need to extend our business entities with meta-data. The issue then is that at runtime it is needed to know which meta-data needs to searched in the entity in order to be able to index the content of the decorated property.

As one of the goal is to have a Framework which manage the indexation and the searching of whatever business entity, we might have wrote a simple class inheriting from System.Attribute in an assembly separated from our domain. That would have the drawback of behind much intrusive in our domain. Another solution was needed.

As we have seen the developed Framework needs to know the meta-data, giving it the opportunity to index the content of the property at runtime. This means that at development time it is absolutely possible to generalize this information by using the generics of the .NET Framework 2. As we are talking about meta-data the only imposed thing is that our class inherits from System.Attribute.

The choice was made then to define a utility class in the domain assembly inheriting from System.Attribute which will serve us as a decorator of the entity’s properties needing to be indexed.

On the following picture you can see an example of the domain for an application to which we have added our attribute SearchableAttribute used to decorate the Post and Page classes:

The Visual Studio solution is organized as a Domain Driven Development solution:

We have so defined the new attribute SearchableAttribute in the assembly innoveo.Blog.Domain.

Here is the description of the organization of our solution:

  • innoveo.Blog.DAL: Data access layer using Euss OR/M mapping tool
  • innoveo.Blog.Domain: Assembly containing our domain business entities
  • innoveo.Blog.Services: Layer exposing the different business services
  • innoveo.Blog.Web: Web presentation & web services layer
  • Blog: The web application

Here it is for our solution that will use our business entities indexing Framework. Let’s have a closer look now at the Framework itself!

Indexing Framework

First here is the class diagram:

The role of each class of our Framework is as following:

  • EntityIndexer manage an index and index the business entities
  • EntitySearcher let you search business entities
  • EntityDocument is used by the class EntityIndexer in order to manage Lucene.Net Document
  • IndexPath is an utility class used to specify the location of index

As you can see on the diagram we use the .NET Frameworks 2 generics this in order to allow us to search whatever attribute decorating our business entities. But also to be able to have a Framework that is not dependant of any entities. This brings a good flexibility at the usage time as it let you index whatever property of type string of whatever business entity. All of this is without being intrusive in our model.

Now that we know about the architecture of our Framework it is time to look deeper in the details of the implementation.

This post is cross-posted on innoveo blog and in French on my .NET community portal Tech Head Brothers.

About Laurent

Laurent Kempé

Laurent Kempé is the editor, founder, and primary contributor of Tech Head Brothers, a French portal about Microsoft .NET technologies.

He is currently employed by Innoveo Solutions since 10/2007 as a Senior Solution Architect and certified Scrum Master.

Founder, owner and Managing Partner of Jobping, which provides a unique and efficient platform for connecting Microsoft skilled job seekers with employers using Microsoft technologies.

Laurent was awarded Most Valuable Professional (MVP) by Microsoft from April 2002 to April 2012.

JetBrains Academy Member
Certified ScrumMaster
My status

Twitter

Flickr

www.flickr.com
This is a Flickr badge showing public photos and videos from Laurent Kempé. Make your own badge here.

Month List

Page List