S# Audit Area CheckList Item
1 Deployment Deploying over different nodes to make load and performance balance
2 Enable HTTP copression in order to compress the data for request and response
  Use load balancers to distribute the requests between nodes
3 Ditribute components over deployment environment to balance the solution load 
4 Client Side store data on the client for related objects
5 Never consume the trafic in refereshing the content without need, Use keys and its expiry,
like refereshing the bug status report without any adding or updating for the issues
6 Put java script at the bottom, and CSS at the top
7 Synching contnent should be limited for specific model and specific attributes [Do not retrieve or send non required data]
8 Use Client Side Validation to prevent consuming the connections
9 Using cookies for caching content
10 Use the output cache directives as possible as you can, specially in static content:
<%@ OutputCache Duration="3600" VaryByParam="none" %> 
  Use the output cache for actions according to business needs, for variables, and durations
[OutputCache(Duration=10, VaryByParam="none")]
public ActionResult Index()
11 Cache dynamic objects accrording to the contents update expected trafic: Company,Branches,ClassG,Brands,UserInfo
12 Cache static contents and objects using the configuration files directives
13 Source code Define variable just before it’s needed
14 Confirm using the Postback attribute to prevent loading the page info each time
17 Using for multiple threading
18 Using programmable objects over the database engine (View,Function,Procedure,trigger,...)
20 Using primitive datatypes as mutch as possible
21 Never run or build your application in debug mode, just use debug mode when debugging.
22 Every class, operation should have only single responsibility (SRP).
Example:
Do not let your function open connection, Get Values, and Close connection, each function should have one concreate responsibility.
23 No one can access the variables except throw access modifiers or functions in order to control the call stack
24 reduce the usage of complicated graphics as possible
25 using switch cases instead of [if conditions] for complex conditions
26 Do not depend on connected model to get solution metadata
27 Use a Stringbuilder instead of string concatenation if multiple concatenations are required, to save heap memory.
28 Boxing & Unboxing : Avoid type casting and type conversions as much as possible; because it is a performance penalty.
29 Switch Cases: If you have many items in branching code you should definitely use a switch, not if else.
30 Avoid nested for/foreach loops and nested if conditions as much as possible.
31 If-Else: When you use (If/Else) try to put the most likely true conditions at the first, and then according to the probability.
32 Never use .ToString with string objects
33 Never use redundant qualifier, like This.MyText; 
34 Never initialize the variable by its default value
35 Removing unnecessary expections handling for imposible cases.
36 objects serialization should be occurred throw pre-developed parsers, not manually, Like JsonSerializer and XmlSerializer classes, and AutoMapper library
37 Reduce the usage of boxing and unboxing variables
38 passing values by reference not by value
39 Use of layered architecture to prevent coupling and increase cohesion
40 Define the variable before you use it directly to have concrete blocks of code.
41 Use try finaly sections to release resources even error or exception occurred 
42 Bulk Operations should be handled by the server
44 Disposing of Unmanaged Resources like File I/O, Network resources, etc. They have to be disposed of once their usage is completed. Use usings block for unmanaged code, if you want to automatically handle the disposing of objects once they are out of scope.
It should be inherited from IDisposable Interface
45 Just invoke methods once according to it's suitable events, for example,
if you are executing functionality according to the change of value,
do not put the implementation in the lost focus, but when the value changed , so with lost focust you should check for value change
46 Connection Minimize http request for the same operation
47 Provide information are limited only upon request
48 Do not send data more than required
49 Do not use chatty interface, means multiple rounds to perform single operation
50 Conduct client side validation as possible
51 Define clear responsibility for communication [will be clear in sequence diagram model],
 so it will reduce boundaries crossing and unmanaged communications between objetcs or nodes
52 consider the public and private variables to prevent additional overheads in objects serialization when parsing
53 Cache every where considering expiration rules
54 using JSON format instead of XML to prevent XML tags parsing
55 minimize the amount of data to be transferred
56 Server Side caching for server objects related to the whole solution, time based,sql table based,
parameter based, and file based using dependencies
57 Configure Etags technique on server for caching request and responses
58 Using database indexes
59 In web.config : Set The page compilation debug to false when deploying the page to prevent compiling the page each request, You can check using the developer tools to check the decrease in size
<system.web>
    <authentication mode="None" />
    <compilation debug="false" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <pages>
60 Use native components in DAL if you do not connect to more that one database type, SQLConnection, AdoDbConnection, OleDb
61 consider the model of "fire and forget" to prevent the waiting time: EDM, and TAP
62 Test automation Using automated tools to perform performance and load test
63 Load testing occurred for the estimated number of users
64 Testing occurred over expected volume [Size of data]
65 Time for execution for each function is accepted over the minimum requirements for deployment model
66 Database Use precompiled procedures to execute DML
67 Retrieve only the required columns
68 Retrieve data only upon request
69 Use exists instead of count for checking the existance of recrords
  Analyze the table according to its size in order to take corrective action, using the following sql statement:
select * from (SELECT
    t.NAME AS TableName,
    s.Name AS SchemaName,
    p.rows AS RowCounts,
    SUM(a.total_pages) * 8 AS TotalSpaceKB,
    CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
    SUM(a.used_pages) * 8 AS UsedSpaceKB,
    CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
    (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
    CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB
FROM
    sys.tables t
INNER JOIN     
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN
    sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN
    sys.schemas s ON t.schema_id = s.schema_id
WHERE
    t.NAME NOT LIKE 'dt%'
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID > 255
GROUP BY
    t.Name, s.Name, p.Rows
--ORDER BY     t.Name
) recset

order by recset.usedspacemb desc
70 Set the no count on at the procedure start to prevent sending affected records
  Apply normalization forms for database structure
  Create indexes for all columns used after the where condition
  Use distributed database for the solution:
1- Vertically
2- Horizontally
71 use indexing for the search attributes if you need:
- to retrieve less than 15%
-Join tables
-Column has unique content
-Column has wide range of values
-Column with many nulls but search are required for the real values
-Reduce the number of indexes for transactional tables, and increase them for read only tables
-Order the columns in the index according to its use in the search criteria
- Review the database objects [tables] to truncate logs, remove tables, and merge databases
72 Tracing Use IIS Tracing to write in the site tracing file "AXD" in order to determine the leak functions
73  
74  
75  
Prefetching DNS Use prefetching directives to reduce the DNS lookup time as follow:
In the head section add the following:
<meta  http-equiv="Content-Type" content="text/html; charset=utf-8"  />
<link rel="dns-prefetch" href="//d1ptw4e7d9kcvs.cloudfront.net">

<link rel="dns-prefetch" href="//connect.facebook.net">

<link rel="dns-prefetch" href="//www.googletagmanager.com">

<link rel="dns-prefetch" href="//www.mainadv.com">