Tuesday, 1 November 2016

Microsoft is Going GNUts

Discussion

I cut my teeth as a commercial software developer developing line-of-business systems for SMEs in with Microsoft Access in the early 2000s. Although I have subsequently enjoyed working with a range of tools and platforms (wouldn't quite call myself a "polyglot" yet), I generally take a keen interest in how Microsoft's software development surface-area emerges and evolves over time.

The past year-or-two (since Satya Nadella has taken the lead) has been fascinating - very exciting, from my geeky perspective. The Microsoft software development toolkit is basically gone/going open - right down to the nuts-and-bolts that is "Bash on Ubuntu on Windows". This attitude is an about-face - having gone from implicitly exclusive to explicitly inclusive.

Strategically this makes great sense, since for Microsoft it's really mostly about the cloud land-grab (pun intended) now; in effect Microsoft are saying - "Bring all of your systems and platforms to Azure - all shapes, sizes and flavours are welcome, the more-the-merrier!".



[The cloud services landgrab - http://cloudcomputing.sys-con.com/node/2192464]

There is a wider discussion here - this post more-or-less focuses on what Microsoft's paradigm shift means technically for web and application development though. It was written in January 2016 - it's taken me a while to get around to publishing it - so although I have checked the links and updated some terminology, some of the material may be outdated.

Microsoft going GNUts?

Microsoft are taking us in an interesting direction with the introduction of DNX (.NET Execution Environment - now .NET Core CLI), ASP.NET 5.0 (now ASP.NET Core 1.0) and MVC 6 (now Core MVC). These cross-platform tools are creating opportunities for developers and IT pros on Mac and Linux to explore options in “Microsoft land” and for .NET developers to host applications on non-Microsoft platforms.

The move toward cross-platform capability has been on the cards with Microsoft for a while, but it feels a bit like we're shifting gears recently.

For example – there's the beginnings of a Linux/Mac-friendly development environment in the mix (Visual Studio "Code"). The structure of an MVC 6 (ASP.NET 5.0) project is significantly different from how it was previously - for example, project.json replaces {project_name}.csproj - the JSON format being open and cross-platform ready. And MVC 6 uses DNX as it's execution environment, running by default on the Kestrel web server, which is based on entirely OSS.

The following few links provide an introduction to some of this terminology:
Aside from ASP.NET 5.0, we’re also seeing some interesting developments with cross-platform capability for mobile development in VS2015, including the ability to debug native Android applications using the GNU debugger (GDB) from RC1.

What about Mono?

Mono is an open-source clone of the .NET framework, that was enabled and more-or-less foretold by Microsoft making C# and the .NET CLI an ECMA and ISO standards (ECMA-334 and ISO/IEC 23270 respectively), way back in 2003.

Microsoft’s DNX (.NET Execution Environment) is essentially a host for the .NET framework that runs at OS (“native”) level and operates in a way similar to a VM, thus literally providing an execution environment for an instance of the .NET framework. That could be a plain-old Microsoft .NET framework instance, or a more exotic Mono .NET framework instance. DNX is cross-platform capable out-of-the-box though, meaning that you can now run Microsoft’s version of the .NET framework on Linux or Mac. The introduction of the DNX doesn’t make Mono redundant, because Mono is inherently cross-platform and can run directly at the OS level. However, it does herald a sea change in the way that we think about Microsoft applications development.

The following diagram provides a nice visualisation of how everything fits together with the introduction of DNX:


[“Layering” diagram – taken from https://github.com/aspnet/Home/wiki/DNX-structure]

These couple of links may also help explain how all of this fits together:

State-of-play

In summary, DNX is an emerging initiative from Microsoft (now emerged in the form of .NET Core CLI) that provides a cross-platform execution environment that is capable of hosting and enabling applications built on Mono and/or .NET 4.5+, across the Mac, Linux and Windows platforms.

To-date it seems that this emerging ecosystem is still a bit sketchy (at time of writing the current version of DNX was 1.0.0-rc1 - now DNX has morphed into .NET Core CLI and is in release version 1.0.1) – however, it also seems it is coming along in leaps-and-bounds. There seems to be a good deal of interest from the OSS community and there's lots of support in the form of blogs, articles, etc. Here are a few goodies:

Migration path

The process of migrating an ASP.NET 4 (Web API 2) project to MVC 6 on Code/Linux (Ubuntu) still seems to be riddled with dependency issues, so certainly not plain sailing just yet. But it is early days and the tooling is maturing rapidly. This opens up some interesting questions (and opportunities) for the future of Microsoft applications development.


Closing thoughts

The essence of software development is not brands, tools and platforms - it is craft, design and skillful execution. I feel like developers increasingly understand that nowadays, which is cool. Microsoft's new strategy lends itself to this, which is also cool.

Looking forward to seeing how Microsoft's increasingly open/inclusive strategy plays out over the remainder of 2016 and in to 2017.

Friday, 8 July 2016

Thoughts on official version(s) of history

It's a sign of a healthy society that the validity of an official version of history may be openly queried.

It's also healthy that an official version of history (of course everyone is entitled to maintain their own personal version) be managed by accepted academia (i.e. peer reviewed, by publishing in established independent media; journals, conferences, etc), who are constrained for the sake of their reputation to backing up statements they make with academically verifiable evidence.


The way to change history in this case is to invest the time required to do it through academic channels. That would usually involve getting a Ph.D and because of the rigor necessitated by this approach, is usual only feasible to do a bit at a time.

The other way to change history is by war - revolutionary change to an official version of history can be achieved this way. A version of history implemented by war works for the winner; for the group of people that they manage to win rule over and for as long as they choose to operate a dictatorship.

Perhaps all official histories started out by being imposed by war. As peace ensues though and as academia becomes free to explore, official history becomes decreasingly biased.

Friday, 28 August 2015

Using TestDriven.NET and NCover to benchmark and monitor unit test code coverage

I wrote this blog post about a year ago - have finally got around to putting it online. It uses a "genericised" system called UpdateManager to demonstrate how to set up code coverage analysis for .NET. Hopefully it's not too dated just yet...

What is unit test code coverage benchmarking/analysis?

Unit test code coverage analysis essentially tells us "how much of my codebase is covered (or "exercised") by my unit test suite?"
When we are writing unit tests, it is necessary to visually scan the codebase and get a feel for what degree of coverage we have and what parts of the codebase are important/relevant for unit test.
Setting up a benchmark such as "a standard .NET codebase must have at least 70% unit test coverage" can be useful, as although this is not a fail-safe way to make sure that we are testing the right things, we can at least be certain that if our metrics indicate we meet the benchmark, most of the important stuff will be tested.
There are several tools available that will provide this sort of metric on a .NET codebase - including NDepend, NCover, etc.

TestDriven.NET vs ReSharper

TestDriven.NET is a tool that is primary intended to support unit test development, but it has a lot of overlap with ReSharper.
If you're already using ReSharper currently (as many .NET development teams do) - and given the fact that ReSharper generally has superior functionality where there is functionality overlap with TestDriven.NET - there is not a lot of value for us in having an additional tool for this purpose.
TestDriven.NET however supports one function that ReShaper lacks - which is unit test code coverage analysis - TestDriven.NET has a built-in instance of NCover, which can be accessed like this:
[Getting to NCover from TestDriven.NET]
When NCover is run across a unit test library, it will run all your tests and provide a code coverage report (percentage coverage of codebase by unit tests), that looks something like this (see the Output window of VS2010):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
------ Test started: Assembly: UpdateManagerUnitTests.dll ------ 

2014-06-19 16:18:29,366 [TestRunnerThread] ERROR Logger XxxMetadata.LoadFile - ERROR:
System.ArgumentException: Empty path name is not legal.
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at UpdateManager.Logic.XxxMetadata.LoadFile() in E:\UpdateManager\Logic\XxxMetadata.cs:line 56
2014-06-19 16:18:29,423 [TestRunnerThread] ERROR Logger XxxMetadata.XxxMetadata - LoadFile FAILED

[etc...]

19 passed, 0 failed, 0 skipped, took 10.13 seconds (NUnit 2.6.1).
Following that NCover will open an interactive explorer app/window called “NCoverExplorer” – like this:

[NCoverExplorer window]
Using NCoverExplorer, you can browse the codebase (by namespace) under test that has been analysed by NCover and establish the percentage that each assembly, namespace, class and event method/property is covered by unit test.

[NCoverExplorer window - browse to assembly]

[NCoverExplorer window - browse to namespace, etc]

Summary

Setting and adhering to a code coverage benchmark (and tooling up accordingly) is a step along the way to establishing a mature, modern software development practice.
Adopting unit testing as a practice by itself is extremely important. However, code coverage benchmarking and analysis provides the on-going measurement and reporting that is required to be able to sustain the practice.
TestDriven.NET and NCover provide a way to get started with adopting and learning this practice relatively cheaply. TestDriven.NET is free for personal use.

Gotcha!

When TestDriven.NET is installed over the top of ReSharper, it can sometimes "replace" some of ReSharper's very nice unit testing automation functions (such as those neat little green dots on the left side of the text editor that will launch a test for you and indicate the most recent result).

[ReSharper - neat little green dots for running tests]
Never fear - in order to get ReSharper's functionality back, just re-install ReSharper back over the top of TestDriven.NET. It's a bit of a "sledge hammer" approach, but you only need to do it once, and it works.

References

TestDriven.NET: http://testdriven.net/


Friday, 2 January 2015

The importance of improvisation

Preamble, background, etc

Scrum is a process improvement framework that has grown up within the world of software development and/but is increasingly used not only within the world of software, but outside of it also. Scrum in-fact lends itself well to product development in general. This post focuses on Scrum (and frameworks like it); in particular how it copes (or doesn't cope) with significant organisational change and where/when improvisation becomes more important than a framework.

The following links provide some information about Scrum:

An acquaintance of mine recently asked an interesting question about Scrum

...which was essentially: 

"What do you do when an established Scrum team encounters a serious problem?" 





["What do you do...what do you do...?" - source: http://chaffeenguyen.com/win-win-situations/]

As a process improvement framework, Scrum is able to cope effectively with most of the day-to-day problems that an organisation may face. Occasionally though the problem is simply a mismatch for the framework - just too big. For example; the business has changed hands, management has changed and/or the business' strategic direction changes.


Scrum works great when business is relatively smooth; it surfaces problems to be resolved by the team/business, etc. Beyond a certain size/volume of problem(s) though Scrum seems to become impractical. What emerges then is a need for the team to lean more heavily on it's ability to self organise and improvise - outside of any framework - in order to be able to recover effectively or perhaps survive. For this reason, I have come to think that drilling a Scrum regime across an organisation is not necessarily always best for business. 

Strategy and the importance of improvisation

To reach their true potential, teams need to have the freedom to explore, develop and optimise their own capabilities within themselves and outside of any set framework. Rigorous adherence to a framework can mar the natural and relatively fragile team-gelling process. Another trade-off to rigorous adherence to a framework is that a team's improvisation skills become rusty. And the ability to improvise in particular is key not only in emergency situations but also (arguably, more-so) in day-to-day business.




[Miles Davis; exemplary improviser - source: http://www.fastcompany.com/3000340/if-miles-davis-taught-your-office-improvise]

Furthermore, in reality, business is not about trying to get things to go as smoothly as possible - to survive and be prosperous, a business must seek out and overcome difficult challenges. If we focus on "getting to smooth" then we invariably begin to steer clear of challenges (AKA opportunities). 


A successful business (or one that at least plans to succeed) will have strategic direction and in alignment with that strategy some challenges will need to be avoided. More importantly though a business' strategy ideally will generally - and openly - identify the type of challenge that it wants to line-up and engage. That way at least everyone knows what the intention and direction of the business is and can have a feel for what's right and what's not. 

Of course, engaging and avoiding challenge is a balancing act that needs to take in to account resourcing, scheduling, cashflow, etc. Shying away from challenge purely in the interest of maintaining stability though is essentially laziness or myopia. Of course, this is deadly in business - remember Kodak? MySpace? Etc. 

Where am I going with this in terms of the framework...? Well, from a strategic perspective, the framework is simply a tool that's there to help a business reach it's strategic objective. Interestingly, working within the framework it can be difficult to identify if/when the framework itself has become a problem. It can happen though, especially in times of significant organisational change - a framework can in-fact be used as a shelter; a means to avoid or delay dealing with organisational change openly. In this situation things can become fuzzy and political - so I won't take this line of thought any further. I wanted to at least identify this point as part of this post though.

Is the framework still relevant?

So, certainly not suggesting that Scrum and frameworks like it are rubbish - far from it - they can help new teams get a great kick-start and can provide a clear ramp-up for organisations new to Agile. 




[Bamboo scaffolding, Hong Kong - source: http://www.archdaily.com/tag/architectural-photography/]

What I am suggesting is that beyond a certain point - whether it's due to an organisation reaching a certain level of maturity or an unavoidable and significant organisational change - the framework may become irrelevant and perhaps even cumbersome. It's worth being aware of this as a possible scenario, and if possible maintaining a general "feel" for a framework's relevance within the organisation.

Agility/stability

In my opinion, Agile essentially still holds the key in times of challenge and uncertainty. Outside of any framework, the basic principles of the Agile Manifesto (http://agilemanifesto.org/) seem to hold true; providing a simple, value-oriented sounding board when things get awkward/ambiguous, and a clear guide back to stability - until the next time!


Thursday, 6 November 2014

The story of the "My Big Bro" experiment

What is MyBigBro?

MyBigBro is a system I have built that tracks a user on their journey through a city and captures and stores imagery of them that has been made available on the city’s CCTV traffic camera network, as they move through the field of vision of each subsequent CCTV traffic camera.

Why'd you do that?

There is a growing trend among Governments globally to make the data that they collect on their citizens as open and available as possible. The MyBigBro 'experiment' (I'll explain why I call it that later) explores this trend and leverages some of the data that is becoming accessible.

Some examples of open dataset repositories provided by Government are as follows:
One of the datasets that I find particularly interesting is CCTV traffic camera imagery. MyBigBro leverages that specifically.

How does the MyBigBro experiment work?

At the time that I originally wrote this document (which was originally a pitch for funding, and has now been hacked and re-purposed for this blog) MyBigBro was in deployed on the Android app store "Play" and in early alpha - not publicly available. There were (and still are!) a number of features yet to be developed before it was properly ready to introduce it for public use - it's now publicly available

It was working at a rudimentary level in early alpha though. Here is a screenshot from a journey that I made and tracked using it on January 4th 2014 (The look and feel of the system has changed significantly since this screenshot was taken):


[Images captured while travelling though Mangere Bridge, Auckland]


Architecture

The MyBigBro system architecture leverages a range technologies. Although the following diagram references AWS elements, currently MyBigBro sits mostly on the Azure cloud platform; the fundamental architecture has not changed significantly however since I drew the diagram in early 2014:


[The MyBigBro system architecture]

At the time I was using AWS and a local webhosting organisation (http://www.kiwihosting.net.nz/) for hosting purposes. The back-end services are now almost entirely running on Azure. No clients other than the Android one exist at this stage.

Development and potential; thoughts

Development on MyBigBro has been underway since mid-2013; my efforts ramped up in early 2014, following my completion of a two year part-time study programme last year. The idea first came to me sometime in 2012. I suppose I get between 1 and 10 hours per week to spend on this initiative, sometimes more, sometimes less.

Over the coming months and years I anticipate many city's CCTV traffic camera networks will become more advanced; the cameras will become higher resolution, the images will be refreshed at closer intervals and the camera networks will become more granular (we are already seeing this in
NZ). Currently images being captured from the NZ network are “hit and miss” as to whether the participant is captured, due to the CCTV image refresh intervals and the resolution of the cameras. As the camera networks develop though, users of MyBigBro will be able to capture images of themselves increasingly regularly.

At the time of writing (Nov 2014) MyBigBro is limited to New Zealand, Sydney, Hong Kong and London’s CCTV traffic camera networks. London is (currently - only just) of most interest, since the CCTV camera network there is vary granular and covers a rich range of urban settings.


[App screenshot showing a sample image picked up by a test user in London - https://mybigbro.blob.core.windows.net/images/55552a1b-9ffe-4336-a094-032f8b0d3650.jpg]

Further information relating to London’s CCTV traffic camera network is as follows:

Theme and market

The theme that I am developing could perhaps most accurately be described as “gamification” of issues that are of public interest, such as public sector CCTV infrastructure. The front-end (web and mobile app) is a novelty, which appeals to our general curiosity with regard to what data our Governments are collecting about us and making available to the general public. The product is mildly tantalising, but is not a tool or a necessity. I'm not certain what the market for MyBigBro is as a service, but can speculate...

Futures

The intention of the system at this stage is to capture imagery from cameras as users move through a network of CCTV cameras. The system could be adapted easily though to capture and store a series of images from a single camera indefinitely. This would be useful for example if a user wanted to keep an eye on their car overnight, which they had parked and left in the field of view of a camera.

MyBigBro is not really a business or a productivity tool – it is more like part of an experiment. However, given the current attention that issues relating to public sector data collection and distribution are receiving, MyBigBro does have the potential to become a point of interest in cities like London, where Government CCTV use is pervasive. Follow-on opportunities may arise as interest in the platform grows.

How can I get/use MyBigBro?

As mentioned above - the app's currently only any good to you if you use NZ's motorways, or Sydney, Hong Kong or London's streets. That being said, here's how you can get started:
  1. Get the app: https://play.google.com/store/apps/details?id=com.infostructure.mybigbro
  2. Visit and fnd your way around the web app: http://mybigbro.tv/
  3. Run the Android app (background is fine), traverse your city, look-and-see on the web app if any images are captured.
  4. Ask questions: https://twitter.com/mybigbrotv
Easy as 1, 2, 3...4!

Why "My Big Bro"?

So if you have not guessed; I call this experiment "My Big Bro" after the character "Big Brother" in George Orwell's book 1984. This is a loose reference to the way that the system sort of, claims back some of the data that is collected by a/the Government on it's users. Thus, MyBigBro is (part of?) a social experiment, or perhaps (more accurately?) an artwork.


[Banksy's "One Nation Under CCTV" - source: http://londonist.com/2008/10/council_to_remove_banksy_mural.php]

To clarify - I am not a conspiracy theorist and this is not a political manoeuvre. I do actually consider MyBigBro to be an experiment; a piece of art, like an installation artwork. I'm interested in the changing nature of our cities and the role that Government CCTV has to play in that. I'm also interested in image processing and computer vision. 

Mainly right now, I'm interested in people using MyBigBro and generating data - so if you know people in London in particular - tell them to install it and tell them to tell me if they reckon I've bollocksed something  up!


Monday, 13 October 2014

"We Haven’t Got Time to Think about This Job, Only to Do It"

Thoughts on team dynamics...

This blog post is a loose assembly of some of my thoughts on communication, thought and culture - and the importance of making room for these processes/phenomena to develop when we are working to solve complex problems in teams.

Two important references

Perhaps you have heard the following commonly repeated quote of Abraham Lincoln: "Give me six hours to chop down a tree and I will spend the first four sharpening the axe." - essentially, before diving in and starting a job, it pays to think about how to approach it and prepare.

The following link will take you to a more detailed version of the same thinking with specific reference to software development - "We Haven’t Got Time to Think about This Job, Only to Do It" (Peopleware - Timothy Lister and Tom DeMarco, 1987) - if you're lucky, Google will let you read to the end of chapter 2, which is where this section is.

http://books.google.com/books?isbn=0133440737

I actually highly recommend the book "Peopleware" in general for anyone working with software development teams; at least take a look at the section referenced above (if you can reach it).

http://www.amazon.com/Peopleware-Productive-Projects-Second-Edition/dp/0932633439

Anyway, these references set the stage for the remainder of this post.

Teams, communication and gestalt

Without communication we can end up doing a lot of hard work to produce something that is mostly useless (worst-case-scenario!).

It is better (in my opinion) to at least accept - and ideally expect - that a percentage of a team's time will be spent purely on maintaining/developing cohesion and culture.

A team is an entity in itself - the German word "gestalt" (for which I believe there is no analogy in the English language) essentially means "the whole is greater than the sum of the parts". This is what a team is like.

[gestalt]


Think about it - if you have ever been part of a close-knit team (a football team, family, organisation, etc - most of us have been), you will know that they can be happy, sad, motivated, dysfunctional, hurt, inspired, etc. A team is like a living, intelligent being in it's own right; it is capable of achieving more than the sum of the efforts of the people from whom it is composed. It is born of two or more minds working toward a common cause.

Teams function optimally when they are allowed/enabled to blossom and thrive. One of the reasons people leave teams is when they have no spirit.

Agile meetings - how can we improve?

Meetings are important. It is true that some meetings are unnecessary - and should be called out - but it is important to lean toward giving the benefit of the doubt.

Agile meetings such as stand-up meetings, sprint reviews, sprint retrospectives, sprint planning and backlog grooming give us a framework that we can use to develop a healthy level of team communication.

It's important to have a technical understanding of the purpose of these meetings and use them as intended.

It is far more important though to understand the principle these meetings are founded on; that in order to optimise productivity, teams need to be given the opportunity to figure out for themselves how best to communicate and to manage their work.

[team optimisation]

Agile meetings - a taxonomy

Here are a few articles that I find useful to revisit sometimes as an overview/refresher of the various meetings that Agile prescribes:

In summary

Agile meetings provide a framework that we can use to ignite team communication. They are not the only way of doing this, just a way that has been shown to be effective. This post is not about Agile meetings - it is mostly about team communication.

Effective teams are empowered enough to take advantage of meetings and to use them as a means of internal and external communication. Flavours of Agile like Scrum can give us a guideline for how to use meetings optimally.

By definition, teams are the only means by which organisations get things done (who knew?!). Managers are important - their purpose in the context of the team is to facilitate and to enable team communication.


Sunday, 5 October 2014

Three famous female computer programmers

Grace Hopper

This lady coined the word "debugging", when she found a moth in a piece of computer hardware that she was writing code against:

http://en.wikipedia.org/wiki/Grace_Hopper#Anecdotes
[debugging 4 realz - source, Wikipedia]

Julie Ann Horvath

Is probably the most recent famous female computer programmer, after she left GitHub in a major huff:

http://techcrunch.com/2014/03/16/github-julie-ann-horvath-response/

This is a bit of a sad story and it is a shame that it was allowed to happen. Up until just recently, GitHub lauded the fact that it didn't need managers:

http://www.wired.com/wiredenterprise/2014/01/github-ceo/

So really this story reminds us why/how managers are important - good management would most likely have prevented this situation from going so badly wrong.

Women's work...?

Interesting to note that programming in-fact used to be considered "womens work" - but now most professional programmers and computer science/engineering students are male (in NZ).

So what changed...? Here's one writer's take on the situation (YMMV):

http://www.smithsonianmag.com/smart-news/computer-programming-used-to-be-womens-work-718061/

In any case, if you work in software and have even a few female techies on your team, you probably have a more balanced mix than most organisations (at least in NZ?)

Ada Lovelace

Last but by no means least - this lady wrote what is now recognised as the the very first computer program:

http://en.wikipedia.org/wiki/Ada_Lovelace#First_computer_program

The Ada programming language was named after her and was one of the first object oriented programming languages:
[Ada Lovelace - not your stereotypical computer geek - source, also Wikipedia]