K Khan
Aug 27, 2014
(3 votes)

Code Standards and Software Quality

To maintain quality of software is a big concern when working with the big teams having different level of expertise or with offshore teams. There are many tools and techniques are available in software industry. I am very interested in knowing that what other Technology Masters are doing to maintain code standards and quality of the software.


StyleCop provides value by enforcing a common set of style rules for C# code. StyleCop will continue to ship with a single, consistent set of rules, with minimal rule configuration allowed. Developers can implement their own rules if they so choose. StyleCop ships with the ability to seamlessly integrate with Visual Studio, MSBuild, TFS, etc. Developers are free to implement custom code to integrate StyleCop into other development and tooling environments also. StyleCop is free. You can download Here. It feels boring while working with the StyleCop, as you may have to fix 20-30 issues for no reason but soon you will use to and will start writing the code to match standards. It checks spellings also in summary.

Static Code Analysis:

There are a lot of commercial and free static code analysers are available in market. Is it important to you or not is a separate discussion. If you are using Visual Studio Premium, It comes with a built-in Code analyser, that can be turned on from Project properties and You can set any rule set that suits to you. While working with the EPiServer products upgrades can cause some issues e.g. we upgraded a Site to latest EPiServer Commerce and EPiServer Find versions and it started giving us code analysis issues because EPiServer Commerce dlls were compiled with a different version of EPiServer.CMS.Core and EPiServer Find CMS Integration dlls were compiled with EPiServer.CMS.Core. we have to overrule the rule to fix this Code analysis issue. It is simple to overrule in project file true ExtendedCorrectnessRules.ruleset true /assemblycomparemode:StrongNameIgnoringVersion

Code Reviews:

Review each and every piece of code after completion of Backlog Item by a Technical Lead or a Senior Developer.

Aug 27, 2014


valdis Aug 27, 2014 10:12 PM

Run code duplicate analysis from VS.
Enforce code formatting rules (layout, member names, etc).
Enforce unit-test coverage.
Spell checker for VS and for R# (each checks different areas in code) to avoid misspelled API.
On code reviews - it's great if tech lead can review every single PBI. Do it more regularly and follow-up with developer to reduce future frequency of such reviews.
Use common sense :)

K Khan
K Khan Aug 28, 2014 10:47 AM

Valdis Thanks for this addition, We usually use a template class file to enforce layouts

Justin Le
Justin Le Aug 29, 2014 08:47 AM

Continuous integration or gated check-in will also help to reduce chance of breaking the build.

K Khan
K Khan Aug 29, 2014 09:44 AM

Thanks Dzung, on topic of CI/CD, I think EPiServer needs to do bit better (Some other CMS can web deploy itself.)

On start of project set your clear goals regarding Continuous Integration and Deployment.
The build process should be totally automated.
The build process should result in a release package.
CI server should run all unit tests, code analysis and test code coverage every time the build is run.
How it will be notified to team and action required in result of failure. (can effects plans of project managers)
The deployment process can/should be totally automatic (Plan for QA,Staging.Live enviornments)
Rollback should also be fully automated.
It should always be possible to rollback an update (including DB, Settings including IIS Settings and files, etc.).

There are few good posts on this topic

K Khan
K Khan Sep 5, 2014 03:24 PM

For reference : http://www.epinova.no/blog/arild-henrichsen/dates/2014/9/basic-xcopy-deployment-of-episerver-cms-75-to-a-windows-server-2012/
Thanks arlid for this guide.

Arild Henrichsen
Arild Henrichsen Sep 8, 2014 10:27 AM

You're welcome, Khurram :-)

In addition to what's mentioned above, at Epinova we have a pretty comprehensive QA system which is used both during development and during project reviews before launching a site.

The Epinova QA system for EPiServer projects (before CMS 7 came out) is described in detail here:
(That checklist is for back-end - we also have a similar checklist for front-end.)

Our QA system includes a big checklist of DOs and DON'Ts. A checklist like this is only useful if developers have it in their mindset throughout the entire development phase. It is NOT a quickfix at the end of a project.

Also, we have a lot of automated code tests which use the External Tools feature in Visual Studio. These find errors and inconsistencies that would be difficult and time-consuming to spot manually.
See the "Automated Visual Studio tools and CI tests" section in the link above.

K Khan
K Khan Sep 8, 2014 10:39 AM

Inspiring ... Inspiring ...

Please login to comment.
Latest blogs
Vulnerability in EPiServer.GoogleAnalytics v3 and v4

Introduction A potential security vulnerability was detected for Optimizely Google Analytics addon (including EPiServer.GoogleAnalytics and...

Bien Nguyen | Sep 20, 2023

Overriding Optimizely’s Content Recommendations Block to Implement Custom Recommendations

Introduction The Content Recommendations add-on for Optimizely CMS dynamically recommends content from your site tailored to the interests of each...

abritt | Sep 13, 2023 | Syndicated blog

Developer contest! Install the AI Assistant and Win Bose QC45 Headphones!

We are thrilled to announce a developer contest where you have the chance to win a pair of Bose Headphones. The goal is to be the first developer t...

Luc Gosso (MVP) | Sep 7, 2023 | Syndicated blog

Send Optimizely notifications with SendGrid API, not SMTP

If your Optimizely site already sends transaction emails through an email platform API, why not do the same with Optimizely notification emails?

Stefan Holm Olsen | Sep 6, 2023 | Syndicated blog

Optimizely Configured Commerce Custom POST API

Introduction When creating custom API controllers for an Optimizely B2B project it’s possible you’ll want to create POST calls. Following the...

Dylan Barter | Sep 6, 2023

Using Google’s structured data to improve your SEO in Optimizely's B2B Configured Commerce

Introduction Following proper markup standards for search engine optimization is imperative for the success of every website. While Optimizely B2B’...

Dylan Barter | Sep 6, 2023