Improve Software Quality with Tools and Processes





As most of the software developers know, software engineering is not just "coding". It's a complex process which requires engineering vision, analytical thinking, designing and software process management supported with tools. This article contains some important approaches, techniques and tools to improve software production quality.

Software quality depends on time and cost of course. But you can be sure that spent money and time will return as so much more. Quality standards will also be used for upcoming projects and increase company growth speed on midterm.




  • Choose a suitable process model and apply it correctly
As you know there are software process models like agilescrumiterative and incremental etc. Choose one of these according to the project type. You don't have to perform all rules strictly, you can modify most of them. The point is "using a process" here, for a systematic and ordered development.


  • Control the version of each required source
Using a version controlling system is a must. Even if only one developer exist, it must be used. Historical data, versioning, merging, ... is very important for increasing productivity. Otherwise developers will wait each other, can not detect performers and lines of previous changes, can not perform versioning systematically etc. SVNCVS and TFS are used for this purpose.

  • Track issues with easy-to-use tools
Parallel with using a process model, issue tracking tool usage is essential. JIRA-like tools are useful and easy-to-use. By tracking issues, you can track productivity and software growth and get production reports easily. Besides, those tools can be used to monitor developer work-hour productivity.

  • Perform and manage documentation
Perform documentation as required (e.g. %10 of total production time). No documentation is never a good solution as much as excessive documentation. It may include code documentation, requirement specifications, design documents, test documents, user manuals etc. Those documents are needed to be managed and shared also, by using version controlling tools or web based platforms (like Confluence). 

  • Use dependency management tools
Managing dependency libraries (library projects, jars, DLLs etc.) are a big problem especially for big projects. Configuring libraries to run the application after each release or after each project check-out is a hell. Use a dependency managing tool like Maven or at least auto build/copy script tools like Ant.

  • Use continuous integration
Building, deploying and versioning software is a big problem. Its time consuming and reduces productivity. Because of these, use a continuous integration tool (Hudson for example) and integrate it with dependency management or build tools (like MavenAnt, ..). The tool may be configured to perform a build on each commit, on clicking a button manually or on predefined periodic times...

  • Perform testing and integration testing constantly
Testing is very important for software quality. Test documentation which may consist test scenarios, results and relations with issues is required.  Also, testing (UI testing, integration testing, ...) must be performed constantly and periodically. Even if changing a single line of code may crush the whole system or crash a hidden functionality. for example, JUnit is very popular for Java applications.

  • Perform unit testing and automatize it
Unit testing is as important as the other testing methods. Unit tests provide pre-detection of most of the problems. By performing qualitative unit testing, time consumption for other testing methods also descreases. Automatizing these tests using continuous integration tools or at least command line tools (Hudson with Maven for example) are important to keep software consistency and reliability.

  • Collect metrics from production and use results
Coding metrics (e.g. line of code, abstraction ratio, cyclomatic complexity, ...) gives us some good viewpoints about software. For example, by using line of code maybe we can't (or we mustn't) determine the productivity of a developer; but we can determine the growth speed of software monthly. Complexity-like metrics tells us design errors before deployment. These metrics can be collected by tools or plug-ins (e.g. CodePro Eclipse plug-in). 

  • Follow best practices of coding and control with tools
There is no "golden rule" suitable with all software projects, but there are best practices for project management, architecture, designing, coding, testing for most situations. Performing those rules will increase the quality. For example, you can define rules for code production (about indentation, commenting, magic numbering, paranthesis etc.) and monitor convenience automatically and periodically with external tools or plug-ins like Maven Surefire Report plug-in.

4 Comments

Hibernate 3 Installation & Configuration





Short Description:
Hibernate is an ORM framework for Java applications, which maps application objects into relational database tables. It is important because:
  • Developers don't write SQL expressions into code. This saves time and increases maintainability.
  • It is database independent. DBMS can be changed without changing the code. Only configuration XML is modified for this.
  • It supports transaction methods and auto-creation of tables, constraints, relations (1-N,1-1, N-N, etc.).
Installation:
Requires two steps:

  1. Copying required JARs into /lib directory:
  2. Creating and configuring persistence.xml configuration file.
Required JARs are: 
Hibernate installation JARs
Hibernate requires only hibernate3.jar. But hibernate-jpa jar is also used generally for additional JPA properties. A database connector jar is also reqiured for connection handling. mysql-connector jar is used here for this reason. Other jars are required because of dependencies. These jars can be found on most Java developer download site with exact version numberings.

persistence.xml file is also required to map application into database. Database configuration is done in this file. It is put into /src/main/config/META-INF folder as default. Content should be as below:


Hibernate persistence.xml configuration

  • persistence-unit name: Defines the configuration id. More than one persistence unit can be defined at once.
  • hibernate.connection.driver_class & hibernate.dialect: Defines the database type. MySQL is used in this example.
  • hibernate.connection.username & hibernate.connection.password: Defines database connection parameters.
  • hibernate.connection.url: Defines database server name, port and schema. "test" is used here for schema name.
These two steps are required and enough for starting Hibernate usage. Hibernate entity definition and API usage will be explained in upcoming posts.

Posted in , , | 3 Comments

A Quick Reference to the Spring 3 DI Bean Configuration





Spring 3 DI (dependency injection) functionality which placed in "Spring Core" is very important for managing objects (or "beans") in enterprise applications.


Here is a quick reference for bean configuration of Spring DI:

Spring Bean Configurations 





You can get a bean in application by

manual:
ApplicationContext context = new ClassPathApplicationContext(new String[] {“application-context.xml”})
ViewManager viewManager = (ViewManager)context.getBean(“viewManager”);

annotation:
@Autowired
ViewManager viewManager;




Posted in , , | 1 Comment