Content

2/01/2012

Tool tip of the day: NCrunch

This could be one of the things that you can't live without.

The usual steps you go with TDD and Visual Studio at the moment:
  • Write test
  • Stop and run tests
  • Write code
  • Stop and run tests
  • Refactor code
  • Stop and run tests

You can go with NCrunch and it look like:
  • Write test
  • Write code
  • Refactor code
NCrunch is an automated parallel continuous testing tool for Visual Studio .NET.
It intelligently takes responsibility for running automated tests so that you don't have to, and it gives you a huge amount of useful information about your tests (such as code coverage and performance metrics) inline in your IDE while you work.

I will give it a try with my current project.

1/27/2012

Windows Phone Hub Control

In this article i will write about our experience with the Xing App main menu development.

What do we talk about?
When you think about a Windows Phone, the first association that comes up is this metro style and the live tiles.
The big new thing with the WP7 is this HUB control. It is the central place on the WP7.
Some apps make use to have such a HUB in the app. But be careful! We had some problems in the submission with it. Microsoft is not so happy about it when your menu is too similar to the WP7 hub. Microsoft will not confuse the user to much.

The idea was to include all nessesary informations in the menu in the familiar WP7 Metro style.
It shows your xing network activities in one screen.
In the beginning of 2011 we had care about our main menu and our concept.
During the development of the Xing app. We talked often about what we do if we have new functionality. Do we increase the tiles of our menu. Or what should we do?

Increase the tiles change the design.but each user has his workflow with the app. A change to the app will cause a rethink of the workflow. The user still knows where he can find the functionality.We decide to do not more then six tiles in the main menu.
But in v1.3 comes the 7th tile and they did not matched in the current concept at all.

WP7 Xing Hub Control in v1
And then came Mango
In the early summer time with the first announcement of "Mango" - the codename of Windows Phone 7.5 - we had the idea to use also the backside of each tile.

We had a critical point of view of it. First, the new tiles turn automatically around. You have no option to do it by yourself. Second, you got no information about the tile from the other side. 
We struggled around with these problems. We had a lot of concepts but also a lot of respect to submit these changes. We did not know if the users will like these changes and is it usable?
Also we had still some open questions:  How to turn a tile?
  • only turn one tile
  • turn all tiles
  • only turn tiles wich offer this functionality
The decision after our intern tests was to ends in turn all tiles. In this way there is always the same behavior behind this functionality. 
Another problem was the usability for this functionality.
We made first tests with a custom slider/button with arrows to turn the tiles. But this did not feel right. Furthermore - how shall the tiles be animated?

First draft how to turn a tile

 We tried some solutions and we are really happy about this vertically flickr gesture to turn around our tiles. You are also able to shake your handy to do this.
The animation is similar to dominos and will in a round robin style physical correct animated.

When you navigate to the main page the tiles will shake a little bit to give a hint they are turnable. But what is with the information from the backside e.g. contact count, message count...
After a lot of brainstorming we came to a really cool idea. How to show information from the backside? How about to show a folder edge from the backside?
We called the feature "dog-ear" since it reminds the folded edge in a book. The user sees that there is something behind (same color like the reverse). On this edge the information from the backside tile is also visible.
This feature also increased the users advertent and many users touched on it.
So it is also possible to trigger the tiles turn around with it. 

Xing app Hub Control in v2



It was our intention every user will see this feature by playing around with the app by own.
It is very interesting for us how is your experience with it?
Do you just understand how to use it?

We are really happy about all your feedback!

11/18/2011

Windows Phone Login

In this article i will write about our lessons learned - WP7 login page development.

Windows Phone apps are composed of pages that exist on a backstack and
can be reversed by user with the hardware back key.

There are some screens you do not want to come back. Like the login screen.
After successfully logged in, the login screen should removed from the backstack.
But explicit navigating away and from the login screen will cause to infinitly growing up your backstack. There are some solutions of keeping screens out of the backstack.

The Xing-App main page is a panorama control. The first approach for a login was kind of interesting.
We implement the login screen as a panorama item. This item is visible when you are not logged in. After successfully logged in, the item is hidden. The other items have the inverse behavior. 
In this solution we prevent the backstack problem.

While thinking about a different solution, we discussed the difference between transition and navigation. Navigation is a transition between different places. A Page is a place with a state.
But what is with this stateless pages? Here we have this splash screen or our login screen.
A common way to implement a login screen is as the first page of your app.

But is it really what you want?
While thinking about this, we came to that point the login screen can come up from everywhere in our app. The login screen has no place and it is stateless.


source: http://blogs.msdn.com/b/ptorr/archive/2010/08/28/introducing-the-concept-of-places.aspx





It is useful for example when you loose your access key and you have to login again.
The login page will popup at this place and you can continue after success.
The Silverlight Popup control is a great solution for showing content that (partially) covers the screen without doing a full navigation.You can also override the back key pressed event to handle the hardware back key to have more control over the popup.

This login behavior can also be useful for other platforms.

10/14/2011

Windows Phone Marketplace Test Kit

There is a new Toolkit for WP7 available.
The Windows Phone Marketplace Test Kit help to prepare your application to be accepted in the Marketplace.
The Test Kit enables you to identify and fix issues prior submission.
You can use the test kit to evaluate applications that target Windows Phone OS 7.1 or later and it is part of the Windows Phone SDK.
Here are some of the tests from the msdn page:
  • Whether the specified images and screenshots meet certification requirements.
  • Whether the application icon and background image used in the application meet the certification requirements.
  • What capabilities the application uses.
  • Whether the XAP meets size requirements and whether the application manifest is valid
  • Whether the application handles errors properly.
  • Whether the application starts quickly enough to meet certification requirements.
  • Whether the application exceeds memory usage requirements.
  • Whether the Back button in the application is being used properly.
  • Whether the application uses APIs that are not allowed on the phone.
  • Whether the application uses APIs that are not allowed with background agents.

