When AgilityFeat first started doing software development in Costa Rica, I would tell people that we could build anything. Mobile apps? You got it. Web applications? Sure, why not! .NET outsourcing? Sure, I’ve managed .NET teams before, we can do that! Fixed price drupal development? Heck, we even considered doing that. I would rarely turn a potential customer away.

As we’ve matured as a business, I say no more often than I say yes, and that is helping us as a business. Specialization means that we are hiring people with the specific skill sets or expertise we require, and only taking on projects that fit in our sweet spot. That means less risk for us because we are more likely to deliver a quality product that our customers love, and for that same reason it’s also better for our customers.

Screen Shot 2013-05-21 at 10.33.14 AMLast week I did an interesting interview with Nearshore Americas, where they interviewed AgilityFeat about specialization, as well as interviewing several other similar nearshore software development companies in Latin America. I don’t mind sending you to an article that mentions our competition, because increasingly they are not our competition. That’s not a knock on them, because we are increasingly not their competitors either. This is the benefit of specialization – higher quality work that accentuates the talents of your team and sets you and your customers up for success.

At AgilityFeat our specializations are based on what we love and what we are really good at. To shamelessly quote myself from the article:

You find awesome people and you build the business around their exemplary skills

Based on what we’re really good at, we’ve come to specialize in combining great UX and design with Ruby on Rails development. We’re in the process of updating our product showcase on this site and we’ll be blogging more about our skills in coming months, so look for more updates so you can get to know our team better.

The Ignite talks at the Lean Startup Conference in San Francisco in December were a lot of fun, both as an attendee and as a speaker.  Below is the video of my talk on “Just Deploy It!”.

http://www.youtube.com/watch?v=SEsk8Nfwfck

In my talk, I focused on 5 anti-patterns that I see regularly in companies who are not deploying software quickly enough.  Here’s a quick summary of the points.

1) Avoid Release Plans

If you are planning your releases for the next two quarters, you are wasting your time.  Don’t do that. Release plans are for big inefficient companies, but startups have way too much volatility for this to be useful.

2) Don’t do Big Bang deployments

If you are deploying a bunch of new features, bug fixes, pricing changes, marketing changes, or more, all together, how do you know what caused the problem if customer conversion rates go down?  You need to do lots of specific and small releases so you can correlate them to user behavior and know exactly what they like and don’t like.

3) Logins and Admins are low priority

Too many teams first focus on the user administration parts of a project, but this is the least valuable thing you could start a project with.  Find some more valuable feature that you can run an experiment on first with your customers.

4) Delay Load Testing

Don’t spend a lot of time load testing features that you don’t even know yet if customers will like.  You are unlikely to have a big rush of new customers on day one.

5) Kill the Betas

Stop using the term beta, and thinking in terms of betas.  Treat every day like it’s a beta of some small feature you are working on.  Betas just encourage risky big bang releases.

So stop trying to do so much at once, release more often, and just deploy it!

Here are the slides that I used last night at the Lean Startup Conference‘s Ignite talks.  I am indebted to Eric Ries and Sarah Milstein of The Lean Startup Conference for giving me the opportunity to present.  I have spoken at a good number of conferences before and given a lot of talks, most of them much longer than 5 minutes.  This was my first time doing the Ignite format, and I really loved it.

Here are the slides on Slideshare, I hope you find them useful.

If you would like to hang out with our team on the beach in Costa Rica and learn more about software development for startups, please check out DareToBeLean. This workshop in Costa Rica will cover Customer Development (led by Patrick Vlaskovits, co-author of The Lean Entrepreneur) as well as agile engineering and process methods like I talked about at the Ignite talks.

Now if you don’t mind, I’ve got something else I want to deploy before I go back to enjoy the conference…

Nearshore AmericasDavid Alfaro and I had a good conversation with Jon Tonti from Nearshore Americas earlier this week that led to a nice blog post about the benefits of using agile in nearshore projects.  You can read the full post here:

http://nearshoreamericas.com/agile-nearshore-software-development/

As we all said in the article, it’s very hard to implement agile practices with teams on the other side of the world.  But many US companies are trying to do exactly that, because they are seeing the benefits of agile methods in the local teams and they want to see those benefits with their offshore teams.  Unfortunately there are going to be limits to how effective this can be, which the blog post covers well.

Latin America though is well positioned to provide outsourcing to US companies and also get the benefits of agile methods.  This is a huge opportunity for tech companies in Latin America, but in our experience people are just starting to try agile and many companies that advertise providing agile nearshore services are not really that agile.

Arin Sime and David Alfaro being interviewed via skype for Nearshore Americas

