9-Jun-12 (Created: 9-Jun-12) | More in 'CS-Java'

Addressing Code Quality in Enterprises

Question

I have a medium to a large enterprise. The software we are producing is buggy. It is brittle. It often fails. It is often down. It often allows me to delete things that I shouldn't be able to. It takes too long to respond. It is slow. It gives unexpected results. Why does this happen and how can I improve the state of code quality in my enterprise?

Assumptions, Pre-conditions


Requirements are good.
Prototype is validated and approved

How to Improve Code quality


Hire smart (don't have to be experienced!!) programmers
  - smart
  - compromising
  - empathy
  - helps others
Identify your SMALL (1 to 3) core team
Recognize the development lead for the project
Give ownership to the development lead
Write less code
    Separate your core framework from the larger application
    Increse configurability index of your application
    Use pre-built frameworks (ex: Hibernate)
    Use pre-buitl eco-systems (ex: Drupal, MS Dynamics)
    Use cloud based frameworks (ex: Salesforce, AppEngine)
Follow a SMALL number of core principles
Use high level straw-man-designs
Maintain a dedicate website for the project
Publish test cases along with requirements
Make test cases READILY accessible to developers
Significantly reduce the code/build/test/deploy cycle time
Automate test cases
Have a dedicated QA team
Use Typed Languages
Use a good IDE (like Eclipse)
Know how to debug live

Core Principles for inhouse web applications:


//Basics
Have an INREDIBLY simple application wide logging api
Have an INREDIBLY simple application wide configuration api
Advance Runtime exceptions
Don't catch exceptions unless you know what to do
To protect your resource integrity use finally clauses
Use something like Spring if availabe for object instantiation
Aware of and Increase configurability index

//Database
Keep SQL outside of executable code
Use standard data access frameworks that are tested
Use connection pools
Use Implicit transactions

//Services
Have a clearly identified service layer
Represent the service layer with interfaces
Provide interceptors for service layers
Allow services for field selection and where clause specialization
Build 30% additional capacity in services

//UI
Use Prototypes
Talk to the service layer
Rely on a Page Data Object
See if configuration is more suitable
Manage view state on the client

//Web
Monitor your resource connections
    (files, database connections, threads etc)
Don't rely on Web Sessions except minimally
Make sure browser back and refresh works
Adapt B2B/B2C compatible architecture
Promote REST for services

//Security
Use enterprise level security authentication

Maturity Level I application


//Basics
Advance Runtime exceptions
Don't catch exceptions unless you know what to do

//Database
Use standard data access frameworks that are tested
Use connection pools

//Services
Have a clearly identified service layer
Represent the service layer with interfaces

//UI
Use Prototypes
Talk to the service layer

//Web
Don't rely on Web Sessions except minimally

//Security
Use enterprise level security authentication

Maturity Level II application


//Basics
Have an INREDIBLY simple application wide logging api
Have an INREDIBLY simple application wide configuration api
Advance Runtime exceptions
Don't catch exceptions unless you know what to do
To protect your resource integrity use finally clauses

//Database
Keep SQL outside of executable code
Use standard data access frameworks that are tested
Use connection pools

//Services
Have a clearly identified service layer
Represent the service layer with interfaces
Allow services for field selection and where clause specialization

//UI
Use Prototypes
Talk to the service layer

//Web
Monitor your resource connections
    (files, database connections, threads etc)
Don't rely on Web Sessions except minimally

//Security
Use enterprise level security authentication

Maturity Level III Adhere to all of the stated principles


//Basics
Have an INREDIBLY simple application wide logging api
Have an INREDIBLY simple application wide configuration api
Advance Runtime exceptions
Don't catch exceptions unless you know what to do
To protect your resource integrity use finally clauses
Use something like Spring if availabe for object instantiation
Aware of and Increase configurability index

//Database
Keep SQL outside of executable code
Use standard data access frameworks that are tested
Use connection pools
Use Implicit transactions

//Services
Have a clearly identified service layer
Represent the service layer with interfaces
Provide interceptors for service layers
Allow services for field selection and where clause specialization
Build 30% additional capacity in services

//UI
Use Prototypes
Talk to the service layer
Rely on a Page Data Object
See if configuration is more suitable
Manage view state on the client

//Web
Monitor your resource connections
    (files, database connections, threads etc)
Don't rely on Web Sessions except minimally
Make sure browser back and refresh works
Adapt B2B/B2C compatible architecture
Promote REST for services

//Security
Use enterprise level security authentication