Using The Test Kit

Application Details
 
Automated Tests

Monitored Tests

Manual Tests

9/28/2011

How to force Windows Phone Mango update early

Windows Phone Mango has started rolling out but not all customers are actually scheduled to receive the update on day one.
The entire process may take one month.
Those of us they won't wait here is a way to force the update immediately.

9/07/2011

Program your phone directly on your phone

With TouchDevelop you do not need a separate PC. Scripts can perform various tasks similar to regular apps. Any TouchDevelop user can install, run, edit, and publish scripts. You can share your scripts with other people by publishing them. 


Let us see in the oracle and the impact on Software Engineering.
Will this spawn something like the VBA cottage industry?
In the future you might be able to create powershell script or similar for an enterprise.
Also you will now have not only a consumer device and can create useful software, after all if you can create your first game, then you can do just about anything. Other platforms will come with the same idea and end user can actually build useful products.

8/03/2011

Unit Testing for Windows Phone


In this article I am going to talk about unit testing for Windows Phone 7.
First, there is no option for a windows phone test project within the IDE.

In our XING-App we use Silverlight Unit Test Framework and NUnit as the provider for test metadata.
We have an additional test project to run unit tests called TestRunner. 
Reference these Microsoft.Silverlight.Testing.dll and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll assemblies from the Silverlight Unit Test Framework to these project.

Note: You will get a warning about adding silverlight 3 assembly, it is fine and you can click yes to continue.

Set up the testpage
Hide the system tray to have more space if you like.

Register NUnit as the provider for test metadata (attributes etc).  That tells the silverlight testing framework to use the NUnit test attributes instead of the default MSTest attributes.

tell the silverlight testing framework to use the NUnit test attributes
  1.             UnitTestSystem.RegisterUnitTestProvider(
  2.                 new NUnitProvider());

We use an additional project for the unit tests. 
So we need to add assemblies, that contains the tests. 

Add unit tests
  1. settings.TestAssemblies.Add(typeof(Hook).Assembly);

Now any NUnit test fixture you add to the project should work.
Note that you can only have NUnit tests or MSTest tests in a project, not a mixed combination.

Create the testpage and let the unit testing framework take over.

Set the testpage
  1.  var testPage = UnitTestSystem.CreateTestPage(settings)
  2.      as MobileTestPage;
  3.  BackKeyPress += (x, xe) => xe.Cancel =
  4.      testPage.NavigateBack();
  5.  (Application.Current.RootVisual
  6.      as PhoneApplicationFrame).Content = testPage;

Using NUnit
Download the binaries from the nunit-silverlight project and add NUnit.Silverlight.Compatibility.dll and  NUnit.Silverlight.Metadata.dll as reference to the test project.
Tag your unit tests to run specific subsets of tests. When you start your TestRunner-App you can choose to only run tests with a certain tag, a certain set of tags, or not run tests with specific tags

Tagging a testmethod
  1. [Test]
  2. [Tag("UnitTestTag")]
  3. public void AlwaysPass()
  4. {
  5.     Assert.IsTrue(true, "method intended to always pass");
  6. }

Integration Tests
Now combine unit tests (modules) and test it!
For the integration tests we follow our created test plan to chose aggregates.


Id
XXXX


Test Type
Explorative / Serversimulation


Title
Logon is necessary after logout.
Test Goal
Ensure that the user has to log on again after he performs a log off.
Precondition
Same as XXXX
Steps
Automated Test: IntegrationTests.
Expected Result
The network news page is shown.
Note



Our WP7-App has a lot of asynchronous method calls like web service calls.
To test asynchronous methods you will first have to make sure your TestClass inherits from SilverlightTest.
Next, you will need to mark the test method as asynchronous. Finally, you will have to call EnqueueTestCompleted() to tell the test when it has completed.
If you do not call this then the test will never complete.

The XING-App make use of a TestBase class. This class inherits from SilverlightTest and overrides EnqueueConditional.
To make sure all tests end, EnqueueConditional becomes a timeout mechanism. The test will fails and EnqueueTestCompleted is called and the test is really completed.

Asynchronous testmethod timeout
  1.             var timer = new DispatcherTimer();
  2.             timer.Interval = new TimeSpan(0, 0,
  3.                 ConditionalTimeout);
  4.             timer.Tick += delegate
  5.             {
  6.                 // remember
  7.                 // to stop timer or it'll tick again
  8.                 timer.Stop();
  9.                 throw new TimeoutException();
  10.             };
  11.             EnqueueCallback(timer.Start);
  12.             base.EnqueueConditional(conditionalDelegate);
  13.             EnqueueCallback(timer.Stop);

Fake test server
We are in the test process and we do not want to run the tests against the live XING-Server, so we need such as a fake XING server. This fake server also helped us in the development process.
During the development we got no test XING-Accounts. The only way to test was with our live accounts. 

Our fake server is a normal web service and is similar to the XING API. We also have functions like:
  • make many users
  • make visit
  • make many messages
  • make number of contacts
These helper functions are very useful to use this test server and to write easily these integration tests.
It was also very useful to test functionality against this test server. For example, if you need some contact requests.