That’s why I partnered with David when we started offering agile nearshore services through AgilityFeat.  Because we are both experienced agile coaches and trainers, we know how agile should truly work and we are passionate about applying that to nearshoring in Latin America.  With David in Costa Rica and myself in the US, our clients can rest assured that we are always focused on continuous improvement and providing reliable and high quality development teams.

Our main business is providing Costa Rican agile development teams to our clients in the US.  But if you already are doing nearshoring in Latin America, and you are having trouble making it truly agile, then we can help you out.  We have experience consulting for a wide variety of companies and situations, and we can also help you apply the best practices we’ve learned to your nearshoring operations.

Contact me at Arin@AgilityFeat.com or 434 996 5226 if you want to discuss any of our services at AgilityFeat!

Developing software for the cloud can make test-driven development more complicated, but not impossible. In this article that I wrote for TechWell.com and StickyMinds.com, I offer advice for continuing good development practices in the face of challenges from cloud hosting and distributed computing.

To see the article, visit either site:

TechWell.com

or

StickyMinds.com

This article was published in Sogeti’s QANews on September 30, 2011. See their article here

Acceptance tests are a great way to improve collaboration between testers, developers, and customers. When all three parties agree ahead of time how to test the feature, it makes it more likely the developer will deliver working code.

Automating those acceptance tests is even better, because now the tester can easily execute all previous acceptance tests written and ensure that new features are not breaking previously existing code.

Brief introduction to ATDD

Acceptance Test Driven Development (ATDD) is a powerful way to write acceptance criteria for your agile project’s user stories.

Instead of just writing a list of requirements, you write acceptance criteria in a specific format. Your acceptance tests are written in simple formats, but they can be turned into executable code.

These acceptance tests are written before development is done, and so when the tests are executed the first time, they will all fail. This is a good thing!

The developer now knows exactly what they need to do to write the feature. They keep developing code until the acceptance tests pass, and then they are done.

Writing your “requirements” as executable code that the developer can use will improve communication between the customer, tester, and developer. Ideally all three parties will sit down together to write the acceptance tests, and then the developer can take it from there to implement the code.

Manual or Automated ATDD?

You could write your acceptance tests with the developer, and then have testers manually test them at the end of the project. In a loose sense this is still acceptance test driven development.

But you will get much more value out of it if you write the tests so they can be automated. Then testers can quickly execute all the acceptance tests written for the project (even beyond the current features being developed), and they will have confidence that the new development is not breaking old features.

Cucumber is a common framework for automating acceptance tests, and the tips in this article assume you are using it. Cucumber is implemented in Ruby, but you can use it to test virtually any system, regardless of whether your system is written in Ruby, Java, .NET, etc.

Cucumber also has multilingual support. So you can write your tests in English, Spanish, or many other languages.

Tip #1: Adopt the Given/When/Then format

The Cucumber testing framework uses a language called Gherkin for writing the acceptance tests. These tests follow this basic pattern:

Given [some precondition or starting state]

When [the user does something]

Then [something happens]

Using this format helps to make the test clear, and encourages you to properly describe the preconditions for the test, what initiates the test, and what the expected outcome is. This simple pattern makes it easy to visually scan a test and see what it does.
Tip #2: Group scenarios based on common backgrounds

In many of your tests, the “Given” clauses will be very similar. Gherkin allows you to save time by putting these common pre conditions in a “Background” section of the test file so that you are not writing duplicate code.

This also helps you determine when you can group scenarios together in the feature test. If a scenario does not fit the background pre conditions, then it should go somewhere else.

As an example, you might initially consider grouping together tests that deal with adding an item to a shopping cart. But on further consideration, you notice there are really two different set of features to consider: adding items to the cart when you are a logged in shopper, and when a new customer adds items to their cart. These could be considered two distinct sets of features since they have different pre-conditions.

Tip #3: Mock external dependencies

Automated tests need to be fast, otherwise you will not run them often enough. Teams may delay starting the automated tests if they take hours to run. The tester says “We’ll start it just as soon as a couple more developers check in their code…”

But this means you are delaying the rework of any bugs found, and that can slow down the whole project.

If your automated tests take too long, it’s may be due to an external dependency. Is the test making a call to another system? Can you “mock” that other system and replace it with fake code so that the test runs faster?

Frameworks like JMock and nMock make this possible, so that you can focus on testing your code instead of worrying about the external systems it depends on.

Tip #4: Example scenarios to build common terminology

The Cucumber framework is great, but it relies on “ubiquitous terminology.” You don’t want to write different pieces of test code for all of these statements:

