K Khan
Aug 27, 2014
visibility 4890
star star star star star
(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:

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

Comments

valdis
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
http://msdn.microsoft.com/en-gb/library/ms247121.aspx

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.
e.g.
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
http://world.episerver.com/Blogs/Anton-Kallenberg/Tags/Continuous-integration/

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:
http://www.epinova.no/blog/Thomas-Leela/dates/2012/12/epinova-qa-checklist-for-episerver-cms-6-projects/
(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 ...

error Please login to comment.
Latest blogs
Composition Over Inheritance: Why Your Content Contract Is Not a Base Class

Inside the structural conformance pattern in SaaS CMS — from server-side inheritance to pipeline governance. A contract in Optimizely SaaS CMS is...

Vipin Banka | Sep 19, 2026

Optimizely Opti ID Integration: Why the API Key Was Missing from the DXP Management Portal

While working on an Optimizely CMS 12 Opti ID integration recently, we ran into an issue that initially appeared to be related to SSO authenticatio...

Madhu | Sep 18, 2026 |

Extending a Contract: What You Can Override

Contracts share fields across content types — but not every field setting can be overridden. Push the same contract onto several components, and CM...

Chirag Khanna | Sep 18, 2026 |

Building a Blazor Server UI Inside the Optimizely CMS 13 Admin Shell

What I learned shipping a Blazor Server UI inside Optimizely CMS 13 — Razor components in a NuGet package, the Blazor hub next to MapContent(),...

Stanisław Szołkowski | Sep 17, 2026 |

Giving Optimizely 13 Content Types Meaningful Icons and Thumbnails

When working with an Optimizely CMS solution that has evolved over time, it is common to end up with many content types. As the number grows, the...

Pär Wissmark | Sep 16, 2026 |

force-dynamic vs connection() for Optimizely Graph

If you have built an Optimizely CMS SDK site, you already know getContentByPath on a catch-all. This post is about the part that file never says ou...

Chirag Khanna | Sep 16, 2026 |