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
Optimizely community meetup - Sept 29 (virtual + Melbourne)

Super excited to be presenting this Thursday the 29th of September at the Optimizely community meetup. For the full details and RSVP's see the...

Ynze | Sep 27, 2022 | Syndicated blog

Preview multiple Visitor Groups directly while browsing your Optimizely site

Visitor groups are great - it's an easy way to add personalization towards market segments to your site. But it does come with it's own set of...

Allan Thraen | Sep 26, 2022 | Syndicated blog

The Report Center is finally back in Optimizely CMS 12

With Episerver.CMS.UI 12.12.0 the Report Center is finally re-introduced in the core product.

Tomas Hensrud Gulla | Sep 26, 2022 | Syndicated blog

Dynamic Route in ASP.NET Core When MapDynamicControllerRoute Does Not Work

Background Creating one of the add-on for Optimizely I had to deal with challenge to register dynamically route for the API controller. Dynamic rou...

valdis | Sep 25, 2022 | Syndicated blog