Given that a user has logged in
Given that the user logs in
Given that the user is logged in

When you read these sentences as a human, it’s obvious they all mean the same thing. But the automated testing framework doesn’t understand that, and it expects you to implement three different pieces of test code for them.

Using common terminology across your team is important, so consider posting examples of common test steps on the team room wall or on a wiki. Then you can re-use other test code more easily.

Automating ATDD improves communication

Many teams want to speed up testing, increase automation, and improve communication between developers, testers, and customers. Automating your acceptance tests with Cucumber can definitely achieve all of these goals, and is worth the investment.

Following these tips will help you make the most of your automated ATDD adoption.

About the author

Arin Sime is owner of AgilityFeat, where he provides agile coaching and development services. Arin is a regular speaker at agile conferences and user groups, including the recent XP2011 conference in Madrid. Arin holds a Masters degree in Management of I.T. from the University of Virginia. You can reach him at Arin@AgilityFeat.com or on twitter @ArinSime.

Last month the QANews newsletter by Sogeti was released, and I was pleased to have an article I wrote on Agile Database Testing published in it.  I’ve reproduced the article below, and you can also see the original article here.

Agile Database Testing

Testing database changes

Testing is rarely easy, and is more often thankless.  This is particularly true when testing a heavily database driven application.  Those responsible for testing are asked to test large sets of functionality in a short period of time, and they have the final “sign off” before an application can be deployed.

When an application is heavily dependent on a database, there is extra stress in testing just before deployment.  The tester has to worry about questions like:

  • Am I testing against the right version of the database code (ie, stored procedures, views, tables, etc)?
  • Are any errors due to software bugs, or a configuration issue?
  • Am I testing against the right data to uncover bugs?
  • How can I recreate this problem in the development environment?

How can the testing team be more confident when testing large data sets and large database changes just before deployment?  Adoption of agile database development and testing techniques can create this confidence, but only if they are adopted correctly.

What agile brings to the table

Agile methodologies like Scrum and Kanban have two important impacts on a testing team:

  • Shorter iterations of development (2-3 weeks) mean more frequent testing cycles, ideally on a more limited set of features.
  • XP practices like Test Driven Development (TDD) mean that developers should have already tested and verified much of their code before sending it to a testing team.

Both of these impacts can be very beneficial to testing teams.  The shorter development iterations (or “sprints”) mean that the testing team has less new functionality to test at once.  Ideally you are only testing the new features being developed in that iteration.

Full regression testing is still good practice, but the shortened release cycle will not allow you to fully regression test the system manually.  You will need to invest the time to automate regression testing so that you can focus on testing the new functionality.

However, you don’t have to do the testing alone anymore.  TDD means the developers should have already written many automated tests for you, and these automated tests should be running on a continuous integration server every time code is checked in.

How agile complicates traditional testing

In many traditional projects, the developers work on chunks of functionality for weeks at a time without integrating their code with each other.  Then they go through an integration phase, where they spend a lot of time getting their code to work together, and only then do they turn it over to testing.

In a way this traditional integration cycle is convenient for testers.  You only have to do your testing once, and you don’t have to start until developers get through the pain of integration.

In agile teams however, the developers should be integrating code daily.  Each day they all check their code into a repository, and a continuous integration server grabs that code and runs their automated tests against it.  Instead of a painful integration phase where developers spend days trying to reconcile their separate changes, the merging and integration are done daily in small chunks that are more easily accomplished.

This means that a testing team must be ready to constantly test the system, following right behind the development team.  Regression testing needs to be automated and efficient so that testers can focus on exploratory testing each day.

From a database perspective, the frequent changes by developers also mean frequent database changes.  Table columns will be added and dropped as the database design evolves, and test data will need to be changed and repopulated easily to support the automated testing.  These frequent database changes need to be easily applied to multiple environments so that the testing team can easily synch their test database with a particular version of the software being developed.

Agile Database Testing lifecycle

First, let’s consider the simpler scenario.  Assume that your test database is already up to date and in synch with the software under test.  How do automated tests manage their test data?  Consider the following scenario where one test causes a problem in another test:

Figure 1:  Dependent tests causes failure when the data changes

The way to handle this is by creating the test data you need for each test.  While the terminology will change in different languages, the basic steps always follow the same concepts of Setup, Test, and Teardown.

Figure 2:  Independent tests will pass since data changes are unique to the test

In this case, both tests will execute successfully because there is no data dependency between them.  Following this pattern allows you to build tests that adhere to the FIRST properties:  Fast, Isolated, Repeatable, Self-verifying, and Timely.

