This is a follow up to my previous post, “How many defects are too many?” Now that we are tracking defects, how can do we do better?
The earlier that defects can be found in an application, the less expensive they are to fix. Defects that are found during QA are ten times more expensive to fix. Production defects are one hundred times more expensive to fix.
What are some practical ways to improve the quality of application early?
- Test Driven Development (TDD) – This is where developers create automated unit tests before they create the methods that do the work. Testing frameworks include NUnit, Microsoft Test, and MBUnit.
- Behavior Driven Development (BDD) – BDD takes TDD a step further to produce tests a business owner can understand using a tool like Cucumber or SpecFlow.
- Integration Tests – These are automated tests that hit external systems such as databases and services.
- Mocking – This is where an integration point is replaced with a mock object so that only one integration point is tested at a time. There are many mocking frameworks available such as RhinoMocks, MOQ, and JustMock.
- Continuous Integration – This is where tests are automatically run when code is checked in. Unit tests should be run during every code check in. Integration tests should be run every hour. Tools include Team Foundation Server, TeamCity, and CruiseControl.NET.
- Code Coverage – This is a percentage of tests compared to the lines of code. If a developer checks in a bunch of code without corresponding tests, the build can be failed with a tool like NCover or dotCover.
- Code Reviews – Another developer reviews the code after it is checked in.
- Automated Quality Testing – There are tools available that can check your application for quality such as Microsoft Code Analysis, NDepend, and Gendarme.
- Manual Testing – This is where a Quality Assurance tester ensures the application meets the requirements. Tests should include:
- Positive Testing – The happy path where the user enters everything correctly.
- Negative Testing – The user enters bad data into every field.
- Edge Testing – The user enters blank, low numbers, high numbers, minimum dates, maximum dates, and long strings.
- Double Click Testing – The user double clicks buttons that should be single clicked.
- Single Quote Testing – The user enters names like O’Reilly which may break some database queries.
- Performance Testing – Test areas of an application where high usage is expected.
- Automated Front End Testing – In business critical systems it may make sense to create regression tests that can be automatically run at any time as if a user was interacting with the website. An example of this type of tool is Selenium.
What best practices do you use?
Greg Finzer is the Custom Application Development Community of Practice Lead for the Sogeti Columbus Region. His duties include identifying technology trends, facilitating access to training & certifications, developing architecture expertise, supporting sales & delivery, and increasing participation in the local developer community.