| By Sergei Sokolov | Article Rating: |
|
| September 23, 2007 12:30 PM EDT | Reads: |
9,181 |
2. Consistent Coding - Personal and Team Practices
Following established coding practices, which may vary from person to
person and team to team, significantly improves productivity. These
best practices include:
• Coding policies and standards:
These are commonly based on collective team experience, single-handedly
imposed by an expert architect, or derived from contract conventions.
These policies don't need to be elaborate, but simply cover the most
essential coding aspects and, of course, be applied consistently.
• Best practices against silly mistakes:
Only the cream-of-the-crop of software developers can be reasonably
certain that they don't make silly mistakes. Often, such mistakes
happen not because of lack of knowledge, experience, or training, but
just because of Murphy's Law, tiredness, distraction, and other human
factors. It's best to have these checks implemented with automatic code
analysis tools so that code can be checked quickly and thoroughly.
• Custom checks against defects already found:
One of the best practices overall is never to make the same mistake
twice. Many mistakes and errors, although personally specific, can be
generalized and then automatically detected by custom guidelines or
custom checkers.
• Checks for data- and flow-dependent errors:
The trickiest errors often happen in specific corner cases, which may
be dependent on program input data and the execution state, and
typically aren't identified through manual testing. The new generation
of static analysis tools can perform a very extensive search for errors
(such as potential resource leaks, NullPointerExceptions, SQL
injections, and other security vulnerabilities) without executing the
source code they're analyzing.
Explicit published guidelines are critical to effective policy enforcement. The most effective way to enforce such guidelines is to check compliance automatically using code analysis tools. Automatic code analysis saves time, reduces the chances of issues being overlooked, and provides a reliable source of data for process monitoring.
3. Consistent Peer Code Reviews
Code review is
one of the most powerful techniques to find defects and prevent
sub-optimal software. Code reviews engage the human brain, which is a
very powerful analysis instrument. Studies show that up to 90% of
software defects can be eliminated by human inspections, with the
average being around 60%. As a rule, code review needs to be done on
any new code or critical legacy code to ensure that issues don't slip
through.
Historically, in many organizations, code review implementation is impacted by issues such as:
- Lack of consistent coding policies and explicit guidelines
- Review time is spent mostly on validating conformance with coding policy, not algorithm/architecture/reuse
- Issues are not recorded
- Resolution of code review issues aren't tracked
- Scheduling/meeting logistics (especially for distributed teams)
- High cost and induced boredom of participants
4. Early Testing
On average, fewer than 50% of
software defects are structural, and the rest result from missing or
incorrectly implemented requirements. Finding such functional defects
requires testing: exercising some portion of the software according to
how it's expected (and not expected) to work.
"Early testing" is typically done at the unit and component level before the application is fully assembled. The two main goals of such testing are, generally, performing functional validation of implemented code and securing handling of corner cases. Good testing tools facilitate testing of incomplete systems by using automated stubbing at various levels, which is vital for test efficiency at that stage. Consequently, dealing with missing or incomplete dependent components becomes much easier than if you were trying to do it by hand. Again, automation helps productivity.
A critical follow-up to early testing is reusing these tests in regression testing. Frequently, these early tests are very specific to the developer who wrote them (and - in some cases - run only on his machine) so it may be difficult to reuse them in any meaningful way. This approach, in fact, tends to cause more waste, by producing non-reusable tests. Ideally, any member of the development team should be able to use all available unit and component tests on-demand. This calls for well-structured tests that are maintained in accordance with source code, and can be automatically run in regression mode.
5. Automated Regression Testing
When many people
hear the term "regression testing," they think of activities done by QA
or test groups before a software release. This approach is more
wasteful and less effective than the continuous testing approach.
With continuous regression testing, the software behavior previously captured by automatically generated and/or user-defined tests is verified by re-running the tests on a regular basis (preferably daily) and comparing the current results with those from the originally captured "golden set." This provides developers with a safety net when they're modifying code: they can rest assured that if they accidentally break existing functionality, they will be notified immediately.
The high value-add of this regression approach is that it's automated. It's impractical to have test groups retest the same thing over and over again every day or every week - they would all quit in a month. Moreover, tests need to be run frequently so that if problems occur, they are detected and repaired without delay. To run frequently, these tests must be automated.
Developers should be able to add to the tests and execute the tests without obstacles. This can't happen if the tests belong only to the QA group. The benefit of democratic access is that individuals can run part of the test suites (to sanity-check their new code changes) as well as add tests to cover the new code they just developed. Further, if a test fails, the responsible developer needs access to the corresponding test case so he can start investigating and resolving the issue immediately. A sustainable procedure for regularly reviewing and addressing failures is a must for efficiently maintaining the test suite over time.
Report and Track Results
The famous saying states
that you can't correct what you can't measure. Hence, it's important to
assess the impact of any new techniques added to the software
development process. A reporting system is a vital component: it can be
used both to check the pulse of development and to analyze any changes
that result from improvement initiatives.
Any practical system should automatically collect relevant data from the software development process, analyze the data, and make it available to all team members and management in a convenient form - typically via Web access and role-based dashboards with drill-down capability.
Since such a system is meant to assist in the decision-making process, continuous use of the reporting system is critical. Everybody involved in the project, whether it's the manager or the developers, needs to review the status and trends data frequently and assist with keeping the process on track.
Published September 23, 2007 Reads 9,181
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Sergei Sokolov
Sergei Sokolov is a senior member of the Professional Services team at Parasoft, a provider of software development tools that help control and optimize the software development process.
- Kindle 2 vs Nook
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Windows 7 – Microsoft’s First Step to the Cloud
- Ulitzer Provides a Powerful Social Journalism Platform
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Open Source Mobile Cloud Sync and Push Email
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- US Post Office Hops a Ride on NetSuite’s Cloud
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- AJAX Support In JadeLiquid WebRenderer v3.1
- Where Are RIA Technologies Headed in 2008?
- Struts Validations Framework Using AJAX







































