Dec

17

When folks set out to estimate the amount of work they have to do for a particular user story (what’s a user story? that’s another post…), they have to decide how they’re going to estimate the level of effort. There are two popular ways to estimate user stories: ideal hours (if you did nothing else but this task) and story points. What’s the difference, and which should you choose? Read more

Dec

13

I thought it would be interesting to start a series on agile concepts, giving a simple definition (or at least as good as can manage) and some examples. I decided to start with the Cone of Certainty. Read more

Jul

9

One of the fundamental tools in a Scrum project is the retrospective, the regular meeting at which the team looks at what they’ve been doing, and thinks about ways to improve. To my way of thinking, it’s sort of like the project post mortems we used to have, only better. But not all retrospectives are created equal. Read more

May

19

I sometimes wonder about whether large companies can be agile. When I think about how a company grows organically, one of the first things that seems reasonable is that as you add more testers, for example, you hire a testing manager, and they have their own group.  The same applies to database administrators, business analysts and the like, and you arrive at something that looks very like the average modern company today.  When you set out to create a project team, it’s obvious with this structure you’re going to need specialists from a number of different domains to fulfill all the requirements of your project. Read more

Apr

20

Firstly, apologies for the long delay in posting anything, my current client has a project in trouble, and I’m doing what I can to help them keep it moving.  I wanted to share some thoughts on what it takes for a business to be successful with agile adoption, in particular, what you have to be willing to do as a company in order to achieve the kinds of success that people brag about when they talk about agile development.  This is likely the first of several posts on the topic, and we’re going to talk about estimating and measuring progress on an agile project. Read more

Jan

10

Something has been bothering me about the way I see many teams handle retrospectives. To be fair, it’s really several things. These common mistakes do more than make a retrospective less effective, they destroy any ability to achieve the purposes of a retrospective. Read more

Nov

18

I consider myself fairly pragmatic when it comes to agility in software development, or at least I used to… I’m having second thoughts.  As long as I’ve been around agile development (it’s been, what 6 or 7 years…) I’ve been exposed to what some people call Agilistas.  You probably recognize what I mean if you’ve met one: they refer to principal thinkers in the field by first name, and have a tendency to absolutist statements like “there are no project managers in agile, we don’t need them.”  I’m beginning to think they may have a point, just not the one they think they have. Read more

Sep

29

One of my employees recently said something to the effect of “I think people underestimate the role that luck plays on development projects.” I think he’s right, but it’s a difficult topic to nail down. I’ll give it a try, though.

Read more

Sep

22

What to test?

September 22, 2011 | 2 Comments

A couple of years ago, I started working with TDD, and I must admit it’s changed the way I like to work in software. One of the side effects has been some angst on my part on exactly what needs testing… Read more

Apr

13

I like the Spring Framework for Java development. It let’s me do all kinds of neat things like interceptors, but fundamentally, at it’s core it lets me break stuff apart to test it in chunks, while still having support for wiring it together to build a complete application.

Spring is all about dependency injection, so you’d think this sort of thing would be easy, and by and large, it is, but every now and again, I run into something that makes me think that someone’s not taking their own advice.  The latest was an excursion into EasyMock and the Spring JDBC transaction support classes. For reasons I won’t go in to, we’re using JdbcTemplate and not something newer like JPA or Hibernate.  In one of my DAO classes, I need to coordinate two deletes, and so I do this:

protected void startTransaction() {

 DefaultTransactionDefinition def = new DefaultTransactionDefinition();

 status = txManager.getTransaction(def);

}

and then carry on about my business. Now, when I want to mock that, first off I need to get a TransactionManager. Well, that’s a class, not an interface, so I have to use EasyMock’s class extension package. Ok, so now I need CG libraries to code engineer a new class extending AbstractTransactionManager:

   DataSourceTransactionManager mockTxManager =org.easymock.classextension.EasyMock.createMock(DataSourceTransactionManager.class);
  
    TransactionStatus status = EasyMock.createMock(TransactionStatus.class);
    replay(status);
    EasyMock.expect(mockTxManager.getTransaction(isA(TransactionDefinition.class)).andReturn(status);
    mockTxManager.commit(status);
    replay (mockTxManager);

Okay, now I should be good to go. It’s a bit irritating that I’ve got to use cglib to get the mock, but easy enough. Wait a second, what’s this?

java.lang.IllegalStateException: 0 matchers expected, 1 recorded.
        at org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:56)

Well, it turns out after some poking around, and pulling of hair, I discovered that not only is AbstractTransactionManager a class, requiring me to “program to the class, not the interface” but getTransaction is final, so the cglib override didn’t stick.

Shame on EasyMock and cglib for not telling me my generated class wasn’t going to work, but this isn’t the first time I’ve run into behavior in the Spring Framework itself that makes me think they’re not taking their own medicine, and making it easy for me to inject what I need.

« go backkeep looking »

Blogroll

WP Themes