Archives
Inspired By Inspiration
Submitted by jason@parlezuml.com (Jason Gorman) on Thu, 20/03/2008 - 16:38.I'm working with software developers in one of the world's most well-known media organisations, and we have just had a visit and a talk from a very well known software development writer and "thought leader".
The buzz among those who attended this guy's talk is palpable today. It feels like we've shifted up a gear. A requirements analyst sitting next to me says he's planning to start writing code again. That NEVER happens!
Transitioning To Python From Java or C#
Submitted by Corey Goldberg on Thu, 20/03/2008 - 17:13.
"compared to Java code, XML is agile and flexible. Compared to Python code, XML
is a boat anchor, a ball and chain."
- Phillip J. Eby
If you are new to Python and coming from Java (or C#, or other similar statically typed OO language), these classic articles from PJE and Ryan Tomayko are necessary reading:
TotT: TestNG on the Toilet
Submitted by noreply@blogger.com (dastels) on Thu, 20/03/2008 - 17:34.TestNG is a test framework for Java unit tests that offers additional power and ease of use over JUnit. Some of TestNG's features will help you to write your PirateShip tests in such a way that you'll be well prepared to take on the Admiral. First is the @DataProvider annotation, which allows you to add parameters to a test method and provide argument values to it from a data provider.
public class PirateShipTest {
@Test(dataProvider = "cannons")
public void testFireCannonDepletesAmmunition(int ballsToLoad,
int ballsToFire,
int expectedRemaining) {
PirateShip ship = new PirateShip("The Black Pearl");
ship.loadCannons(ballsToLoad);
for (int i = 0; i < ballsToFire; i++) {
ship.fireCannon();
}
assertEquals(ship.getBallsRemaining(), expectedRemaining);
}
@DataProvider(name = "cannons")
public Object[][] getShipSidesAndAmmunition() {
// Each 1-D array represents a single execution of a @Test that
// refers to this provider. The elements in the array represent
// parameters to the test call.
return new Object[] {
{5, 1, 4}, {5, 5, 0}, {5, 0, 5}
};
}
}
