RSS Feed Subscribe to RSS Feed

 

What Is Agile?

Agile software development is an approach to developing and delivering working software into production in incremental, iterative work cadences, known as sprints.

Being ‘agile’ is more of a philosophy than a set of rules. It is a mindset to continually improve; to embrace new ideas and implement the best ones, testing in the wild all the while to find what really works. Collaboration, feedback and iteration are key.

In this post, I will briefly touch on the Agile Manifesto where it all started, before looking at some basic concepts (feedback) and alternatives (waterfall), before the main bulk of the article, which is the flavors of Agile, including XP, Kanban and, primarily, Scrum.

(more…)

Tags: , , , , , ,

A brief introduction to SAML

 

SAML, or Security Assertion Markup Language, is an protocol used to exchange authentication and authorization data. It is XML based and allows the sharing of identity between multiple organizations and applications.

SAML is one of the fundamental cloud identity security standards.

The primary use case of SAML is Internet Single Sign On (SSO).

(more…)

Tags: , , , , , ,

Running an individual unit test with maven

Individual tests can be run from maven. This must be done from within the folder that contains the source (as in the folder that contains src/test/java), which will likely be either be the root of your maven project, or in one of your modules.

For surefire (unit tests), this will be something like:

mvn -Dtest=com.your.package.YourTest test

For failsafe (integration tests), it will be something like:

mvn -Dit.test=com.your.package.YourIT verify

This is covered in the maven surefire plugin docs and maven failesafe plugin docs respectively, but those examples don’t mention packages names, which are required.

Tags: , , , , , , ,

Git rebase

Git rebase can be intimidating for newcomers, but it’s a powerful and versatile tool when you understand it.

Like git merge, rebase allows you to bring the changes from one branch into another. However instead of all those noisy commit merges you get with the merge command, rebase allows a tidier, linear commit history.

Technically, rebasing is the process of moving a branch to a new base commit, but if that isn’t clear, hopefully the diagrams and explanations below will illuminate.

Before we even start looking at rebase though, we will start with a quick review of merging.

(more…)

Tags: , ,

Getting rid of IntelliJ warning: Local variable is redundant

When dealing with a piece of code like this

    String id = "abc";
    return id;

IntelliJ may give a warning message:

    Local variable 'id' is redundant

I can see IntelliJ’s point. The code could be rewritten as follows:

    return "abc";

However, sometimes it can be useful to use a variable name as a form of documentation.
Also, and more often, I don’t want to see this warning pop up for other people’s code! If they wish to use a “redundant” variable, who am I to argue? I certainly don’t want to be warned about it every time I do a commit.

To disable this warning, deselect the following:

Preferences -> Editor -> Inspections (-> Java) -> Data flow issues -> Redundant local variable -> Ignore immediately returned or thrown variables

Or you can setup custom handling for tests (e.g. weak warnings) under Severity by Scope.
(Based on IntelliJ 15)

Tags:

Chrome Keyboard Shortcuts

I typically use Chrome as my browser of choice, and it comes with a plethora of keyboard shortcuts that I find incredibly useful and use constantly. However there are ways to add to those shortcuts too, including a tool called Vimium…

(more…)

Tags: , , ,

Running tests in IntelliJ for a multi module maven project

This post shows how to run all the tests in IntelliJ for a multi module maven project.

(more…)

Tags: , , ,

Unit Testing – the Hard Parts @ NYC Code Camp

Thanks to everyone who came to my “Unit Testing – the Hard Parts” presentation @ New York Code Camp. I really enjoyed it! Great crowd, lots of follow up questions. And cool Microsoft office space in Times Square. Thank you to all who attended. My slides are here: http://www.slideshare.net/shaunabram/unit-testing-the-hard-parts

Tags: , , , , , , , , ,

Test Doubles: mocks, dummies and stubs

Most classes have collaborators. When unit testing, you usually want to avoid using real implementations of those collaborators to avoid test brittleness and binding/coupling, and instead use Test Doubles: Mocks, Stubs and Doubles.

This article references two existing articles on the subject: Mocks Aren’t Stubs, by Martin Fowler and The Little Mocker, by “Uncle” Bob Martin. I recommend them both.

 

(more…)

Tags: , , , , , , , , , , ,

Testing private methods in .Net

Feeling the need to test private methods is usually a sign that your code needs refactoring. The recommended approach is that you test your code via it’s public interface. Since your private methods are only accessible via those public methods, it goes that if you have thoroughly testing via the public interface, your private methods will have been tested too.

Still, there can be times testing private methods can be useful. For example, while dealing with either legacy code or when using it as a temporary step while refactoring.

How do you do this in .Net?

(more…)

Tags: ,

Docker talk at SVCC’15

Some short notes from a talk from Ted Young on the Docker ecosystem. Slides available here.

BusyBox – a number of use linux tools packaged up in to a single file. “The Swiss Army knife of Embedded Linux”

CoreOS and Red Hat’s Atomic are particularly suited for running containers, work well with (and I think even come preinstalled with) Docker.

VM vs Container. VMs ofter have multiple apps running in them (e.g. a tomcat with multiple apps running it int). With containers it is typically 1 app per container. Containers typically run within a VM (although can run on “raw metal” too). Multiple containers per VM? – I’m not so clear on!

Cgroups may be used to limit and control resource usage.

12 Factor apps – Good practices for building “cloud native” or software-as-a-service apps.

 

Tags: , , , ,

Git talk at SVCC’15

Some short notes from a talk on “Everything you wanted to know about Git…” by Lenny Markus. Slides available here.

Tips:

Use autocomplete

Use the latest git tool, not the apple default

As part of the demo, he used watch to monitor a directory by running a command every few secs.

Covered git init, staging, reset and rebasing.

 

 

 

Tags: , ,

RESTful Microservices at Silicon Valley Code Camp ’15

Thanks to everyone who came to my RESTful Microservices talk at Silicon Valley Code Camp today. Great turnout and lots of good follow up questions.

You can find the complete slides on slideshare.

Tags: , , , , , , , , ,

Java vs .Net Accessor Modifiers

I’ve been looking at some .Net code recently, and I wanted to do some comparisons on Java access modifiers vs .Net to help me better understand the code.

(more…)

Tags: , , ,

Versioning APIs

I have blogged in the past about microservices, and the advantages that architectural style can bring. These small, focussed and, most importantly, autonomous services commonly expose their functionality via a REST interface.

Inevitably there will come a time when you need to change that interface. Yes, in an ideal world, you will come up with a perfect API first time round and it will never need to change, but requirements change or new users come on board, and we must adapt. Read on to find some approaches to dealing with changing interfaces without breaking clients.

(more…)

Tags: , , , , , , , , ,