Testing for startups


Sometimes it’s not reasonable to spend a lot of resources to thorough testing. You might be creating a minimum viable product for validating a business idea, or you might not even know the user needs for the product yet. In either cases, features might be dropped or drastically changed and you don’t want to put too much effort on testing a feature which might not be even needed. You need to prepare for rapid development cycles and quick changes. But you shouldn’t underestimate how useful tests can be to keep up with the rapid development. Refactoring is faster if you have good tests. Refactoring is needed to keep quality of code up. Good quality of code means the features are easier to maintain and change.

In the very early stage, it might be a better option to not test at all. This of course depends on the situation but generally you should focus on building the viable product and getting users. Testing a product which no one uses is waste of time. You should still setup the testing environment as early as possible. It may be harder in the later phase if you didn’t prepare the code base for testing.

When you know your product works in the business sense, you can start considering testing. If the product deals with money or other sensitive data, you should start testing those features first. Think of the most stable API in your system and test as much as possible against that. In web applications, that would be the HTTP API of your backend. Focus on integration tests and testing the system as a whole. This makes the tests as close to “real life usage” as possible.

Setup all environments as similar as possible to prevent making mistakes in the first place. If you have Postgres 9.1 in your production, have the same version in local development too. That’ll help to catch weird environment related bugs which are hard and time consuming to find.

However you end up testing your application, try to keep options as open as possible. Don’t tie your tests too much to changing parts of the application. Prepare for throwing test code away and don’t get too attached to your solutions. There will be a pivot in front of you and it might mean your great effort will be trashed.