Agile Database Development lifecycle

Now that we understand how our tests are written against a changing data set, let’s consider how we keep our database in synch with the code we are testing.  In a traditional testing environment this can be difficult, because it involves multiple people and likely time delays.

Figure 3: Database testing with multiple handoffs.  Handoffs are indicated by the relay runners, and each can introduce an unknown delay of hours to the testing process.

Instead, if the developer scripts out the database changes that are needed both to add their change and to remove their change, then we can automate this process using agile development tools and cut out some of the manual hand offs.

Figure 4:  Database migrations can be run automatically using scripts written by the developers, which make it easy for the testing team to switch the database to a version which matches the software being deployed.

The terminology varies depending on the language you are using, but we’ll use the term “migrations”, which is most familiar to Ruby on Rails developers.

A migration is a simple script that the developer writes.  This script has two parts:

1) Up migration:  Makes the change needed for their new code
2) Down migration:  Reverses the change needed if you are going back to the previous version

For example, if we write a migration that adds a new table, it might look like this:
____________________________
Version 1:
Up:
create table my_users (name varchar(100), username varchar(100))
Down:
drop table my_users
____________________________

After working with version 1 of the database for a while, we might realize that the my_users table needs to store birthday for each user.  A migration for version 2 might look like:
____________________________
Version 2:
Up:
alter table my_users add birthday datetime
Down:
alter table my_users drop column birthday
____________________________

Note that in both cases, the down migration removes the changes added in the up migration.  Ideally they should be mirror images of each other.

You can also use the migration scripts for populating table data that will consistent across all tests, and that will exist in your production system.  For example, you might want to create a migration that populates a look up table of country names.  But test data should be created and removed in the “setup” and “teardown” steps before and after each test, rather than in migrations.

Think of the migrations as the place you will write all database changes that ultimately go to production, and the setup/teardown as the place where you handle all database data specific to a particular test.

Tools that support Agile Database Testing

This may sound hard to implement, but fortunately there are a number of open source tools that support agile database development and testing.

If you use Ruby on Rails or Grails, then the concept of migrations and fixtures (the setup/teardown) is already built in for you.

For other platforms you can look into tools like dbunit and dbmaintain.  Both are free open source tools with good examples and communities.

Challenges to adoption

Learning the tool sets that support these techniques can be a challenge to adoption, particularly for teams who have never done any agile database development before.  For those teams, an outside coach may be beneficial to help the team see how they need to change their coding practices.

Most of the challenges you will face are process oriented, rather than technical.  For example, if your team currently shares one development database across all developers, then you probably already know that it can be a pain for the development team when developers are making frequent database changes.  But once you get up and running with agile database techniques, it will be easier for developers to each have and maintain their own database, and then their changes won’t immediately affect everyone else (though it is still important that they check in their database changes daily).

Environments with a very strict database security policy or build processes will also have some trouble adopting these techniques.  However, this is an argument for loosening security policies for development environments, or automating build processes.  The efficiency benefits of these techniques outweigh the initial work to support them.

Finally, you can see that these techniques will give developers more power than some database administrators are comfortable with.  This is a reality of efficient development and cannot be avoided.  For database administrators who are nervous about this, they will need to change their role to one of code reviewer and architect, rather than hands on script writing.  Hopefully they will recognize this as a blessing that allows them to focus on other issues and not worry as much about day to day maintenance of development and testing environments.

Conclusion

Testing database driven applications is much easier when all you have to say is “Go run version 342 of the database, execute this automated test, and you’ll see what I mean.”

There are no concerns over what version of the database tables or procedures are being used, or what test data will recreate the problem.  With a few simple commands and the right agile database driven techniques, you will be able to confidently and efficiently identify the source of bugs.  Or at least easily recreate the environments to prove they exist.

About the author

Arin Sime is an Agile Coach with AgilityFeat.  Arin is based in Virginia in the United States, but able to work internationally.  He is a Certified Scrummaster and has spoken at several Agile conferences. Arin holds a Masters degree in Management of Information Technology from the University of Virginia’s McIntire School of Commerce.  You can reach him at Arin@AgilityFeat.com or on twitter @ArinSime.  He will be speaking at the upcoming XP2011 conference in Madrid on range estimation techniques in agile.

References

http://www.agiledata.org/
Excellent information and books by Scott Ambler

http://michaelbaylon.wordpress.com/2010/10/08/agile-database-development-101/
Provides an indepth overview of agile database development techniques

http://agileinaflash.blogspot.com/2009/02/first.html
An explanation of the FIRST properties of unit tests by Brett Schuchert and Tim Ottinger