Introduction To
Introduction To
Introduction to Omega.NET
Omega.NET
Page 1 of 10
Omega.NET Complete Reference
1. INTRODUCTION.............................................................................................................................. 3
Page 2 of 10
Omega.NET Complete Reference
1. Introduction
Quality of the code is of paramount importance not only to our customers but even to Cognizant stake-
holders. Better quality code helps in increasing the trust level of our customers. It establishes the fact
that Cognizant follows mature development practices and produces higher quality of code compared to
competition. Adoption of best practices during initial stages of project development reduces
considerable effort in code refactoring, maintenance, performance tuning, troubleshooting at any stage
of the project.
As per the McKinsey report, Cognizant productivity is approximately 30% lower compared to the
competition. Many of the customers/prospects have become more demanding and many of the critical
deals are decided based on attractive price point.
Omega.NET is a framework for enabling Cognizant developers deliver better quality code to our
customers with minimal cost. It helps in building a performance oriented, maintainable and secure code
and aims to address critical software quality issues earlier in project lifecycle. Quality is something that
needs to be looked into during the early stage of the project rather than after thought. An example for
this would be a reference implementation to convey guiding principles and standards to development
team. Quality is not something that can be easily added later. Problems that are too complex, too
obscure, or are discovered too late in the product cycle are usually not fixed and cost of fixing is
unusually high.
Omega.NET consists of 10 core engineering practices to ensure that code developed by our developers
passes through various quality gates set internally or by our customers. These engineering practices
cover all critical aspects related to application development and helps in establishing governance
process as well to ensure better code quality. This finally results in improved developer productivity.
Page 3 of 10
Omega.NET Complete Reference
Coding standards help in setting guidelines for the development team to ensure that code quality is not
compromised. Entire team follows similar standard so that consistency is maintained. Establishing
coding standards earlier in the project lifecycle is critical to ensure health of the project continues to
improve. A coding standards document provides details to the developers about how they need to write
code. This helps in creating standards for the entire project, ensuring that individuals in the team do not
write code in their own style.
It is important that entire team uses the same standards and the team is upto date with the latest
changes in standards. The team should be re-iterated on these standards on a regular basis. This is
important as it cant be assumed that team members will refer the document on regular basis. New
entrants to the team need to undergo learning boot camp before getting started on the development
tasks.
There have been some instances where one programmer creates UI differently than the entire team.
When code goes to customer, customer likes the code of that individual and wants the entire code to be
modified in the same manner. Certainly the intention here is to improve the UI design but it can cause
major rework for the entire team. If anyone in the team has better idea, it is better to get acceptance
from the project lead before going ahead with the change.
XML style comments should be used in the code to describe the classes and its members. Tools such as
Doxygen or Sandcastle can auto-generate the code documents by parsing the xml comments directly
from the source code and create reference manuals in such forms as text or HTML files. Code
documents are often organized into a reference guide style, allowing programmers to quickly look up
specific function or a class.
Auto-generating documentation has various benefits; because it is extracted from the source code itself
(for example, through comments), the programmer can write it while referring to the code, and use the
same tools used to write the source code to make the documentation. This makes it much easier to
keep the documentation up-to-date.
Page 4 of 10
Omega.NET Complete Reference
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodingStandards.a
spx
Usually in software development there are lots of tasks which involve repetitive code with minor
changes. A code generator can automate the process of generating code based on these patterns
Page 5 of 10
Omega.NET Complete Reference
Automated code generation is the act of generating source code based on some model such as a
template and is usually accomplished with a utility. These tools allow the generation of source code
through various means. A simple form of code generation is template based code generation where in
the tool replaces patterns in source code according to simple rules. Most of the code generation tools
are either model-driven or template-driven.
Benefits
- Saves time and promotes consistency
- Gives a quick jumpstart to projects
- Allows to quickly re-using proven architectures
- Improve the developer productivity and makes his life easier
- Creates bug free, maintainable and quality code
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodeGeneration.as
px
Unit tests are used to exercise source code by directly calling the methods of a class. Appropriate
parameters are passed and the return value or state is verified against expected values, using Assert
statements. Unit test methods reside in test classes, which are stored in source code files. You can
create unit tests by using a code generation feature that creates the initial source code of the test, or
you can write the test completely by hand. Either way, the test class and all test methods are identified
by using programmatic attributes.
The goal of unit testing is to isolate each part of the program and show that the individual parts are
correct. A unit test provides a strict, written contract that the piece of code must satisfy. As a result, it
affords several benefits. Unit tests find problems early in the development cycle.
NUnit
NUnit is an automated unit testing framework for .NET. It is an open source product. You can get this
tool along with source code and modify the source code if required for your specific needs. NUnit is free
to use with your .NET projects.
Recommendation
Page 6 of 10
Omega.NET Complete Reference
For developers working with code held in VSTS/TFS it is recommended to utilize VSTS unit testing
framework. For non VSTS based development environments NUnit is the suggested tool.
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodeVerification
.aspx
During the implementation process, building applications with consistent code is considered one of the
main objectives, which the development team aims to, because it affects the final product quality. Code
Consistency means, writing code that follows the defined best practices while conforming to rules and
standards. Code review can be considered as one of the methods to guarantee code consistency, but
would be again prone to human errors. Hence the need to look at tool based / automated code analysis.
The term Code Analysis usually applies to the analysis performed by an automated tool. Static Source
Code Analysis is the process by which software developers check their code for problems and
inconsistencies. It is performed on the source code without actually having the need for execution. Code
Analysis tools use rules to specify the kind of analysis that needs to be performed.
Page 7 of 10
Omega.NET Complete Reference
Code Analysis tools scan the source code to detect errors that typically pass through compilers and
become latent problems. They generate reports that graphically present the analysis results and
recommend potential resolutions to identified problems. Sophistication of the code analysis varies from
those tools that only consider the behavior of individual statements and declarations to those that
include the complete source code of a program in their analysis.
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodeAnalysis.aspx
Finding performance bottlenecks is not an easy task without a code profiler. You can use
trial and error, sometimes spending hours, days, and even weeks blindly chasing
performance issues. Additionally, you could waste even more time tuning code that is not the cause
of any problem. It is rare for a bottleneck to be in the obvious place.
Even with best planning, you may still have to investigate performance problems during application
development. Code profiling can be used to identify performance issues within an application; it is the
act of collecting performance data (metrics) while an application or portion of the application is running.
This data can be analyzed to identify sections of code which cause performance bottlenecks.
A code profiler is a performance-analysis tool that measures the frequency and duration of function
calls. Results are then presented in a variety of formats, allowing you to see what is happening in your
source code. It allows developers to pin bugs down to a specific line of code, or determine scope of
optimization.
A code profiler analyzes your code in minutes, and the results allow you to:
Page 8 of 10
Omega.NET Complete Reference
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodeProfiling.aspx
Check in policies are important to control and improve the quality of code that is checked into the
repository. Policies are implemented using rules to allow or deny code check-in for a developer e.g.
Dont allow check-in if the continuous integration build fails. Rules are invoked when user is checking-
in source code or other artifacts into the repository
Check-in policies enable execution of rules whenever a developer tries to check-in code to the code
repository. A policy can range in complexity from something as simple as ensuring you enter a comment
at check-in, to something more complicated such as performing static code analysis and running tests.
The policy passes when the build is up to date and there are no code analysis errors. This document
provides details on configuring the check-in policies. It also talks about the list of available policies and
how to create custom policies.
Effective checkin policies ensure sanity and reliability of the code repository. It helps in establishing
governance process for development team. Additional information can be captured during check-in and
the same can be used for traceability aspects as well.
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodeControl.aspx
Continuous integration is a technique that encourages developers to check-in their code more
frequently, have it compiled by an Automated Build Process, run a suite of unit tests, and report on the
status. The idea is to tighten the feedback loop so that the effect of an integrated change is
communicated back to the developer as soon as possible. By reducing the time between check-in and
build status, developers find it much easier to identify faulty code.
A continuous integration server is responsible for monitoring the source code repository for changes
that are made during check-in. When a change is detected, the server automatically:
Page 9 of 10
Omega.NET Complete Reference
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/AutomatedBuild.as
px
Code promotion is a strategy that uses branches to promote code through some stabilization phases.
For example, you might have a Development branch in which your team does active development, a
Main branch in which your team is integrating and testing, and a Production branch that your team uses
for final release stabilization.
Project teams without a Code Promotion strategy are vulnerable to the following risk
Inefficiency due to the significantly long time between; when the feature was developed and
when it was fully tested.
Deferring the stabilization of features to the end of the project lifecycle, makes it impossible to
predict the duration of stabilization, to make it release ready.
Inability to reduce the scope of features to hit a release date because it was difficult to scale
back on features which, although had been coded, had not been stabilized. Scaling back on
scope was further exacerbated by the fact that newly developed features had introduced other
dependencies around them that were hard to back out.
Reference
https://gto/codenizant/OmegaDotNet/Shared%20Documents/CodePromotion.as
px
Page 10 of 10