TAG | software
Lost Art of Simplicity by Josh Holmes was the keynote talk at the PHP UK 2010 conference. I found it to be an interesting talk with lots of good advice. While listening to Josh I was able to identify myself in the past participating in all the common software development pitfalls. I would like to share what I consider to be at least some of the most important points from the talk:
- Work with your users. Focus on them and their exact needs. As developers we often tend to forget that actual users will be using our systems. We should stop and think is what we’re doing going to fulfill the actual needs of our users.
- When deciding which tools to use for a particular problem or a project always carefully weigh all the benefits and downsides to pick the best tools for the job. If for example most of your company’s software is written in PHP and is using MySQL doesn’t necessarily mean that you should keep doing so. It might be that another language such as Python or another type of a data store such as CouchDB might be a better choice for your next project. Developers also like to play with new shiny experimental toys but it doesn’t mean that it’s the best idea for your company to use it for a particular problem.
- Do the simplest thing possible. As Albert Einstein once said “Things should be made as simple as possible, but not any simpler”. “Cleverness” might not always be a good solution. Complexity involves more moving parts and more possibilities for things to fail. As developers we tend to think about possible future developments. While it is good to do so it is also important not to over do it. While it may be reasonable to believe that a different caching mechanism might be used for a project that you work on it’s less likely that another database vendor will be used in the future.
- Invented here syndrome. It is very likely that any problem you will have will be already solved by many other people before you. If instead of inventing your own solution to the problem you can use someone else’s tools by all means do so. Not every tool might do exactly what you need, not every tool might seem trustworthy enough but there’s no excuse for not trying to find the best available tools.
If you are interested to learn more take a look at Josh’s blog where presentation slides and a full transcript is available.
Software development produces products as any other industry. It is an interesting issue that products produced by the software development industry are not always as well tested as in other industries. One of the main reasons is due to the fact that in most companies software is manually tested by the same developers who built it.
Developers are not necessarily good testers. Good software developers while sharing some traits are different from good testers. A good developer may be excellent at software design but won’t notice spelling mistakes. Developers tend to take the testing path that usually works while cutting corners on special cases. It is also known as happy testing.
Most reasons why software is tested manually boil down to:
- Not knowing how
- Not having the time
- Maintaining legacy code
Hardly any of these reasons are valid excuses. Truth be told automated testing is not easy. It is a skill that has to be learned and doesn’t come naturally. It’s a skill that takes years to master. It may seem that automated tests take too much time and at first it will. Due to the same fact that it’s a skill and takes time to master. In some way it is like skiing. Before going down a steep mountain racing the wind one has to learn how to otherwise it’s an unpleasant struggle climbing down with your skis across the shoulder. Automated testing won’t do miracles but when done properly it may increase productivity by 10 – 20%.
There are many types of software testing with their own benefits and downsides. Bellow are the three most important and common types of testing.
Unit testing is about testing the smallest individual parts of an application. For example instead of testing the whole engine of a car all individual pieces are tested separately as units. All dependencies are replaced with stubs or mocks or fakes. Unit tests are meant to be lightning fast and execute thousands of tests in a few seconds therefore they shouldn’t connect to the database, web services or send emails. Unit tests are most effective when executed very frequently during development to inform the developer of any broken parts allowing to fix the problem immediately without losing line of thought.
Integration tests ensure that all of the application’s parts work correctly when they are assembled in a simulated production environment. An example of an integration test can be a batch job executing against a database with test data. Integration tests are a lot slower than unit tests and usually work best integrated with a continuous build system. While integration tests are not good at identifying broken parts they are excellent at testing if an overall group of components is correctly wired together and produces the desired outcome.
Acceptance testing also known as functional testing or QA testing involves testing a complete system that is usually identical to the user’s anticipated system. Acceptance tests can be automated or may be carried out by a QA team. In agile software development terms an acceptance test tests a business story. For example a simple story may be “As a manager I am able to list invoices, filter them by name and date and approve or reject them” An acceptance test would test that scenarios mentioned in the story can be done on a completed system. Automated web application development acceptance tests can be carried out by selenium that simulates recorded browser actions or by asserting HTML structures. Acceptance tests shine in proving if the user story scenarios can be completed but are usually not very good at pinpointing the nature of a problem. They tend to be slow and complicated to set up. Even testing a relatively simple back office application would require to set up an up to date test database, provide datasets for every possible scenario, provide a way to test sending out emails and their contents.
Software development testing is a vast topic that deserves more attention from the the ever growing industry. Automated software testing is often times disregarded as boring, time consuming or ineffective. Mainly because of lack of knowledge and skill to make it work for you and not against you.