Fork me on Github s

Posts Tagged agile

I want to run an agile project

The plight of an agile project.

The video cannot be shown at the moment. Please try again later.

Tags: ,

1 Comment

Naming your unit tests

When you create a test for your class, what kind of naming convention do you use for the tests? How thorough are your tests? I have lately switched from the conventional camel case test names to lower case letters with underscores. I have found this increases the readability and causes me to write better tests.

A simple utility class:


public class ArrayUtils {

  public static < T > T[] gimmeASlice(T[] anArray, Integer start, Integer end) {
    // implementation (feeling lazy today)
  }

}

I have seen some people who would write a test like this:


public class ArrayUtilsTest {

  @Test
  public void testGimmeASliceMethod() {
    // do some tests
  }
}

A more thorough and readable test would be:

public class ArrayUtilsTest {

  @Test
  public void gimmeASlice_returns_appropriate_slice() {
    // ...
  }

  @Test
  public void gimmeASlice_throws_NullPointerException_when_passed_null() {
    // ...
  }
  
  @Test
  public void gimmeASlice_returns_end_of_array_when_slice_is_partly_out_of_bounds() {
   // ...
  }

  @Test
  public void gimmeASlice_returns_empty_array_when_slice_is_completely_out_of_bounds() {
    // ...
  }
}

Looking at this test, you have no doubt what the method is supposed to do. And, when one fails, you will know exactly what the issue is.

Tags: , , ,

No Comments

Quit your shitty job!

As a developer, what happens when you are running late on a deadline?  Do you work late for more pay?  Do you get chewed out?  What happens if a feature fails to deliver the business value that was expected?  Is it your responsibility?

Too often in the software development industry this is the case.  Developers are not given the respect afforded other professionals.  Instead, there is a perception that they are underperforming, lacking skills, or irresponsible.  There is no concept of total team effort.

What is total team effort?

What if, instead of blaming the developers, missed deadlines are the result of a failure in planning, or a lack of resources?  The failure needs to be identified, and corrected in a respectful manner.  Only then can you take corrective measures to insure it doesn’t happen again.  Does your company have a process for regularly analyzing workflow? 

I recently had a job interview with a company where the representative practically bragged about making their developers work long hours under duress.  This is not an environment I care to subject myself to.  Nor would any other talented developers that I know.  Who suffers?  The business suffers.  Product development suffers.  When we fail to deliver value to the business on a regular basis, they start to question our worth.  It’s a cyclical, self-feeding trend.  One that I don’t want to be a part of, and you shouldn’t either.

Tags: ,

3 Comments